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