devlink: support u64-array devlink parameters
Status from this message: This series was applied to iproute2/iproute2-next.git (main)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest2 patches 0 repliesApplied
- v42 patches 1 replySuperseded
- v32 patches 3 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 2 patches | 5 replies | Superseded |
Patches in v5 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | devlink: use DEVLINK_VAR_ATTR_TYPE_* in param show/setdevlink/ | +17 | 0 replies | |
| 2/2 | devlink: support u64-array values in devlink param show/setdevlink/ | +223 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.
Cover letter [PATCH iproute2-next v5 0/2] devlink: support u64-array devlink parameters
The kernel gained support for devlink parameters of type DEVLINK_VAR_ATTR_TYPE_U64_ARRAY. These parameters carry a variable-length list of u64 values encoded as multiple DEVLINK_ATTR_PARAM_VALUE_DATA attributes. This is used by drivers that need to expose ordered lists of configuration values, such as the Marvell CN20K npc_srch_order parameter.
This series updates the devlink tool to handle the new UAPI and adds show/set support for u64-array parameters on both device and port params.
Patch 1 switches devlink param show/set to use DEVLINK_VAR_ATTR_TYPE_* constants instead of generic MNL_TYPE_* values when interpreting DEVLINK_ATTR_PARAM_TYPE. The kernel now reports param types using devlink_var_attr_type, so userspace must use the matching symbols.
Patch 2 adds parsing, display, and configuration support for DEVLINK_VAR_ATTR_TYPE_U64_ARRAY. Values are shown as a space-separated list of u64 elements. Setting accepts a space- or comma-separated list and emits one DEVLINK_ATTR_PARAM_VALUE_DATA attribute per element.
Tested on CN20K hardware with npc_srch_order:
# show search order
devlink dev param show pci/0002:01:00.0 name npc_srch_order
pci/0002:01:00.0:
name npc_srch_order type driver-specific
values:
cmode runtime value value 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 # set search order
devlink dev param set pci/0002:01:00.0 name npc_srch_order \
value 31,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 \
cmode runtimeRatheesh Kannoth (2):
devlink: use DEVLINK_VAR_ATTR_TYPE_* in param show/set
devlink: support u64-array values in devlink param show/set
devlink/devlink.c | 178 ++++++++++++++++++++++++++++++++--- include/uapi/linux/devlink.h | 1 + 2 files changed, 164 insertions(+), 15 deletions(-)
--
v4 -> v5: Addressed David comments
https://lore.kernel.org/netdev/[email protected]/
v3 -> v4: Addressed David comments
https://lore.kernel.org/netdev/[email protected]/
v2 -> v3: Addressed David comments
https://lore.kernel.org/netdev/akSCBN0N_7ug1-Fy@rkannoth-OptiPlex-7090/
v1 -> v2: Addressed David comments
https://lore.kernel.org/netdev/[email protected]/
2.43.0