History

net/devlink: Add E-Switch mode control

Add the commands to set and show the mode of SRIOV E-Switch, two modes are supported: * legacy: operating in the "old" L2 based mode (DMAC --> VF vport) * switchdev: the E-Switch is referred to as whitebox switch configured using standard tools such as tc, bridge, openvswitch etc. To allow working with the tools, for each VF, a VF representor netdevice is created by the E-Switch manager vendor device driver instance (e.g PF).

Or Gerlitz committed 10 years ago

Commit 08f4b591 parent fed9ce23 files · +98 −0Browse files

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

Unified · Split

include/uapi/linux/devlink.h+8−0
@@ -57,6 +57,8 @@ enum devlink_command { · 56 unmodified lines
5757 DEVLINK_CMD_SB_OCC_SNAPSHOT,
5858 DEVLINK_CMD_SB_OCC_MAX_CLEAR,
5959
60+ DEVLINK_CMD_ESWITCH_MODE_GET,
61+ DEVLINK_CMD_ESWITCH_MODE_SET,
6062 /* add new commands above here */
6163
6264 __DEVLINK_CMD_MAX,
@@ -95,6 +97,11 @@ enum devlink_sb_threshold_type { · 32 unmodified lines
9597
9698 #define DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX 20
9799
100+enum devlink_eswitch_mode {
101+ DEVLINK_ESWITCH_MODE_LEGACY,
102+ DEVLINK_ESWITCH_MODE_SWITCHDEV,
103+};
104+
98105 enum devlink_attr {
99106 /* don't change the order or add anything between, this is ABI! */
100107 DEVLINK_ATTR_UNSPEC,
@@ -125,6 +132,7 @@ enum devlink_attr { · 24 unmodified lines
125132 DEVLINK_ATTR_SB_TC_INDEX, /* u16 */
126133 DEVLINK_ATTR_SB_OCC_CUR, /* u32 */
127134 DEVLINK_ATTR_SB_OCC_MAX, /* u32 */
135+ DEVLINK_ATTR_ESWITCH_MODE, /* u16 */
128136
129137 /* add new attributes above here, update the policy in devlink.c */
130138