net/ixgbe: fix tunnel id format error for FDIR
authorWei Zhao <wei.zhao1@intel.com>
Wed, 13 Jun 2018 08:11:22 +0000 (16:11 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 2 Jul 2018 23:35:57 +0000 (01:35 +0200)
In cloud mode for FDIR, tunnel id should be set as protocol
request, the lower 8 bits should be set as reserved.

Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550")
Fixes: 11777435c727 ("net/ixgbe: parse flow director filter")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
drivers/net/ixgbe/ixgbe_fdir.c
drivers/net/ixgbe/ixgbe_flow.c

index d5e5179..67ab627 100644 (file)
@@ -774,7 +774,7 @@ ixgbe_fdir_filter_to_atr_input(const struct rte_eth_fdir_filter *fdir_filter,
                input->formatted.tunnel_type =
                        fdir_filter->input.flow.tunnel_flow.tunnel_type;
                input->formatted.tni_vni =
-                       fdir_filter->input.flow.tunnel_flow.tunnel_id;
+                       fdir_filter->input.flow.tunnel_flow.tunnel_id >> 8;
        }
 
        return 0;
index 1f2007f..000f4ad 100644 (file)
@@ -2488,10 +2488,8 @@ ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr,
                        rule->b_spec = TRUE;
                        vxlan_spec = item->spec;
                        rte_memcpy(((uint8_t *)
-                               &rule->ixgbe_fdir.formatted.tni_vni + 1),
+                               &rule->ixgbe_fdir.formatted.tni_vni),
                                vxlan_spec->vni, RTE_DIM(vxlan_spec->vni));
-                       rule->ixgbe_fdir.formatted.tni_vni = rte_be_to_cpu_32(
-                               rule->ixgbe_fdir.formatted.tni_vni);
                }
        }
 
@@ -2588,7 +2586,6 @@ ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr,
                        /* tni is a 24-bits bit field */
                        rte_memcpy(&rule->ixgbe_fdir.formatted.tni_vni,
                        nvgre_spec->tni, RTE_DIM(nvgre_spec->tni));
-                       rule->ixgbe_fdir.formatted.tni_vni <<= 8;
                }
        }