From patchwork Thu Jan 12 06:36:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Satheesh Paul Antonysamy X-Patchwork-Id: 121876 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E6B24423B1; Thu, 12 Jan 2023 07:36:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D3C640A7D; Thu, 12 Jan 2023 07:36:31 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 5F5B0400EF; Thu, 12 Jan 2023 07:36:29 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30C2OIKS017539; Wed, 11 Jan 2023 22:36:28 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=8bF1TPRxwAp5N8NzBN1FdoTrbkQt3XimE9IV3OrPrcM=; b=FRUQAUeoM5HBtGNriqMEMfTLCZK4GqxbMRsG0wEXKNsf5JOhE4yBAyk7OFDbd2i0MNgQ VqZ6yTSlCV7uvh5Zp78+bSYNKc0W5Mf6Sb1+s7DoxJ9NLBYNMdYEzMmjNrHsJyrVDOKQ tdsmKYGRqzroXNPD4567rAcJHSr49aZtzKGVSz5W8Rrq9urfu1/bRvMkSbGsK8xiFs9I blZzwfcdNtDcoKUiMO9dRXRX+uHtKf3wWpn+vXh0cGV0VFpc17CUenW6/TZJ5i8VjzYO mbrb33X1izGJQA7F88t0D90W5E0ipoBScLHOs11jOGHIR0tBP0p/toVLlciueXeZD/oO dg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3n1k56xgfu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 11 Jan 2023 22:36:28 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 11 Jan 2023 22:36:25 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Wed, 11 Jan 2023 22:36:25 -0800 Received: from satheeshpaullabpc.. (unknown [10.28.34.33]) by maili.marvell.com (Postfix) with ESMTP id A30953F7075; Wed, 11 Jan 2023 22:36:23 -0800 (PST) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , , Satheesh Paul Subject: [dpdk-dev] [PATCH] common/cnxk: fix issue with IPv6 ext matching Date: Thu, 12 Jan 2023 12:06:20 +0530 Message-ID: <20230112063620.1057554-1-psatheesh@marvell.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: f1T14IXB9AlM7jpY4w-4B4XV6uqKDs32 X-Proofpoint-GUID: f1T14IXB9AlM7jpY4w-4B4XV6uqKDs32 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-12_03,2023-01-11_03,2022-06-22_01 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 From: Kiran Kumar K While configuring ipv6 flow, ipv6 ext ltype should be matched along with ipv6. Adding changes to fix this issue. Fixes: 474e275b1bc6 ("common/cnxk: support extensions attributes in IPv6 item") Cc: stable@dpdk.org Signed-off-by: Kiran Kumar K Reviewed-by: Satheesh Paul --- drivers/common/cnxk/roc_npc_mcam.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c index c419ce3a4c..0abd8872b1 100644 --- a/drivers/common/cnxk/roc_npc_mcam.c +++ b/drivers/common/cnxk/roc_npc_mcam.c @@ -727,15 +727,16 @@ npc_set_ipv6ext_ltype_mask(struct npc_parse_state *pst) * because for AH and ESP, LC LFLAG is zero and we don't want to match * zero in LFLAG. */ - lcflag_offset = - __builtin_popcount(pst->npc->keyx_supp_nmask[pst->nix_intf] & - ((1ULL << NPC_LFLAG_LC_OFFSET) - 1)); - lcflag_offset *= 4; - - mask = (0xfULL << lcflag_offset); - val = pst->flow->mcam_data[0] & mask; - if (val) - pst->flow->mcam_mask[0] |= mask; + if (pst->npc->keyx_supp_nmask[pst->nix_intf] & (1ULL << NPC_LFLAG_LC_OFFSET)) { + lcflag_offset = __builtin_popcount(pst->npc->keyx_supp_nmask[pst->nix_intf] & + ((1ULL << NPC_LFLAG_LC_OFFSET) - 1)); + lcflag_offset *= 4; + + mask = (0xfULL << lcflag_offset); + val = pst->flow->mcam_data[0] & mask; + if (val) + pst->flow->mcam_mask[0] |= mask; + } } int