From: Saeed Mahameed <saeed@kernel•org>
To: "David S. Miller" <davem@davemloft•net>,
Jakub Kicinski <kuba@kernel•org>, Paolo Abeni <pabeni@redhat•com>,
Eric Dumazet <edumazet@google•com>
Cc: Saeed Mahameed <saeedm@nvidia•com>,
netdev@vger•kernel.org, Tariq Toukan <tariqt@nvidia•com>,
Gal Pressman <gal@nvidia•com>,
Leon Romanovsky <leonro@nvidia•com>, Jiri Pirko <jiri@nvidia•com>
Subject: [PATCH net-next 10/14] devlink: Add 'keep_link_up' generic devlink device param
Date: Thu, 27 Feb 2025 18:12:23 -0800 [thread overview]
Message-ID: <20250228021227.871993-11-saeed@kernel.org> (raw)
In-Reply-To: <20250228021227.871993-1-saeed@kernel.org>
From: Saeed Mahameed <saeedm@nvidia•com>
Devices that support this in permanent mode will be requested to keep the
port link up even when driver is not loaded, netdev carrier state won't
affect the physical port link state.
This is useful for when the link is needed to access onboard management
such as BMC, even if the host driver isn't loaded.
Signed-off-by: Saeed Mahameed <saeedm@nvidia•com>
---
Documentation/networking/devlink/devlink-params.rst | 4 ++++
include/net/devlink.h | 4 ++++
net/devlink/param.c | 4 ++++
3 files changed, 12 insertions(+)
diff --git a/Documentation/networking/devlink/devlink-params.rst b/Documentation/networking/devlink/devlink-params.rst
index f266da05ab0d..2fbfab78030f 100644
--- a/Documentation/networking/devlink/devlink-params.rst
+++ b/Documentation/networking/devlink/devlink-params.rst
@@ -140,3 +140,7 @@ own name.
* - ``total_vfs``
- u32
- The total number of Virtual Functions (VFs) supported by the PF.
+ * - ``keep_link_up``
+ - Boolean
+ - When enabled, the device will keep the port link up even if the driver is
+ not loaded.
diff --git a/include/net/devlink.h b/include/net/devlink.h
index b409ccbcfd12..ca32c61583cf 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -523,6 +523,7 @@ enum devlink_param_generic_id {
DEVLINK_PARAM_GENERIC_ID_IO_EQ_SIZE,
DEVLINK_PARAM_GENERIC_ID_EVENT_EQ_SIZE,
DEVLINK_PARAM_GENERIC_ID_TOTAL_VFS,
+ DEVLINK_PARAM_GENERIC_ID_KEEP_LINK_UP,
/* add new param generic ids above here*/
__DEVLINK_PARAM_GENERIC_ID_MAX,
@@ -584,6 +585,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_KEEP_LINK_UP_NAME "keep_link_up"
+#define DEVLINK_PARAM_GENERIC_KEEP_LINK_UP_TYPE DEVLINK_PARAM_TYPE_BOOL
+
#define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate) \
{ \
.id = DEVLINK_PARAM_GENERIC_ID_##_id, \
diff --git a/net/devlink/param.c b/net/devlink/param.c
index c3d39817a908..03c65ccf2acf 100644
--- a/net/devlink/param.c
+++ b/net/devlink/param.c
@@ -97,6 +97,10 @@ 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_KEEP_LINK_UP,
+ .name = DEVLINK_PARAM_GENERIC_KEEP_LINK_UP_NAME,
+ .type = DEVLINK_PARAM_GENERIC_KEEP_LINK_UP_TYPE,
+ },
};
static int devlink_param_generic_verify(const struct devlink_param *param)
--
2.48.1
next prev parent reply other threads:[~2025-02-28 2:13 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 2:12 [PATCH net-next 00/14] devlink, mlx5: Add new parameters for link management and SRIOV/eSwitch configurations Saeed Mahameed
2025-02-28 2:12 ` [PATCH net-next 01/14] devlink: define enum for attr types of dynamic attributes Saeed Mahameed
2025-03-06 12:05 ` Simon Horman
2025-03-19 22:45 ` Saeed Mahameed
2025-02-28 2:12 ` [PATCH net-next 02/14] devlink: Add 'total_vfs' generic device param Saeed Mahameed
2025-02-28 12:39 ` Jiri Pirko
2025-03-04 16:42 ` Kamal Heib
2025-02-28 2:12 ` [PATCH net-next 03/14] net/mlx5: Implement cqe_compress_type via devlink params Saeed Mahameed
2025-02-28 2:12 ` [PATCH net-next 04/14] net/mlx5: Implement devlink enable_sriov parameter Saeed Mahameed
2025-02-28 12:46 ` Jiri Pirko
2025-02-28 18:19 ` Saeed Mahameed
2025-03-03 11:35 ` Jiri Pirko
2025-03-03 2:27 ` kernel test robot
2025-03-04 16:43 ` Kamal Heib
2025-02-28 2:12 ` [PATCH net-next 05/14] net/mlx5: Implement devlink total_vfs parameter Saeed Mahameed
2025-03-04 16:45 ` Kamal Heib
2025-02-28 2:12 ` [PATCH net-next 06/14] devlink: pass struct devlink_port * as arg to devlink_nl_param_fill() Saeed Mahameed
2025-02-28 2:12 ` [PATCH net-next 07/14] devlink: Implement port params registration Saeed Mahameed
2025-02-28 11:58 ` Przemek Kitszel
2025-02-28 12:28 ` Jiri Pirko
2025-02-28 13:23 ` Przemek Kitszel
2025-02-28 15:21 ` Jiri Pirko
2025-03-20 8:16 ` Przemek Kitszel
2025-02-28 2:12 ` [PATCH net-next 08/14] devlink: Implement get/dump netlink commands for port params Saeed Mahameed
2025-02-28 2:12 ` [PATCH net-next 09/14] devlink: Implement set netlink command " Saeed Mahameed
2025-02-28 12:49 ` Jiri Pirko
2025-02-28 2:12 ` Saeed Mahameed [this message]
2025-02-28 12:51 ` [PATCH net-next 10/14] devlink: Add 'keep_link_up' generic devlink device param Jiri Pirko
2025-02-28 2:12 ` [PATCH net-next 11/14] net/mlx5: Implement devlink keep_link_up port parameter Saeed Mahameed
2025-02-28 12:51 ` Jiri Pirko
2025-02-28 2:12 ` [PATCH net-next 12/14] devlink: Throw extack messages on param value validation error Saeed Mahameed
2025-02-28 12:53 ` Jiri Pirko
2025-03-03 7:06 ` Dan Carpenter
2025-02-28 2:12 ` [PATCH net-next 13/14] devlink: Implement devlink param multi attribute nested data values Saeed Mahameed
2025-02-28 2:12 ` [PATCH net-next 14/14] net/mlx5: Implement eSwitch hairpin per prio buffers devlink params Saeed Mahameed
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=20250228021227.871993-11-saeed@kernel.org \
--to=saeed@kernel$(echo .)org \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=gal@nvidia$(echo .)com \
--cc=jiri@nvidia$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=leonro@nvidia$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=saeedm@nvidia$(echo .)com \
--cc=tariqt@nvidia$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox