History

net/devlink: Support querying hardware address of port function

PCI PF and VF devlink port can manage the function represented by a devlink port. Enable users to query port function's hardware address. Example of a PCI VF port which supports a port function: $ devlink port show pci/0000:06:00.0/2 pci/0000:06:00.0/2: type eth netdev enp6s0pf0vf1 flavour pcivf pfnum 0 vfnum 1 function: hw_addr 00:11:22:33:44:66 $ devlink port show pci/0000:06:00.0/2 -jp { "port": { "pci/0000:06:00.0/2": { "type": "eth", "netdev": "enp6s0pf0vf1", "flavour": "pcivf", "pfnum": 0, "vfnum": 1, "function": { "hw_addr": "00:11:22:33:44:66" } } } }

Parav Pandit committed 6 years ago

Commit 2a916ec1 parent a829eb03 files · +67 −0Browse files

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

Unified · Split

include/uapi/linux/devlink.h+10−0
@@ -451,6 +451,8 @@ enum devlink_attr { · 450 unmodified lines
451 DEVLINK_ATTR_TRAP_POLICER_RATE, /* u64 */451 DEVLINK_ATTR_TRAP_POLICER_RATE, /* u64 */
452 DEVLINK_ATTR_TRAP_POLICER_BURST, /* u64 */452 DEVLINK_ATTR_TRAP_POLICER_BURST, /* u64 */
453 453
454 DEVLINK_ATTR_PORT_FUNCTION, /* nested */
455
454 /* add new attributes above here, update the policy in devlink.c */456 /* add new attributes above here, update the policy in devlink.c */
455 457
456 __DEVLINK_ATTR_MAX,458 __DEVLINK_ATTR_MAX,
@@ -497,4 +499,12 @@ enum devlink_resource_unit { · 40 unmodified lines
497 DEVLINK_RESOURCE_UNIT_ENTRY,499 DEVLINK_RESOURCE_UNIT_ENTRY,
498};500};
499 501
502enum devlink_port_function_attr {
503 DEVLINK_PORT_FUNCTION_ATTR_UNSPEC,
504 DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR, /* binary */
505
506 __DEVLINK_PORT_FUNCTION_ATTR_MAX,
507 DEVLINK_PORT_FUNCTION_ATTR_MAX = __DEVLINK_PORT_FUNCTION_ATTR_MAX - 1
508};
509
500#endif /* _UAPI_LINUX_DEVLINK_H_ */510#endif /* _UAPI_LINUX_DEVLINK_H_ */