net/mlx5: fix VXLAN without decap action for E-Switch
authorViacheslav Ovsiienko <viacheslavo@mellanox.com>
Fri, 25 Jan 2019 15:29:35 +0000 (15:29 +0000)
committerShahaf Shuler <shahafs@mellanox.com>
Sun, 27 Jan 2019 11:33:47 +0000 (12:33 +0100)
There is an intention to support VXLAN tunnel match without
hardware offloaded decapsulation, just to redirect ingress
tunnelled frame untouched. This small fix allows to specify
Flows with VXLAN VNI pattern and with or without following
decapsulation action.

Fixes: 251e8d02cf37 ("net/mlx5: add VXLAN to flow translate routine")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
drivers/net/mlx5/mlx5_flow_tcf.c

index b8204df..e132a34 100644 (file)
@@ -2683,7 +2683,7 @@ flow_tcf_get_actions_and_size(const struct rte_flow_action actions[],
                              uint64_t *action_flags)
 {
        int size = 0;
-       uint64_t flags = 0;
+       uint64_t flags = *action_flags;
 
        size += SZ_NLATTR_NEST; /* TCA_FLOWER_ACT. */
        for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
@@ -3779,6 +3779,10 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow,
                                        mnl_attr_get_payload
                                        (mnl_nlmsg_get_payload_tail
                                                (nlh)))->ifindex;
+                       } else if (decap.hdr) {
+                               assert(dev_flow->tcf.tunnel);
+                               dev_flow->tcf.tunnel->ifindex_ptr =
+                                       (unsigned int *)&tcm->tcm_ifindex;
                        }
                        mnl_attr_put(nlh, TCA_MIRRED_PARMS,
                                     sizeof(struct tc_mirred),