[Intel-wired-lan] [PATCH net-next] ice: get switch id on switchdev devices
Penigalapati, Sandeep
sandeep.penigalapati at intel.com
Mon Apr 25 10:27:54 UTC 2022
>-----Original Message-----
>From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of
>Marcin Szycik
>Sent: Wednesday, April 20, 2022 4:53 PM
>To: intel-wired-lan at lists.osuosl.org
>Subject: [Intel-wired-lan] [PATCH net-next] ice: get switch id on switchdev
>devices
>
>From: Michal Swiatkowski <michal.swiatkowski at linux.intel.com>
>
>Switch id should be the same for each netdevice on a driver.
>The id must be unique between devices on the same system, but does not
>need to be unique between devices on different systems.
>
>The switch id is used to locate ports on a switch and to know if aggregated
>ports belong to the same switch.
>
>To meet this requirements, use pci_get_dsn as switch id value, as this is
>unique value for each devices on the same system.
>
>Implementing switch id is needed by automatic tools for kubernetes.
>
>Set switch id by setting devlink port attribiutes and calling
>devlink_port_attrs_set while creating pf (for uplink) and vf (for representator)
>devlink port.
>
>To get switch id (in switchdev mode):
>cat /sys/class/net/$PF0/phys_switch_id
>
>Signed-off-by: Michal Swiatkowski <michal.swiatkowski at linux.intel.com>
>Signed-off-by: Marcin Szycik <marcin.szycik at linux.intel.com>
>---
> drivers/net/ethernet/intel/ice/ice_devlink.c | 22 ++++++++++++++++++++
> drivers/net/ethernet/intel/ice/ice_main.c | 15 +++++++++++++
> 2 files changed, 37 insertions(+)
>
Tested-by: Sandeep Penigalapati <sandeep.penigalapati at intel.com>
More information about the Intel-wired-lan
mailing list