History

devlink: Expose port function commands to control RoCE

Expose port function commands to enable / disable RoCE, this is used to control the port RoCE device capabilities. When RoCE is disabled for a function of the port, function cannot create any RoCE specific resources (e.g GID table). It also saves system memory utilization. For example disabling RoCE enable a VF/SF saves 1 Mbytes of system memory per function. Example of a PCI VF port which supports function configuration: Set RoCE of the VF's 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:00:00:00:00:00 roce enable $ devlink port function set pci/0000:06:00.0/2 roce disable $ 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:00:00:00:00:00 roce disable

Shay Drory committed 3 years ago

Commit da65e9f1 parent 875cd5e4 files · +174 −1Browse files

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

Unified · Split

include/uapi/linux/devlink.h+10−0
@@ -658,11 +658,21 @@ enum devlink_resource_unit { · 657 unmodified lines
658 DEVLINK_RESOURCE_UNIT_ENTRY,658 DEVLINK_RESOURCE_UNIT_ENTRY,
659};659};
660 660
661enum devlink_port_fn_attr_cap {
662 DEVLINK_PORT_FN_ATTR_CAP_ROCE_BIT,
663
664 /* Add new caps above */
665 __DEVLINK_PORT_FN_ATTR_CAPS_MAX,
666};
667
668#define DEVLINK_PORT_FN_CAP_ROCE _BITUL(DEVLINK_PORT_FN_ATTR_CAP_ROCE_BIT)
669
661enum devlink_port_function_attr {670enum devlink_port_function_attr {
662 DEVLINK_PORT_FUNCTION_ATTR_UNSPEC,671 DEVLINK_PORT_FUNCTION_ATTR_UNSPEC,
663 DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR, /* binary */672 DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR, /* binary */
664 DEVLINK_PORT_FN_ATTR_STATE, /* u8 */673 DEVLINK_PORT_FN_ATTR_STATE, /* u8 */
665 DEVLINK_PORT_FN_ATTR_OPSTATE, /* u8 */674 DEVLINK_PORT_FN_ATTR_OPSTATE, /* u8 */
675 DEVLINK_PORT_FN_ATTR_CAPS, /* bitfield32 */
666 676
667 __DEVLINK_PORT_FUNCTION_ATTR_MAX,677 __DEVLINK_PORT_FUNCTION_ATTR_MAX,
668 DEVLINK_PORT_FUNCTION_ATTR_MAX = __DEVLINK_PORT_FUNCTION_ATTR_MAX - 1678 DEVLINK_PORT_FUNCTION_ATTR_MAX = __DEVLINK_PORT_FUNCTION_ATTR_MAX - 1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t