]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
devlink: Add a 'num_doorbells' driverinit param
authorCosmin Ratiu <cratiu@nvidia.com>
Tue, 16 Sep 2025 14:11:43 +0000 (17:11 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 18 Sep 2025 01:30:51 +0000 (18:30 -0700)
This parameter can be used by drivers to configure a different number of
doorbells.

Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/networking/devlink/devlink-params.rst
include/net/devlink.h
net/devlink/param.c

index c51da4fba7e759d122f08cb3a4623b6989295ab4..0a9c20d701225caf9a46fa9aa67edf011fc08f74 100644 (file)
@@ -148,3 +148,6 @@ own name.
      - The max number of Virtual Functions (VFs) exposed by the PF.
        after reboot/pci reset, 'sriov_totalvfs' entry under the device's sysfs
        directory will report this value.
+   * - ``num_doorbells``
+     - u32
+     - Controls the number of doorbells used by the device.
index 8d4362f010e4562d801f5610d13e7aec65ba7887..9e824f61e40f6717e92200f445bfe74674c6f52d 100644 (file)
@@ -531,6 +531,7 @@ enum devlink_param_generic_id {
        DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC,
        DEVLINK_PARAM_GENERIC_ID_CLOCK_ID,
        DEVLINK_PARAM_GENERIC_ID_TOTAL_VFS,
+       DEVLINK_PARAM_GENERIC_ID_NUM_DOORBELLS,
 
        /* add new param generic ids above here*/
        __DEVLINK_PARAM_GENERIC_ID_MAX,
@@ -598,6 +599,9 @@ enum devlink_param_generic_id {
 #define DEVLINK_PARAM_GENERIC_TOTAL_VFS_NAME "total_vfs"
 #define DEVLINK_PARAM_GENERIC_TOTAL_VFS_TYPE DEVLINK_PARAM_TYPE_U32
 
+#define DEVLINK_PARAM_GENERIC_NUM_DOORBELLS_NAME "num_doorbells"
+#define DEVLINK_PARAM_GENERIC_NUM_DOORBELLS_TYPE DEVLINK_PARAM_TYPE_U32
+
 #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate)     \
 {                                                                      \
        .id = DEVLINK_PARAM_GENERIC_ID_##_id,                           \
index 33134940c2663c33c40914f6360f479f32d371fd..70e69523412cb632611c4d7313a0d2d3c90ac514 100644 (file)
@@ -107,6 +107,11 @@ static const struct devlink_param devlink_param_generic[] = {
                .name = DEVLINK_PARAM_GENERIC_TOTAL_VFS_NAME,
                .type = DEVLINK_PARAM_GENERIC_TOTAL_VFS_TYPE,
        },
+       {
+               .id = DEVLINK_PARAM_GENERIC_ID_NUM_DOORBELLS,
+               .name = DEVLINK_PARAM_GENERIC_NUM_DOORBELLS_NAME,
+               .type = DEVLINK_PARAM_GENERIC_NUM_DOORBELLS_TYPE,
+       },
 };
 
 static int devlink_param_generic_verify(const struct devlink_param *param)