summaryrefslogtreecommitdiff
path: root/drivers/net/enic
diff options
context:
space:
mode:
authorHyong Youb Kim <hyonkim@cisco.com>2019-03-02 02:42:50 -0800
committerFerruh Yigit <ferruh.yigit@intel.com>2019-03-08 17:52:22 +0100
commit593f17668f5ba3445bdedaa0edc5d308ca43e061 (patch)
tree2bc0eff865a5cc84ac15bea94c09fcbe25eac3d7 /drivers/net/enic
parentd7316eae1a8ab1d8dfb7ac7f2c8804f1a98f2144 (diff)
downloaddpdk-next-eventdev-593f17668f5ba3445bdedaa0edc5d308ca43e061.zip
dpdk-next-eventdev-593f17668f5ba3445bdedaa0edc5d308ca43e061.tar.gz
dpdk-next-eventdev-593f17668f5ba3445bdedaa0edc5d308ca43e061.tar.xz
net/enic: fix endianness in VLAN match
The VLAN fields in the NIC filter use little endian. The VLAN item is in big endian, so swap bytes. Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled") Cc: stable@dpdk.org Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Diffstat (limited to 'drivers/net/enic')
-rw-r--r--drivers/net/enic/enic_flow.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c
index da43b31..b3172e7 100644
--- a/drivers/net/enic/enic_flow.c
+++ b/drivers/net/enic/enic_flow.c
@@ -579,12 +579,16 @@ enic_copy_item_vlan_v2(struct copy_item_args *arg)
/* Outer TPID cannot be matched */
if (eth_mask->ether_type)
return ENOTSUP;
+ /*
+ * When packet matching, the VIC always compares vlan-stripped
+ * L2, regardless of vlan stripping settings. So, the inner type
+ * from vlan becomes the ether type of the eth header.
+ */
eth_mask->ether_type = mask->inner_type;
eth_val->ether_type = spec->inner_type;
-
- /* Outer header. Use the vlan mask/val fields */
- gp->mask_vlan = mask->tci;
- gp->val_vlan = spec->tci;
+ /* For TCI, use the vlan mask/val fields (little endian). */
+ gp->mask_vlan = rte_be_to_cpu_16(mask->tci);
+ gp->val_vlan = rte_be_to_cpu_16(spec->tci);
} else {
/* Inner header. Mask/Val start at *inner_ofst into L5 */
if ((*inner_ofst + sizeof(struct vlan_hdr)) >