History

devlink: Implement devlink param multi attribute nested data values

Devlink param value attribute is not defined since devlink is handling the value validating and parsing internally, this allows us to implement multi attribute values without breaking any policies. Devlink param multi-attribute values are considered to be dynamically sized arrays of u64 values, by introducing a new devlink param type DEVLINK_PARAM_TYPE_U64_ARRAY, driver and user space can set a variable count of u64 values into the DEVLINK_ATTR_PARAM_VALUE_DATA attribute. Implement get/set parsing and add to the internal value structure passed to drivers. This is useful for devices that need to configure a list of values for a specific configuration. example: $ devlink dev param show pci/... name multi-value-param name multi-value-param type driver-specific values: cmode permanent value: 0,1,2,3,4,5,6,7 $ devlink dev param set pci/... name multi-value-param \ value 4,5,6,7,0,1,2,3 cmode permanent

Saeed Mahameed committed 5 months ago

Commit eb7b4d41 parent c0e67fd5 files · +47 −1Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/devlink.h+1−0
@@ -406,6 +406,7 @@ enum devlink_var_attr_type { · 405 unmodified lines
406406 DEVLINK_VAR_ATTR_TYPE_BINARY,
407407 __DEVLINK_VAR_ATTR_TYPE_CUSTOM_BASE = 0x80,
408408 /* Any possible custom types, unrelated to NLA_* values go below */
409+ DEVLINK_VAR_ATTR_TYPE_U64_ARRAY,
409410 };
410411
411412 enum devlink_attr {