[PATCH net-next 00/10] Add configuration parameters support

From: Moshe Shemesh
Date: Wed Jul 04 2018 - 07:31:08 EST


Add configuration parameters setting through devlink.
Each device registers supported configuration parameters table.
Each parameter can be either generic or driver specific.
The user can retrieve data on these parameters by "devlink param show"
command and can set new value to a parameter by "devlink param set"
command.
The parameters can be set in different configuration modes:
runtime - set while driver is running, no reset required.
driverinit - applied while driver initializes, requires restart
driver by devlink reload command.
permanent - written to device's non-volatile memory, hard reset required.

The patches at the end of the patchset introduce few params that are using
the introduced infrastructure on mlx4 and bnxt.

Command examples and output:

# devlink dev param show
pci/0000:81:00.0:
name internal_error_reset type generic
values:
cmode runtime value true
cmode driverinit value true
name max_macs type generic
values:
cmode driverinit value 128
name enable_64b_cqe_eqe type driver-specific
values:
cmode driverinit value true
name enable_4k_uar type driver-specific
values:
cmode driverinit value false

# devlink dev param set pci/0000:81:00.0 name internal_error_reset cmode runtime value false

# devlink dev param show pci/0000:81:00.0 name internal_error_reset
pci/0000:81:00.0:
name internal_error_reset type generic
values:
cmode runtime value false
cmode driverinit value true


Moshe Shemesh (8):
devlink: Add devlink_param register and unregister
devlink: Add param get command
devlink: Add param set command
devlink: Add support for get/set driverinit value
devlink: Add devlink notifications support for params
devlink: Add generic parameters internal_err_reset and max_macs
mlx4: Add mlx4 initial parameters table and register it
mlx4: Add support for devlink reload and load driverinit values

Vasundhara Volam (2):
devlink: Add enable_sriov boolean generic parameter
bnxt_en: Add bnxt_en initial params table and register it.

drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 121 +++-
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h | 15 +
drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h | 13 +
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 9 +-
drivers/net/ethernet/mellanox/mlx4/catas.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/main.c | 161 +++++-
drivers/net/ethernet/mellanox/mlx4/mlx4.h | 3 +-
include/net/devlink.h | 149 +++++
include/uapi/linux/devlink.h | 24 +
net/core/devlink.c | 675 ++++++++++++++++++++++
10 files changed, 1156 insertions(+), 16 deletions(-)

--
1.8.3.1