net/cxgbe: accept VLAN flow items without ethertype
authorKarra Satwik <kaara.satwik@chelsio.com>
Sun, 20 Dec 2020 22:44:43 +0000 (04:14 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 13 Jan 2021 17:51:57 +0000 (18:51 +0100)
When apps pass the RTE_FLOW_ITEM_TYPE_VLAN without setting the
ethertype field in RTE_FLOW_ITEM_TYPE_ETH, then assume 0x8100
VLAN by default and don't reject the rule.

Fixes: 55f003d8884c ("net/cxgbe: support flow API for matching QinQ VLAN")
Cc: stable@dpdk.org
Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
drivers/net/cxgbe/cxgbe_flow.c

index f7c4f36..520a5a5 100644 (file)
@@ -245,11 +245,6 @@ ch_rte_parsetype_vlan(const void *dmask, const struct rte_flow_item *item,
        /* If user has not given any mask, then use chelsio supported mask. */
        mask = umask ? umask : (const struct rte_flow_item_vlan *)dmask;
 
-       if (!fs->mask.ethtype)
-               return rte_flow_error_set(e, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM,
-                                         item,
-                                         "Can't parse VLAN item without knowing ethertype");
-
        /* If ethertype is already set and is not VLAN (0x8100) or
         * QINQ(0x88A8), then don't proceed further. Otherwise,
         * reset the outer ethertype, so that it can be replaced by
@@ -275,7 +270,7 @@ ch_rte_parsetype_vlan(const void *dmask, const struct rte_flow_item *item,
                        fs->mask.ethtype = 0;
                        fs->val.ethtype = 0;
                }
-       } else if (fs->val.ethtype == RTE_ETHER_TYPE_VLAN) {
+       } else {
                CXGBE_FILL_FS(1, 1, ivlan_vld);
                if (spec) {
                        if (spec->tci || (umask && umask->tci))