Commit 076b2a9d authored by Parav Pandit's avatar Parav Pandit Committed by David S. Miller
Browse files

devlink: Add new "enable_vnet" generic device param



Add new device generic parameter to enable/disable creation of
VDPA net auxiliary device and associated device functionality
in the devlink instance.

User who prefers to disable such functionality can disable it using below
example.

$ devlink dev param set pci/0000:06:00.0 \
              name enable_vnet value false cmode driverinit
$ devlink dev reload pci/0000:06:00.0

At this point devlink instance do not create auxiliary device for the
VDPA net functionality.

Signed-off-by: default avatarParav Pandit <parav@nvidia.com>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8ddaabee
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -105,6 +105,10 @@ own name.
     - Boolean
     - When enabled, the device driver will instantiate RDMA specific
       auxiliary device of the devlink device.
   * - ``enable_vnet``
     - Boolean
     - When enabled, the device driver will instantiate VDPA networking
       specific auxiliary device of the devlink device.
   * - ``internal_err_reset``
     - Boolean
     - When enabled, the device driver will reset the device on internal
+4 −0
Original line number Diff line number Diff line
@@ -521,6 +521,7 @@ enum devlink_param_generic_id {
	DEVLINK_PARAM_GENERIC_ID_ENABLE_REMOTE_DEV_RESET,
	DEVLINK_PARAM_GENERIC_ID_ENABLE_ETH,
	DEVLINK_PARAM_GENERIC_ID_ENABLE_RDMA,
	DEVLINK_PARAM_GENERIC_ID_ENABLE_VNET,

	/* add new param generic ids above here*/
	__DEVLINK_PARAM_GENERIC_ID_MAX,
@@ -567,6 +568,9 @@ enum devlink_param_generic_id {
#define DEVLINK_PARAM_GENERIC_ENABLE_RDMA_NAME "enable_rdma"
#define DEVLINK_PARAM_GENERIC_ENABLE_RDMA_TYPE DEVLINK_PARAM_TYPE_BOOL

#define DEVLINK_PARAM_GENERIC_ENABLE_VNET_NAME "enable_vnet"
#define DEVLINK_PARAM_GENERIC_ENABLE_VNET_TYPE DEVLINK_PARAM_TYPE_BOOL

#define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate)	\
{									\
	.id = DEVLINK_PARAM_GENERIC_ID_##_id,				\
+5 −0
Original line number Diff line number Diff line
@@ -4287,6 +4287,11 @@ static const struct devlink_param devlink_param_generic[] = {
		.name = DEVLINK_PARAM_GENERIC_ENABLE_RDMA_NAME,
		.type = DEVLINK_PARAM_GENERIC_ENABLE_RDMA_TYPE,
	},
	{
		.id = DEVLINK_PARAM_GENERIC_ID_ENABLE_VNET,
		.name = DEVLINK_PARAM_GENERIC_ENABLE_VNET_NAME,
		.type = DEVLINK_PARAM_GENERIC_ENABLE_VNET_TYPE,
	},
};

static int devlink_param_generic_verify(const struct devlink_param *param)