Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Parav Pandit <parav@nvidia.com>
To: <davem@davemloft.net>, <kuba@kernel.org>, <netdev@vger.kernel.org>
Cc: <linux-rdma@vger.kernel.org>,
<virtualization@lists.linux-foundation.org>,
Parav Pandit <parav@nvidia.com>, Jiri Pirko <jiri@nvidia.com>,
"Leon Romanovsky" <leonro@nvidia.com>
Subject: [PATCH RESEND net-next 01/10] devlink: Add new "enable_eth" generic device param
Date: Tue, 10 Aug 2021 16:24:15 +0300 [thread overview]
Message-ID: <20210810132424.9129-2-parav@nvidia.com> (raw)
In-Reply-To: <20210810132424.9129-1-parav@nvidia.com>
Add new device generic parameter to enable/disable creation of
Ethernet 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_eth value false cmode driverinit
$ devlink dev reload pci/0000:06:00.0
At this point devlink instance do not create auxiliary device for the
Ethernet functionality.
Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
---
Documentation/networking/devlink/devlink-params.rst | 4 ++++
include/net/devlink.h | 4 ++++
net/core/devlink.c | 5 +++++
3 files changed, 13 insertions(+)
diff --git a/Documentation/networking/devlink/devlink-params.rst b/Documentation/networking/devlink/devlink-params.rst
index 54c9f107c4b0..219c1272f2d6 100644
--- a/Documentation/networking/devlink/devlink-params.rst
+++ b/Documentation/networking/devlink/devlink-params.rst
@@ -97,6 +97,10 @@ own name.
* - ``enable_roce``
- Boolean
- Enable handling of RoCE traffic in the device.
+ * - ``enable_eth``
+ - Boolean
+ - When enabled, the device driver will instantiate Ethernet specific
+ auxiliary device of the devlink device.
* - ``internal_err_reset``
- Boolean
- When enabled, the device driver will reset the device on internal
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 0236c77f2fd0..1e3e183bb2c2 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -519,6 +519,7 @@ enum devlink_param_generic_id {
DEVLINK_PARAM_GENERIC_ID_RESET_DEV_ON_DRV_PROBE,
DEVLINK_PARAM_GENERIC_ID_ENABLE_ROCE,
DEVLINK_PARAM_GENERIC_ID_ENABLE_REMOTE_DEV_RESET,
+ DEVLINK_PARAM_GENERIC_ID_ENABLE_ETH,
/* add new param generic ids above here*/
__DEVLINK_PARAM_GENERIC_ID_MAX,
@@ -559,6 +560,9 @@ enum devlink_param_generic_id {
#define DEVLINK_PARAM_GENERIC_ENABLE_REMOTE_DEV_RESET_NAME "enable_remote_dev_reset"
#define DEVLINK_PARAM_GENERIC_ENABLE_REMOTE_DEV_RESET_TYPE DEVLINK_PARAM_TYPE_BOOL
+#define DEVLINK_PARAM_GENERIC_ENABLE_ETH_NAME "enable_eth"
+#define DEVLINK_PARAM_GENERIC_ENABLE_ETH_TYPE DEVLINK_PARAM_TYPE_BOOL
+
#define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate) \
{ \
.id = DEVLINK_PARAM_GENERIC_ID_##_id, \
diff --git a/net/core/devlink.c b/net/core/devlink.c
index b02d54ab59ac..9a59f45c8bf9 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -4277,6 +4277,11 @@ static const struct devlink_param devlink_param_generic[] = {
.name = DEVLINK_PARAM_GENERIC_ENABLE_REMOTE_DEV_RESET_NAME,
.type = DEVLINK_PARAM_GENERIC_ENABLE_REMOTE_DEV_RESET_TYPE,
},
+ {
+ .id = DEVLINK_PARAM_GENERIC_ID_ENABLE_ETH,
+ .name = DEVLINK_PARAM_GENERIC_ENABLE_ETH_NAME,
+ .type = DEVLINK_PARAM_GENERIC_ENABLE_ETH_TYPE,
+ },
};
static int devlink_param_generic_verify(const struct devlink_param *param)
--
2.26.2
next prev parent reply other threads:[~2021-08-10 13:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-10 13:24 [PATCH RESEND net-next 00/10] devlink: Control auxiliary devices Parav Pandit
2021-08-10 13:24 ` Parav Pandit [this message]
2021-08-10 13:24 ` [PATCH RESEND net-next 02/10] devlink: Add new "enable_rdma" generic device param Parav Pandit
2021-08-10 13:24 ` [PATCH RESEND net-next 03/10] devlink: Add new "enable_vnet" " Parav Pandit
2021-08-10 13:24 ` [PATCH RESEND net-next 04/10] devlink: Create a helper function for one parameter registration Parav Pandit
2021-08-10 13:24 ` [PATCH RESEND net-next 05/10] devlink: Add API to register and unregister single parameter Parav Pandit
2021-08-10 13:24 ` [PATCH RESEND net-next 06/10] devlink: Add APIs to publish, unpublish individual parameter Parav Pandit
2021-08-10 13:24 ` [PATCH RESEND net-next 07/10] net/mlx5: Fix unpublish devlink parameters Parav Pandit
2021-08-10 13:24 ` [PATCH RESEND net-next 08/10] net/mlx5: Support enable_eth devlink dev param Parav Pandit
2021-08-10 13:24 ` [PATCH RESEND net-next 09/10] net/mlx5: Support enable_rdma " Parav Pandit
2021-08-10 13:24 ` [PATCH RESEND net-next 10/10] net/mlx5: Support enable_vnet " Parav Pandit
2021-08-11 13:40 ` [PATCH RESEND net-next 00/10] devlink: Control auxiliary devices patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210810132424.9129-2-parav@nvidia.com \
--to=parav@nvidia.com \
--cc=davem@davemloft.net \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=leonro@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
--subject='Re: [PATCH RESEND net-next 01/10] devlink: Add new "enable_eth" generic device param' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).