]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/mlx5: Support devlink port state for host PF
authorMoshe Shemesh <moshe@nvidia.com>
Tue, 3 Feb 2026 10:24:02 +0000 (12:24 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 5 Feb 2026 14:27:17 +0000 (15:27 +0100)
commit0e6c95c9882913ba88417f035f5a9f343afd5db0
treeba103d58c83a21c507de0f92d893634061e95e72
parent021718d2cc1a2df2f53b06968fa89280199371bd
net/mlx5: Support devlink port state for host PF

Add support for devlink port function state get/set operations for the
host physical function (PF). Until now, mlx5 only allowed state get/set
for subfunctions (SFs) ports. This change enables an administrator with
eSwitch manager privileges to query or modify the host PF’s function
state, allowing it to be explicitly inactivated or activated. While
inactivated, the administrator can modify the functions attributes, such
as enable/disable roce.

$ devlink port show pci/0000:03:00.0/196608
pci/0000:03:00.0/196608: type eth netdev eth1 flavour pcipf controller 1 pfnum 0 external true splittable false
  function:
    hw_addr a0:88:c2:45:17:7c state active opstate attached roce enable max_io_eqs 120
$ devlink port function set pci/0000:03:00.0/196608 state inactive
$ devlink port show pci/0000:03:00.0/196608
pci/0000:03:00.0/196608: type eth netdev eth1 flavour pcipf controller 1 pfnum 0 external true splittable false
  function:
    hw_addr a0:88:c2:45:17:7c state inactive opstate detached roce enable max_io_eqs 120

Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260203102402.1712218-1-tariqt@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlx5/core/ecpf.c
drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c