net/mlx5: fix TPID check for VLAN push action on E-Switch
The VLAN push action on E-Switch supports only 802.1Q (0x8100) and 802.1AD (0x88A8) Tag Protocol ID (TPID) insertions. The parameter check for RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN action is added. Fixes: 57123c00c1b8 ("net/mlx5: add Linux TC flower driver for E-Switch flow") Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
This commit is contained in:
parent
e71b32f172
commit
4022d78982
@ -1887,9 +1887,23 @@ flow_tcf_validate(struct rte_eth_dev *dev,
|
|||||||
case RTE_FLOW_ACTION_TYPE_OF_POP_VLAN:
|
case RTE_FLOW_ACTION_TYPE_OF_POP_VLAN:
|
||||||
current_action_flag = MLX5_FLOW_ACTION_OF_POP_VLAN;
|
current_action_flag = MLX5_FLOW_ACTION_OF_POP_VLAN;
|
||||||
break;
|
break;
|
||||||
case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN:
|
case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN: {
|
||||||
|
rte_be16_t ethertype;
|
||||||
|
|
||||||
current_action_flag = MLX5_FLOW_ACTION_OF_PUSH_VLAN;
|
current_action_flag = MLX5_FLOW_ACTION_OF_PUSH_VLAN;
|
||||||
|
if (!actions->conf)
|
||||||
|
break;
|
||||||
|
conf.of_push_vlan = actions->conf;
|
||||||
|
ethertype = conf.of_push_vlan->ethertype;
|
||||||
|
if (ethertype != RTE_BE16(ETH_P_8021Q) &&
|
||||||
|
ethertype != RTE_BE16(ETH_P_8021AD))
|
||||||
|
return rte_flow_error_set
|
||||||
|
(error, EINVAL,
|
||||||
|
RTE_FLOW_ERROR_TYPE_ACTION, actions,
|
||||||
|
"vlan push TPID must be "
|
||||||
|
"802.1Q or 802.1AD");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID:
|
case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID:
|
||||||
if (!(action_flags & MLX5_FLOW_ACTION_OF_PUSH_VLAN))
|
if (!(action_flags & MLX5_FLOW_ACTION_OF_PUSH_VLAN))
|
||||||
return rte_flow_error_set
|
return rte_flow_error_set
|
||||||
|
Loading…
x
Reference in New Issue
Block a user