net/ixgbe: fix VXLAN parsing for flow director
authorWei Zhao <wei.zhao1@intel.com>
Fri, 3 Feb 2017 08:44:49 +0000 (16:44 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 10 Feb 2017 11:25:49 +0000 (12:25 +0100)
VNI of VXLAN is parsed wrongly. The root cause is that
VNI array in VXLAN item also uses network byte ordering.

Fixes: 11777435c727 ("net/ixgbe: parse flow director filter")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
drivers/net/ixgbe/ixgbe_flow.c

index d64cfd1..7747831 100644 (file)
@@ -2133,15 +2133,16 @@ ixgbe_parse_fdir_filter_tunnel(const struct rte_flow_attr *attr,
 
                rte_memcpy(&rule->mask.tunnel_id_mask, vxlan_mask->vni,
                        RTE_DIM(vxlan_mask->vni));
-               rule->mask.tunnel_id_mask <<= 8;
 
                if (item->spec) {
                        rule->b_spec = TRUE;
                        vxlan_spec = (const struct rte_flow_item_vxlan *)
                                        item->spec;
-                       rte_memcpy(&rule->ixgbe_fdir.formatted.tni_vni,
+                       rte_memcpy(((uint8_t *)
+                               &rule->ixgbe_fdir.formatted.tni_vni + 1),
                                vxlan_spec->vni, RTE_DIM(vxlan_spec->vni));
-                       rule->ixgbe_fdir.formatted.tni_vni <<= 8;
+                       rule->ixgbe_fdir.formatted.tni_vni = rte_be_to_cpu_32(
+                               rule->ixgbe_fdir.formatted.tni_vni);
                }
        }