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: <aKZXPF3VgmwSA2up@mozart.vkv.me>
Date: Wed, 20 Aug 2025 16:16:12 -0700
From: Calvin Owens <calvin@...nvd.org>
To: "Loktionov, Aleksandr" <aleksandr.loktionov@...el.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"Nguyen, Anthony L" <anthony.l.nguyen@...el.com>,
	"Kitszel, Przemyslaw" <przemyslaw.kitszel@...el.com>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	"Jagielski, Jedrzej" <jedrzej.jagielski@...el.com>,
	"Vecera, Ivan" <ivecera@...hat.com>,
	"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [Intel-wired-lan] [PATCH net] i40e: Prevent unwanted interface
 name changes

On Wednesday 08/20 at 15:51 +0000, Loktionov, Aleksandr wrote:
> > -----Original Message-----
> > From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf
> > Of Calvin Owens
> > Sent: Wednesday, August 20, 2025 6:29 AM
> > To: netdev@...r.kernel.org
> > Cc: Nguyen, Anthony L <anthony.l.nguyen@...el.com>; Kitszel,
> > Przemyslaw <przemyslaw.kitszel@...el.com>; Andrew Lunn
> > <andrew+netdev@...n.ch>; David S. Miller <davem@...emloft.net>; Eric
> > Dumazet <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>; Paolo
> > Abeni <pabeni@...hat.com>; Jagielski, Jedrzej
> > <jedrzej.jagielski@...el.com>; Vecera, Ivan <ivecera@...hat.com>;
> > intel-wired-lan@...ts.osuosl.org; linux-kernel@...r.kernel.org
> > Subject: [Intel-wired-lan] [PATCH net] i40e: Prevent unwanted
> > interface name changes
> > 
> > The same naming regression which was reported in ixgbe and fixed in
> > commit e67a0bc3ed4f ("ixgbe: prevent from unwanted interface name
> > changes") still exists in i40e.
> > 
> > Fix i40e by setting the same flag, added in commit c5ec7f49b480
> > ("devlink: let driver opt out of automatic phys_port_name
> > generation").
> > 
> > Fixes: 9e479d64dc58 ("i40e: Add initial devlink support")
> > Signed-off-by: Calvin Owens <calvin@...nvd.org>
> > ---
> >  drivers/net/ethernet/intel/i40e/i40e_devlink.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_devlink.c
> > b/drivers/net/ethernet/intel/i40e/i40e_devlink.c
> > index cc4e9e2addb7..40f81e798151 100644
> > --- a/drivers/net/ethernet/intel/i40e/i40e_devlink.c
> > +++ b/drivers/net/ethernet/intel/i40e/i40e_devlink.c
> > @@ -212,6 +212,7 @@ int i40e_devlink_create_port(struct i40e_pf *pf)
> > 
> >  	attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL;
> >  	attrs.phys.port_number = pf->hw.pf_id;
> > +	attrs.no_phys_port_name = 1;
> 1 is acceptable, but kernel style prefers true for boolean fields.
> Can you use 'true' instead?

Sure, if this ends up going forward I'll do that in v2.

> >  	i40e_devlink_set_switch_id(pf, &attrs.switch_id);
> >  	devlink_port_attrs_set(&pf->devlink_port, &attrs);
> >  	err = devlink_port_register(devlink, &pf->devlink_port, pf-
> > >hw.pf_id);
> Thank you for the patch aligning i40e with ixgbe behavior to prevent unwanted interface renaming. This is correct and minimal.
> 
> You're adding attrs.no_phys_port_name = 1; but there's no comment in the function explaining why. While not strictly required, maintainers often expect a short inline comment like:
> /* Prevent automatic phys_port_name generation (see ixgbe fix) */
> 
> This will help future readers understand why this flag is set, what do you think?

Hmm, it feels a bit redundant to me: "no_phys_port_name" is already
pretty descriptive, and the details (with SHAs) are one git-blame away
in the commit message.

> > --
> > 2.47.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ