From patchwork Sun Dec 20 22:44:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Lakkireddy X-Patchwork-Id: 85565 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 125F2A09FD; Mon, 21 Dec 2020 00:01:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 30E6CCACF; Mon, 21 Dec 2020 00:01:16 +0100 (CET) Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id 1E8D0CACA; Mon, 21 Dec 2020 00:01:12 +0100 (CET) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id 0BKN18dp011865; Sun, 20 Dec 2020 15:01:09 -0800 From: Rahul Lakkireddy To: dev@dpdk.org Cc: kaara.satwik@chelsio.com, stable@dpdk.org Date: Mon, 21 Dec 2020 04:14:43 +0530 Message-Id: <1608504283-29133-1-git-send-email-rahul.lakkireddy@chelsio.com> X-Mailer: git-send-email 2.5.3 Subject: [dpdk-dev] [PATCH] net/cxgbe: accept VLAN flow items without ethertype X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Karra Satwik 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 Signed-off-by: Rahul Lakkireddy --- drivers/net/cxgbe/cxgbe_flow.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c index f7c4f3696..520a5a5c9 100644 --- a/drivers/net/cxgbe/cxgbe_flow.c +++ b/drivers/net/cxgbe/cxgbe_flow.c @@ -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))