[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <PH0PR11MB59025732C1FB84E780AF0906F023A@PH0PR11MB5902.namprd11.prod.outlook.com>
Date: Mon, 4 Aug 2025 11:39:55 +0000
From: "Jagielski, Jedrzej" <jedrzej.jagielski@...el.com>
To: Jakub Kicinski <kuba@...nel.org>, "Nguyen, Anthony L"
<anthony.l.nguyen@...el.com>
CC: "davem@...emloft.net" <davem@...emloft.net>, "pabeni@...hat.com"
<pabeni@...hat.com>, "edumazet@...gle.com" <edumazet@...gle.com>,
"andrew+netdev@...n.ch" <andrew+netdev@...n.ch>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>, "Kitszel, Przemyslaw"
<przemyslaw.kitszel@...el.com>, "jiri@...nulli.us" <jiri@...nulli.us>,
"horms@...nel.org" <horms@...nel.org>, "David.Kaplan@....com"
<David.Kaplan@....com>, "dhowells@...hat.com" <dhowells@...hat.com>, "Paul
Menzel" <pmenzel@...gen.mpg.de>
Subject: RE: [PATCH net 1/2] devlink: allow driver to freely name interfaces
From: Jakub Kicinski <kuba@...nel.org>
Sent: Friday, August 1, 2025 10:15 PM
>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
Sure, title will be changed
>
>> 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?
yeah, why not, it provides some context
>
>> 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
It was Jiri who instantly suggested that note :P
>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;
oh right, it will be moved to kdoc
>
>BTW the name is a bit long, "no_phys_port_name" please?
sure, i like it, will be changed
Powered by blists - more mailing lists