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
57 DEVLINK_CMD_SB_OCC_SNAPSHOT,57 DEVLINK_CMD_SB_OCC_SNAPSHOT,
58 DEVLINK_CMD_SB_OCC_MAX_CLEAR,58 DEVLINK_CMD_SB_OCC_MAX_CLEAR,
59 59
60 DEVLINK_CMD_ESWITCH_MODE_GET,
61 DEVLINK_CMD_ESWITCH_MODE_SET,
60 /* add new commands above here */62 /* add new commands above here */
61 63
62 __DEVLINK_CMD_MAX,64 __DEVLINK_CMD_MAX,
@@ -95,6 +97,11 @@ enum devlink_sb_threshold_type { · 32 unmodified lines
95 97
96#define DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX 2098#define DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX 20
97 99
100enum devlink_eswitch_mode {
101 DEVLINK_ESWITCH_MODE_LEGACY,
102 DEVLINK_ESWITCH_MODE_SWITCHDEV,
103};
104
98enum devlink_attr {105enum devlink_attr {
99 /* don't change the order or add anything between, this is ABI! */106 /* don't change the order or add anything between, this is ABI! */
100 DEVLINK_ATTR_UNSPEC,107 DEVLINK_ATTR_UNSPEC,
@@ -125,6 +132,7 @@ enum devlink_attr { · 24 unmodified lines
125 DEVLINK_ATTR_SB_TC_INDEX, /* u16 */132 DEVLINK_ATTR_SB_TC_INDEX, /* u16 */
126 DEVLINK_ATTR_SB_OCC_CUR, /* u32 */133 DEVLINK_ATTR_SB_OCC_CUR, /* u32 */
127 DEVLINK_ATTR_SB_OCC_MAX, /* u32 */134 DEVLINK_ATTR_SB_OCC_MAX, /* u32 */
135 DEVLINK_ATTR_ESWITCH_MODE, /* u16 */
128 136
129 /* add new attributes above here, update the policy in devlink.c */137 /* add new attributes above here, update the policy in devlink.c */
130 138