Thread (3 messages) 3 messages, 3 authors, 2025-10-20

RE: [EXTERNAL] Re: [PATCH net-next,v2] net: mana: Support HW link state events

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: 2025-10-20 14:58:29
Also in: linux-hyperv, linux-rdma, lkml

-----Original Message-----
From: Jakub Kicinski <kuba@kernel.org>
Sent: Friday, October 17, 2025 7:06 PM
To: Haiyang Zhang <redacted>
Cc: linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; Haiyang Zhang
[off-list ref]; Paul Rosswurm [off-list ref]; Dexuan
Cui [off-list ref]; KY Srinivasan [off-list ref];
wei.liu@kernel.org; edumazet@google.com; davem@davemloft.net;
pabeni@redhat.com; Long Li [off-list ref];
ssengar@linux.microsoft.com; ernis@linux.microsoft.com;
dipayanroy@linux.microsoft.com; Konstantin Taranov
[off-list ref]; horms@kernel.org;
shradhagupta@linux.microsoft.com; leon@kernel.org; mlevitsk@redhat.com;
yury.norov@gmail.com; Shiraz Saleem [off-list ref];
andrew+netdev@lunn.ch; linux-rdma@vger.kernel.org; linux-
kernel@vger.kernel.org
Subject: [EXTERNAL] Re: [PATCH net-next,v2] net: mana: Support HW link
state events

On Tue, 14 Oct 2025 14:26:49 -0700 Haiyang Zhang wrote:
quoted
From: Haiyang Zhang <haiyangz@microsoft.com>

Handle the HW link state events received from HW channel, and
set the proper link state, also stop/wake queues accordingly.
Why do you have to stop / start the queues? I think it's unusual.
Let the packets get dropped, sending out potentially old packets
when link comes back is not going to make anyone happier.
Will do.
quoted
+static void mana_link_state_handle(struct work_struct *w)
+{
+	struct mana_port_context *apc;
+	struct mana_context *ac;
+	struct net_device *ndev;
+	bool link_up;
+	int i;
+
+	ac = container_of(w, struct mana_context, link_change_work);
+
+	if (ac->mana_removing)
+		return;
+
+	rtnl_lock();
+
quoted
@@ -3500,6 +3556,10 @@ void mana_remove(struct gdma_dev *gd, bool
suspending)
quoted
 	int err;
 	int i;

+	ac->mana_removing = true;
+
+	cancel_work_sync(&ac->link_change_work);
Looks racy, the work needs @ac to check the ->mana_removing but
mana_remove() frees @ac. Just use disable_work_sync() please.
Good idea. Will update the patch.

Thanks,
- Haiyang
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help