From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A316C4373A; Thu, 21 Dec 2023 07:38:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCB5D40E36; Thu, 21 Dec 2023 07:38:37 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id B0E86402E5; Thu, 21 Dec 2023 07:38:36 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BL1SX8u027848; Wed, 20 Dec 2023 22:38:36 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=pfpt0220; bh=NLIYJZDCkkRy0qAfV+2IE RmCb69ich11pUDgfrmtWks=; b=P0saWLQcrmvST7u3hL1OiPLGpYqgXC80g0h7E sVu815TonCB6ObdLH3ShTYaeZMEidLL4iHX5J2QrqCO1A/FT6pWzrR2xqFEUiInC 4JY4OxlfCKwERgz5KlPx+mY788GSi06NZlvnGhQeMWffa7kXJR0J9lgmsu6btKea bNBjeQWV3fMmp1bZZwd3m7stPhcjHFYxTMaJlxOr9YjQr9kMO04RpP9we2rKjytB /P6iSamAhKxJwcKqh/iqyFQ4DCicBHpVQ3q2emC3HJxbpTN61uNiXWKNfv677DZr mOQg/ujUVaK31AQMXrd/Cpn4oS8pBLRucK/UdNmNdO3esrAqg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3v3ntrpp0f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 20 Dec 2023 22:38:35 -0800 (PST) Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 20 Dec 2023 22:38:33 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 20 Dec 2023 22:38:33 -0800 Received: from localhost.localdomain (unknown [10.29.52.211]) by maili.marvell.com (Postfix) with ESMTP id 1CF843F7079; Wed, 20 Dec 2023 22:38:30 -0800 (PST) From: Harman Kalra To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , , Harman Kalra , Subject: [PATCH 2/2] common/cnxk: fix VLAN check for inner header Date: Thu, 21 Dec 2023 12:08:11 +0530 Message-ID: <20231221063811.17376-2-hkalra@marvell.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20231221063811.17376-1-hkalra@marvell.com> References: <20231221063811.17376-1-hkalra@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: BHtTI10zjgYFFHf5RofkwwsJXcC543u- X-Proofpoint-ORIG-GUID: BHtTI10zjgYFFHf5RofkwwsJXcC543u- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Adding the has vlan check in inner headers i.e in LF layer. If has_vlan is 0 it should be masked out while installing flow rule. Fixes: c34ea71b878d ("common/cnxk: add NPC parsing API") Cc: stable@dpdk.org Signed-off-by: Harman Kalra --- drivers/common/cnxk/roc_npc_parse.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/common/cnxk/roc_npc_parse.c b/drivers/common/cnxk/roc_npc_parse.c index 9ceb707ebb..571d6b8e5d 100644 --- a/drivers/common/cnxk/roc_npc_parse.c +++ b/drivers/common/cnxk/roc_npc_parse.c @@ -1097,6 +1097,7 @@ npc_parse_lf(struct npc_parse_state *pst) { const struct roc_npc_item_info *pattern, *last_pattern; char hw_mask[NPC_MAX_EXTRACT_HW_LEN]; + const struct roc_npc_flow_item_eth *eth_item; struct npc_parse_item_info info; int lid, lt, lflags; int nr_vlans = 0; @@ -1113,10 +1114,12 @@ npc_parse_lf(struct npc_parse_state *pst) lt = NPC_LT_LF_TU_ETHER; lflags = 0; + eth_item = pst->pattern->spec; + /* No match support for vlan tags */ info.def_mask = NULL; info.hw_mask = NULL; - info.len = pst->pattern->size; + info.len = sizeof(eth_item->hdr); info.spec = NULL; info.mask = NULL; info.hw_hdr_len = 0; @@ -1147,12 +1150,15 @@ npc_parse_lf(struct npc_parse_state *pst) } info.hw_mask = &hw_mask; - info.len = pst->pattern->size; + info.len = sizeof(eth_item->hdr); info.hw_hdr_len = 0; npc_get_hw_supp_mask(pst, &info, lid, lt); info.spec = NULL; info.mask = NULL; + if (eth_item && eth_item->has_vlan) + pst->set_vlan_ltype_mask = true; + rc = npc_parse_item_basic(pst->pattern, &info); if (rc != 0) return rc; -- 2.18.0