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] [day] [month] [year] [list]
Message-ID: <20250801131513.45a6274d@kernel.org>
Date: Fri, 1 Aug 2025 13:15:13 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Tony Nguyen <anthony.l.nguyen@...el.com>
Cc: davem@...emloft.net, pabeni@...hat.com, edumazet@...gle.com,
 andrew+netdev@...n.ch, netdev@...r.kernel.org, Jedrzej Jagielski
 <jedrzej.jagielski@...el.com>, przemyslaw.kitszel@...el.com,
 jiri@...nulli.us, horms@...nel.org, David.Kaplan@....com,
 dhowells@...hat.com, Paul Menzel <pmenzel@...gen.mpg.de>
Subject: Re: [PATCH net 1/2] devlink: allow driver to freely name interfaces

On Fri,  1 Aug 2025 10:22:37 -0700 Tony Nguyen wrote:
> Subject: [PATCH net 1/2] devlink: allow driver to freely name interfaces

The subject is a bit misleading.. Maybe something like:

  let driver opt out of automatic phys_port_name generation

> Date: Fri,  1 Aug 2025 10:22:37 -0700
> X-Mailer: git-send-email 2.47.1
> 
> From: Jedrzej Jagielski <jedrzej.jagielski@...el.com>
> 
> Currently when adding devlink port it is prohibited to let a driver name
> an interface on its own. In some scenarios it would not be preferable to
> provide such limitation, eg some compatibility purposes.
> 
> Add flag skip_phys_port_name_get to devlink_port_attrs struct which
> indicates if devlink should not alter name of interface.
> 
> Suggested-by: Jiri Pirko <jiri@...nulli.us>

Link to the suggestion could be useful?

> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@...el.com>
> Reviewed-by: Paul Menzel <pmenzel@...gen.mpg.de>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@...el.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@...el.com>
> ---
>  include/net/devlink.h | 7 ++++++-
>  net/devlink/port.c    | 3 +++
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/include/net/devlink.h b/include/net/devlink.h
> index 93640a29427c..bfa795bf9998 100644
> --- a/include/net/devlink.h
> +++ b/include/net/devlink.h
> @@ -78,6 +78,7 @@ struct devlink_port_pci_sf_attrs {
>   * @flavour: flavour of the port
>   * @split: indicates if this is split port
>   * @splittable: indicates if the port can be split.
> + * @skip_phys_port_name_get: if set devlink doesn't alter interface name

Again, we're not actually doing anything the the interface name.
We're exposing a sysfs attribute which systemd/udev then uses
to rename the interface. From kernel PoV this is about attributes.

>   * @lanes: maximum number of lanes the port supports. 0 value is not passed to netlink.
>   * @switch_id: if the port is part of switch, this is buffer with ID, otherwise this is NULL
>   * @phys: physical port attributes
> @@ -87,7 +88,11 @@ struct devlink_port_pci_sf_attrs {
>   */
>  struct devlink_port_attrs {
>  	u8 split:1,
> -	   splittable:1;
> +	   splittable:1,
> +	   skip_phys_port_name_get:1; /* This is for compatibility only,
> +				       * newly added driver/port instance
> +				       * should never set this.
> +				       */

Thanks for noting that this is compat-only. I think it'd be better
to consolidate the comments, since we have kdoc..
Move this note up to kdoc; or document the member inline:

	splittable:1,
	/**
	 * @skip_phys_port_..: bok bok ba-gok!
	 */
	skip_phys_port_name_get:1;

BTW the name is a bit long, "no_phys_port_name" please?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ