]> www.infradead.org Git - users/hch/misc.git/commit
net/mlx5: Implement devlink total_vfs parameter
authorVlad Dumitrescu <vdumitrescu@nvidia.com>
Sun, 7 Sep 2025 01:29:46 +0000 (18:29 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 10 Sep 2025 02:14:24 +0000 (19:14 -0700)
commita4c49611cf4f7018ee80f02bded12fd4002ef95c
tree3e2bd4939212c8370f26e25868c4ab58529f739a
parent95a0af146dff5437acb4ea27eacc05aa22c7bb54
net/mlx5: Implement devlink total_vfs parameter

Some devices support both symmetric (same value for all PFs) and
asymmetric, while others only support symmetric configuration. This
implementation prefers asymmetric, since it is closer to the devlink
model (per function settings), but falls back to symmetric when needed.

Example usage:
  devlink dev param set pci/0000:01:00.0 name total_vfs value <u16> cmode permanent
  devlink dev reload pci/0000:01:00.0 action fw_activate
  echo 1 >/sys/bus/pci/devices/0000:01:00.0/remove
  echo 1 >/sys/bus/pci/rescan
  cat /sys/bus/pci/devices/0000:01:00.0/sriov_totalvfs

Signed-off-by: Vlad Dumitrescu <vdumitrescu@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Tested-by: Kamal Heib <kheib@redhat.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250907012953.301746-5-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/networking/devlink/mlx5.rst
drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c