lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251028150151.3b3b7121@kernel.org>
Date: Tue, 28 Oct 2025 15:01:51 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Haiyang Zhang <haiyangz@...rosoft.com>
Cc: Paolo Abeni <pabeni@...hat.com>, Haiyang Zhang
 <haiyangz@...ux.microsoft.com>, "linux-hyperv@...r.kernel.org"
 <linux-hyperv@...r.kernel.org>, "netdev@...r.kernel.org"
 <netdev@...r.kernel.org>, Paul Rosswurm <paulros@...rosoft.com>, Dexuan Cui
 <DECUI@...rosoft.com>, KY Srinivasan <kys@...rosoft.com>,
 "wei.liu@...nel.org" <wei.liu@...nel.org>, "edumazet@...gle.com"
 <edumazet@...gle.com>, "davem@...emloft.net" <davem@...emloft.net>, Long Li
 <longli@...rosoft.com>, "ssengar@...ux.microsoft.com"
 <ssengar@...ux.microsoft.com>, "ernis@...ux.microsoft.com"
 <ernis@...ux.microsoft.com>, "dipayanroy@...ux.microsoft.com"
 <dipayanroy@...ux.microsoft.com>, Konstantin Taranov
 <kotaranov@...rosoft.com>, "horms@...nel.org" <horms@...nel.org>,
 "shradhagupta@...ux.microsoft.com" <shradhagupta@...ux.microsoft.com>,
 "leon@...nel.org" <leon@...nel.org>, "mlevitsk@...hat.com"
 <mlevitsk@...hat.com>, "yury.norov@...il.com" <yury.norov@...il.com>,
 Shiraz Saleem <shirazsaleem@...rosoft.com>, "andrew+netdev@...n.ch"
 <andrew+netdev@...n.ch>, "linux-rdma@...r.kernel.org"
 <linux-rdma@...r.kernel.org>, "linux-kernel@...r.kernel.org"
 <linux-kernel@...r.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:
> > Why is  the above needed? I thought mana_link_state_handle() should kick
> > and set the carrier on as needed???  
> 
> Thanks for the question -- our MANA NIC only sends out the link state down/up 
> messages when need to let the VM rerun DHCP client and change IP address...
> 
> 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 
> 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.

> +			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)
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ