Thread (5 messages) 5 messages, 4 authors, 2025-10-29

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

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

-----Original Message-----
From: Jakub Kicinski <kuba@kernel.org>
Sent: Tuesday, October 28, 2025 6:02 PM
To: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Paolo Abeni <pabeni@redhat.com>; Haiyang Zhang
[off-list ref]; linux-hyperv@vger.kernel.org;
netdev@vger.kernel.org; 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; 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: Re: [EXTERNAL] Re: [net-next, v3] net: mana: Support HW link
state events

On Tue, 28 Oct 2025 19:36:02 +0000 Haiyang Zhang wrote:
quoted
quoted
Why is  the above needed? I thought mana_link_state_handle() should
kick
quoted
quoted
and set the carrier on as needed???
Thanks for the question -- our MANA NIC only sends out the link state
down/up
quoted
messages when need to let the VM rerun DHCP client and change IP
address...
quoted
So, I need to add netif_carrier_on(ndev) in the probe(), otherwise the
/sys/class/net/ethX/operstate will remain "unknown" until it receives
the
quoted
Link down/up messages which do NOT always happen.
Oh that makes the code make much more sense.
Please add this and more detail into the commit message.
Will do.
quoted
+			if (!netif_carrier_ok(ndev))
+				netif_carrier_on(ndev);
Testing carrier_ok() before calling carrier_on/off is entirely
pointless, please see the relevant implementations.

BTW I think the ac->link_event accesses are technically racy,
wrap them in READ_ONCE() / WRITE_ONCE() while you respin.
(Unless mana_hwc_init_event_handler() is somehow under rtnl_lock)
I will remove the netif_carrier_ok(), and add READ/WRITE_ONCE.

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