History

devlink: add device information API

ethtool -i has served us well for a long time, but its showing its limitations more and more. The device information should also be reported per device not per-netdev. Lay foundation for a simple devlink-based way of reading device info. Add driver name and device serial number as initial pieces of information exposed via this new API. v3: - rename helpers (Jiri); - rename driver name attr (Jiri); - remove double spacing in commit message (Jiri). RFC v2: - wrap the skb into an opaque structure (Jiri); - allow the serial number of be any length (Jiri & Andrew); - add driver name (Jonathan).

Jakub Kicinski committed 7 years ago

Commit f9cf2281 parent 26281e23 files · +135 −0Browse files

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

Unified · Split

include/uapi/linux/devlink.h+5−0
@@ -94,6 +94,8 @@ enum devlink_command { · 93 unmodified lines
9494 DEVLINK_CMD_PORT_PARAM_NEW,
9595 DEVLINK_CMD_PORT_PARAM_DEL,
9696
97+ DEVLINK_CMD_INFO_GET, /* can dump */
98+
9799 /* add new commands above here */
98100 __DEVLINK_CMD_MAX,
99101 DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1
@@ -290,6 +292,9 @@ enum devlink_attr { · 190 unmodified lines
290292 DEVLINK_ATTR_REGION_CHUNK_ADDR, /* u64 */
291293 DEVLINK_ATTR_REGION_CHUNK_LEN, /* u64 */
292294
295+ DEVLINK_ATTR_INFO_DRIVER_NAME, /* string */
296+ DEVLINK_ATTR_INFO_SERIAL_NUMBER, /* string */
297+
293298 /* add new attributes above here, update the policy in devlink.c */
294299
295300 __DEVLINK_ATTR_MAX,