netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC net-next 0/5] devlink: Add unique identifier to devlink port function
@ 2025-04-23 13:50 Moshe Shemesh
  2025-04-23 13:50 ` [RFC net-next 1/5] " Moshe Shemesh
                   ` (5 more replies)
  0 siblings, 6 replies; 25+ messages in thread
From: Moshe Shemesh @ 2025-04-23 13:50 UTC (permalink / raw)
  To: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, Donald Hunter, Jiri Pirko,
	Jonathan Corbet, Andrew Lunn
  Cc: Tariq Toukan, Saeed Mahameed, Leon Romanovsky, Mark Bloch,
	Moshe Shemesh

A function unique identifier (UID) is a vendor defined string of
arbitrary length that universally identifies a function. The function
UID can be reported by device drivers via devlink dev info command.

This patch set adds UID attribute to devlink port function that reports
the UID of the function that pertains to the devlink port. Code is also
added to mlx5 as the first user to implement this attribute.

The main purpose of adding this attribute is to allow users to
unambiguously map between a function and the devlink port that manages
it, which might be on another host.

For example, one can retrieve the UID of a function using the "devlink
dev info" command and then search for the same UID in the output of
"devlink port show" command.

The "devlink dev info" support for UID of a function is added by a
separate patchset [1]. This patchset is submitted as an RFC to
illustrate the other side of the solution.

Other existing identifiers such as serial_number or board.serial_number
are not good enough as they don't guarantee uniqueness per function. For
example, in a multi-host NIC all PFs report the same value.

Example output:

$ devlink port show pci/0000:03:00.0/327680 -jp
{
    "port": {
        "pci/0000:03:00.0/327680": {
            "type": "eth",
            "netdev": "pf0hpf",
            "flavour": "pcipf",
            "controller": 1,
            "pfnum": 0,
            "external": true,
            "splittable": false,
            "function": {
                "hw_addr": "5c:25:73:37:70:5a",
                "roce": "enable",
                "max_io_eqs": 120,
                "uid":
"C6A76AD20605BE026D23C14E70B90704F4A5F5B3F304D83B37000732BF861D48MLNXS0D0F0"
            }
        }
    }
}

[1] https://lore.kernel.org/netdev/20250416214133.10582-1-jiri@resnulli.us/

Avihai Horon (5):
  devlink: Add unique identifier to devlink port function
  net/mlx5: Move mlx5_cmd_query_vuid() from IB to core
  net/mlx5: Add vhca_id argument to mlx5_core_query_vuid()
  net/mlx5: Add define for max VUID string size
  net/mlx5: Expose unique identifier in devlink port function

 Documentation/netlink/specs/devlink.yaml      |  3 ++
 .../networking/devlink/devlink-port.rst       | 12 +++++++
 drivers/infiniband/hw/mlx5/cmd.c              | 21 ------------
 drivers/infiniband/hw/mlx5/cmd.h              |  2 --
 drivers/infiniband/hw/mlx5/main.c             |  5 +--
 .../mellanox/mlx5/core/esw/devlink_port.c     |  2 ++
 .../net/ethernet/mellanox/mlx5/core/eswitch.h |  2 ++
 .../mellanox/mlx5/core/eswitch_offloads.c     | 34 +++++++++++++++++++
 drivers/net/ethernet/mellanox/mlx5/core/fw.c  | 22 ++++++++++++
 include/linux/mlx5/driver.h                   |  3 ++
 include/net/devlink.h                         |  8 +++++
 include/uapi/linux/devlink.h                  |  1 +
 net/devlink/port.c                            | 32 +++++++++++++++++
 13 files changed, 122 insertions(+), 25 deletions(-)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2025-05-14 14:52 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-23 13:50 [RFC net-next 0/5] devlink: Add unique identifier to devlink port function Moshe Shemesh
2025-04-23 13:50 ` [RFC net-next 1/5] " Moshe Shemesh
2025-04-28 12:33   ` Simon Horman
2025-04-29  9:33     ` Avihai Horon
2025-04-23 13:50 ` [RFC net-next 2/5] net/mlx5: Move mlx5_cmd_query_vuid() from IB to core Moshe Shemesh
2025-04-23 13:50 ` [RFC net-next 3/5] net/mlx5: Add vhca_id argument to mlx5_core_query_vuid() Moshe Shemesh
2025-04-23 13:50 ` [RFC net-next 4/5] net/mlx5: Add define for max VUID string size Moshe Shemesh
2025-04-23 13:50 ` [RFC net-next 5/5] net/mlx5: Expose unique identifier in devlink port function Moshe Shemesh
2025-04-24 23:24 ` [RFC net-next 0/5] devlink: Add unique identifier to " Jakub Kicinski
2025-04-25 11:26   ` Jiri Pirko
2025-04-25 17:51     ` Jakub Kicinski
2025-04-28 16:30       ` Jiri Pirko
2025-04-28 12:11   ` Moshe Shemesh
2025-04-28 18:19     ` Jakub Kicinski
2025-04-29  8:37       ` Moshe Shemesh
2025-05-02  0:39         ` Jakub Kicinski
2025-05-04 17:46           ` Mark Bloch
2025-05-05 18:55             ` Jakub Kicinski
2025-05-06 11:25               ` Mark Bloch
2025-05-06 15:20                 ` Jakub Kicinski
2025-05-06 15:34                   ` Mark Bloch
2025-05-08  0:43                     ` Jakub Kicinski
2025-05-08  9:04                       ` Mark Bloch
2025-05-14 12:01                         ` Mark Bloch
2025-05-14 14:52                           ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).