From: Saeed Mahameed 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. Reviewed-by: Jiri Pirko Signed-off-by: Saeed Mahameed --- 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 f2920371622c..0e9c0e17573d 100644 --- a/Documentation/networking/devlink/devlink-params.rst +++ b/Documentation/networking/devlink/devlink-params.rst @@ -143,3 +143,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 b2517813ce17..13331194e143 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -526,6 +526,7 @@ enum devlink_param_generic_id { DEVLINK_PARAM_GENERIC_ID_EVENT_EQ_SIZE, DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC, 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, @@ -590,6 +591,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 5f9cd492e40c..2a222d1bf81c 100644 --- a/net/devlink/param.c +++ b/net/devlink/param.c @@ -102,6 +102,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.50.0