From a9c94cc05015f34cd904e7903c698be1ddefbcc6 Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Fri, 25 Jan 2019 15:29:35 +0000 Subject: [PATCH] net/mlx5: fix VXLAN without decap action for E-Switch 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 Acked-by: Shahaf Shuler --- drivers/net/mlx5/mlx5_flow_tcf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c index b8204df637..e132a3482e 100644 --- a/drivers/net/mlx5/mlx5_flow_tcf.c +++ b/drivers/net/mlx5/mlx5_flow_tcf.c @@ -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), -- 2.20.1