From: Viacheslav Ovsiienko Date: Wed, 21 Nov 2018 17:44:38 +0000 (+0000) Subject: net/mlx5: fix VLAN inner ethernet type on E-Switch X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e71b32f172f24a8f13392ee3fefd0ed74a1a4a71;p=dpdk.git net/mlx5: fix VLAN inner ethernet type on E-Switch The TCA_FLOWER_KEY_VLAN_ETH_TYPE should be specified for the E-Switch Flows with VLAN and L3 pattern items in the Netlink messages. The patch adds missing flower key to the messages. This patch partially reverts to the code smashed by http://patches.dpdk.org/patch/47781 Fixes: 251e8d02cf37 ("net/mlx5: add VXLAN to flow translate routine") Signed-off-by: Viacheslav Ovsiienko Acked-by: Shahaf Shuler --- diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c index 2f6b7d6371..26f27c6be2 100644 --- a/drivers/net/mlx5/mlx5_flow_tcf.c +++ b/drivers/net/mlx5/mlx5_flow_tcf.c @@ -3246,7 +3246,8 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow, assert(mask.ipv4); spec.ipv4 = items->spec; if (!decap.vxlan) { - if (!eth_type_set && !vlan_eth_type_set) + if (!eth_type_set || + (!vlan_eth_type_set && vlan_present)) mnl_attr_put_u16 (nlh, vlan_present ? @@ -3303,14 +3304,14 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow, assert(mask.ipv6); spec.ipv6 = items->spec; if (!decap.vxlan) { - if (!eth_type_set || !vlan_eth_type_set) { + if (!eth_type_set || + (!vlan_eth_type_set && vlan_present)) mnl_attr_put_u16 (nlh, vlan_present ? TCA_FLOWER_KEY_VLAN_ETH_TYPE : TCA_FLOWER_KEY_ETH_TYPE, RTE_BE16(ETH_P_IPV6)); - } eth_type_set = 1; vlan_eth_type_set = 1; if (mask.ipv6 == &flow_tcf_mask_empty.ipv6)