[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251017160541.4ce65ede@kernel.org>
Date: Fri, 17 Oct 2025 16:05:41 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Haiyang Zhang <haiyangz@...ux.microsoft.com>
Cc: linux-hyperv@...r.kernel.org, netdev@...r.kernel.org,
haiyangz@...rosoft.com, paulros@...rosoft.com, decui@...rosoft.com,
kys@...rosoft.com, wei.liu@...nel.org, edumazet@...gle.com,
davem@...emloft.net, pabeni@...hat.com, longli@...rosoft.com,
ssengar@...ux.microsoft.com, ernis@...ux.microsoft.com,
dipayanroy@...ux.microsoft.com, kotaranov@...rosoft.com, horms@...nel.org,
shradhagupta@...ux.microsoft.com, leon@...nel.org, mlevitsk@...hat.com,
yury.norov@...il.com, shirazsaleem@...rosoft.com, andrew+netdev@...n.ch,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next,v2] net: mana: Support HW link state events
On Tue, 14 Oct 2025 14:26:49 -0700 Haiyang Zhang wrote:
> From: Haiyang Zhang <haiyangz@...rosoft.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.
> +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();
> +
> @@ -3500,6 +3556,10 @@ void mana_remove(struct gdma_dev *gd, bool suspending)
> 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.
--
pw-bot: cr
Powered by blists - more mailing lists