Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

devlink: Add new "max_mac_per_vf" generic device param

Add a new device generic parameter to controls the maximum
number of MAC filters allowed per VF.

For example, to limit a VF to 3 MAC addresses:
$ devlink dev param set pci/0000:3b:00.0 name max_mac_per_vf \
value 3 \
cmode runtime

Signed-off-by: Mohammad Heib <mheib@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>

authored by

Mohammad Heib and committed by
Tony Nguyen
9352d40c 13068e9d

+13
+4
include/net/devlink.h
··· 532 532 DEVLINK_PARAM_GENERIC_ID_CLOCK_ID, 533 533 DEVLINK_PARAM_GENERIC_ID_TOTAL_VFS, 534 534 DEVLINK_PARAM_GENERIC_ID_NUM_DOORBELLS, 535 + DEVLINK_PARAM_GENERIC_ID_MAX_MAC_PER_VF, 535 536 536 537 /* add new param generic ids above here*/ 537 538 __DEVLINK_PARAM_GENERIC_ID_MAX, ··· 602 601 603 602 #define DEVLINK_PARAM_GENERIC_NUM_DOORBELLS_NAME "num_doorbells" 604 603 #define DEVLINK_PARAM_GENERIC_NUM_DOORBELLS_TYPE DEVLINK_PARAM_TYPE_U32 604 + 605 + #define DEVLINK_PARAM_GENERIC_MAX_MAC_PER_VF_NAME "max_mac_per_vf" 606 + #define DEVLINK_PARAM_GENERIC_MAX_MAC_PER_VF_TYPE DEVLINK_PARAM_TYPE_U32 605 607 606 608 #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate) \ 607 609 { \
+5
net/devlink/param.c
··· 112 112 .name = DEVLINK_PARAM_GENERIC_NUM_DOORBELLS_NAME, 113 113 .type = DEVLINK_PARAM_GENERIC_NUM_DOORBELLS_TYPE, 114 114 }, 115 + { 116 + .id = DEVLINK_PARAM_GENERIC_ID_MAX_MAC_PER_VF, 117 + .name = DEVLINK_PARAM_GENERIC_MAX_MAC_PER_VF_NAME, 118 + .type = DEVLINK_PARAM_GENERIC_MAX_MAC_PER_VF_TYPE, 119 + }, 115 120 }; 116 121 117 122 static int devlink_param_generic_verify(const struct devlink_param *param)