Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

devlink: Add enable_remote_dev_reset generic parameter

The enable_remote_dev_reset devlink param flags that the host admin
allows device resets that can be initiated by other hosts. This
parameter is useful for setups where a device is shared by different
hosts, such as multi-host setup. Once the user set this parameter to
false, the driver should NACK any attempt to reset the device while the
driver is loaded.

Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Moshe Shemesh and committed by
Jakub Kicinski
195d9dec 5ec69744

+15
+4
include/net/devlink.h
··· 469 469 DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY, 470 470 DEVLINK_PARAM_GENERIC_ID_RESET_DEV_ON_DRV_PROBE, 471 471 DEVLINK_PARAM_GENERIC_ID_ENABLE_ROCE, 472 + DEVLINK_PARAM_GENERIC_ID_ENABLE_REMOTE_DEV_RESET, 472 473 473 474 /* add new param generic ids above here*/ 474 475 __DEVLINK_PARAM_GENERIC_ID_MAX, ··· 506 505 507 506 #define DEVLINK_PARAM_GENERIC_ENABLE_ROCE_NAME "enable_roce" 508 507 #define DEVLINK_PARAM_GENERIC_ENABLE_ROCE_TYPE DEVLINK_PARAM_TYPE_BOOL 508 + 509 + #define DEVLINK_PARAM_GENERIC_ENABLE_REMOTE_DEV_RESET_NAME "enable_remote_dev_reset" 510 + #define DEVLINK_PARAM_GENERIC_ENABLE_REMOTE_DEV_RESET_TYPE DEVLINK_PARAM_TYPE_BOOL 509 511 510 512 #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate) \ 511 513 { \
+5
net/core/devlink.c
··· 3521 3521 .name = DEVLINK_PARAM_GENERIC_ENABLE_ROCE_NAME, 3522 3522 .type = DEVLINK_PARAM_GENERIC_ENABLE_ROCE_TYPE, 3523 3523 }, 3524 + { 3525 + .id = DEVLINK_PARAM_GENERIC_ID_ENABLE_REMOTE_DEV_RESET, 3526 + .name = DEVLINK_PARAM_GENERIC_ENABLE_REMOTE_DEV_RESET_NAME, 3527 + .type = DEVLINK_PARAM_GENERIC_ENABLE_REMOTE_DEV_RESET_TYPE, 3528 + }, 3524 3529 }; 3525 3530 3526 3531 static int devlink_param_generic_verify(const struct devlink_param *param)