Message ID | 20230419062018.286136-3-saikrishnag@marvell.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp146940vqo; Tue, 18 Apr 2023 23:22:19 -0700 (PDT) X-Google-Smtp-Source: AKy350ZJq83ViSkPd86mCvpH7wyar/mv55i7Fim34X53mbYEAkB69cscPRhqsJW0KGJi9it8/0rC X-Received: by 2002:a05:6808:189b:b0:387:2f12:e71a with SMTP id bi27-20020a056808189b00b003872f12e71amr2665930oib.34.1681885339521; Tue, 18 Apr 2023 23:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681885339; cv=none; d=google.com; s=arc-20160816; b=czgKa5++2nrxMtVCxTdbca6/muYFwKivoPLAKjq6G6V1zTsmcxGjR47nr1Tw+4lnHg 5lCY83YgauVPfjQ6qxwqiElG+vcf6kEiyPVhDhI+dfxFWeVMoJSVu/EduZBKHWW76Jer y5DW3Di4xqUbSAFGeyqhnwAFmbL84SxHSS2SxOEkGT0imdnGGUiTxrGrfcAf251pzHLo O0J+Bq08+V0YwG2eyOSec9W63gjeAhPQJfSAs+0+ddqqa/gnK4/xos/t2NnywSfd6fwk cuhcHOfe4Nzg03Y3ZgX8/b6bB+vrbVwDFEYGh7Q6SpbGe44iL4N3yutuval/Ofc6uk6M 8u6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vZF+Ckk1yF654X/TsDitzXVCnh6PRkqBrDRqJewGbr4=; b=KKNEiPXhIS69cjKghRacckADMvGDSUMRauR/GRFwWIqwWEajoPX9hBx9abPtqugIOS oNr4Kodk8qt/R3/DSZntiZGGYdNWRkgLxCkzSEaZJK1l+Lig6qalEfEiPy5lO4qGIOAa 17NyORspmvzoXwRXqP72jalRPINMvfxjQw+aIxgvKoYwhBQ/V9hvMfmPkTm06YGbptwn nlEB7Kt2uNQnkJvJduQJ/vheuZqt6sQhUh8v9TW5F7Ao9zT9QWja03lngnKUo+0zBxCb aGfgZZlX80YyPKqzGO4iKCY2FPQv75uRTK+VwcWiphM5QNYX2aXQ8h8DBLbnmTryUMzH Faow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=dat2cIIV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020acaf204000000b0038e1f0375e5si4658826oih.139.2023.04.18.23.22.06; Tue, 18 Apr 2023 23:22:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=dat2cIIV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231963AbjDSGUv (ORCPT <rfc822;leviz.kernel.dev@gmail.com> + 99 others); Wed, 19 Apr 2023 02:20:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231844AbjDSGUp (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Apr 2023 02:20:45 -0400 Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF147619B; Tue, 18 Apr 2023 23:20:44 -0700 (PDT) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33J3qnRH021480; Tue, 18 Apr 2023 23:20:38 -0700 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-transfer-encoding : content-type; s=pfpt0220; bh=vZF+Ckk1yF654X/TsDitzXVCnh6PRkqBrDRqJewGbr4=; b=dat2cIIViHfDNg1QtbPjp3EPaEfu2pd09CWgPk0ORWxctmb6ceC9XXEOPZ9girDBqJnk dWeaTpNTaGNopld/spp+Z9uM2fxal9U8zFKh7ow7LjZQ6xfdM+/I/eTdM1PCzH4Cn967 UTcoK5xSlYgTkGCGaPXW3nGFUfEk3fbv9WypS5zS5TS/YKn9uL7z9W35q+BOH3i4wi8e OOd/LUQFVdYh5AGvmmzG+/R3RgsjSw4DSgYL05JPrmVvRCg3p6azvrzoLohjwU+VSQne IXLHcrLVHXEOcoW94hcMwTEFOSz8X3SXEE1sg9qeB4YJDDaD3FkCpT+i/AbuSnSSQ4uD 7g== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3q28s0gmfs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 18 Apr 2023 23:20:38 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 18 Apr 2023 23:20:36 -0700 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.48 via Frontend Transport; Tue, 18 Apr 2023 23:20:36 -0700 Received: from hyd1425.marvell.com (unknown [10.29.37.83]) by maili.marvell.com (Postfix) with ESMTP id 93F3C3F7055; Tue, 18 Apr 2023 23:20:31 -0700 (PDT) From: Sai Krishna <saikrishnag@marvell.com> To: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>, <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <simon.horman@corigine.com>, <leon@kernel.org>, <sgoutham@marvell.com>, <gakula@marvell.com>, <lcherian@marvell.com>, <jerinj@marvell.com>, <hkelam@marvell.com>, <sbhatta@marvell.com> CC: Ratheesh Kannoth <rkannoth@marvell.com>, Sai Krishna <saikrishnag@marvell.com> Subject: [net PATCH v3 02/10] octeontx2-af: Fix start and end bit for scan config Date: Wed, 19 Apr 2023 11:50:10 +0530 Message-ID: <20230419062018.286136-3-saikrishnag@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230419062018.286136-1-saikrishnag@marvell.com> References: <20230419062018.286136-1-saikrishnag@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: dQbLKw41CkNeyYa0-SGDfrW5fXEbAa-4 X-Proofpoint-ORIG-GUID: dQbLKw41CkNeyYa0-SGDfrW5fXEbAa-4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-19_02,2023-04-18_01,2023-02-09_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763584601505421997?= X-GMAIL-MSGID: =?utf-8?q?1763584601505421997?= |
Series |
octeontx2: Miscellaneous fixes
|
|
Commit Message
Sai Krishna Gajula
April 19, 2023, 6:20 a.m. UTC
From: Ratheesh Kannoth <rkannoth@marvell.com> Fix the NPC nibble start and end positions in the bit map. for_each_set_bit_from() needs start bit as one bit prior and end bit as one bit post position in the bit map Fixes: b747923afff8 ("octeontx2-af: Exact match support") Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com> Signed-off-by: Sai Krishna <saikrishnag@marvell.com> --- drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Comments
On Wed, Apr 19, 2023 at 11:50:10AM +0530, Sai Krishna wrote: > From: Ratheesh Kannoth <rkannoth@marvell.com> > > Fix the NPC nibble start and end positions in the bit > map. for_each_set_bit_from() needs start bit as one bit prior > and end bit as one bit post position in the bit map > > Fixes: b747923afff8 ("octeontx2-af: Exact match support") > Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com> > Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com> > Signed-off-by: Sai Krishna <saikrishnag@marvell.com> I think it would be nice to explain why, and what effect this has. Also, TBH, I'm unsure why the start needs to be one bit prior. > --- > drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c > index 006beb5cf98d..27603078689a 100644 > --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c > +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c > @@ -593,9 +593,8 @@ static int npc_scan_kex(struct rvu *rvu, int blkaddr, u8 intf) > * exact match code. > */ > masked_cfg = cfg & NPC_EXACT_NIBBLE; > - bitnr = NPC_EXACT_NIBBLE_START; > - for_each_set_bit_from(bitnr, (unsigned long *)&masked_cfg, > - NPC_EXACT_NIBBLE_START) { > + bitnr = NPC_EXACT_NIBBLE_START - 1; > + for_each_set_bit_from(bitnr, (unsigned long *)&masked_cfg, NPC_EXACT_NIBBLE_END + 1) { > npc_scan_exact_result(mcam, bitnr, key_nibble, intf); > key_nibble++; > } > -- > 2.25.1 >
> -----Original Message----- > From: Simon Horman <simon.horman@corigine.com> > Sent: Wednesday, April 19, 2023 4:05 PM > To: Sai Krishna Gajula <saikrishnag@marvell.com> > Cc: davem@davemloft.net; edumazet@google.com; kuba@kernel.org; > pabeni@redhat.com; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org; leon@kernel.org; Sunil Kovvuri Goutham > <sgoutham@marvell.com>; Geethasowjanya Akula <gakula@marvell.com>; > Linu Cherian <lcherian@marvell.com>; Jerin Jacob Kollanukkaran > <jerinj@marvell.com>; Hariprasad Kelam <hkelam@marvell.com>; > Subbaraya Sundeep Bhatta <sbhatta@marvell.com>; Ratheesh Kannoth > <rkannoth@marvell.com> > Subject: Re: [net PATCH v3 02/10] octeontx2-af: Fix start and end bit for > scan config > > On Wed, Apr 19, 2023 at 11:50:10AM +0530, Sai Krishna wrote: > > From: Ratheesh Kannoth <rkannoth@marvell.com> > > > > Fix the NPC nibble start and end positions in the bit map. > > for_each_set_bit_from() needs start bit as one bit prior and end bit > > as one bit post position in the bit map > > > > Fixes: b747923afff8 ("octeontx2-af: Exact match support") > > Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com> > > Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com> > > Signed-off-by: Sai Krishna <saikrishnag@marvell.com> > > I think it would be nice to explain why, and what effect this has. > > Also, TBH, I'm unsure why the start needs to be one bit prior. > Will expand the commit message with explanation of why, what effect of fix in v4 patch. > > --- > > drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c > > b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c > > index 006beb5cf98d..27603078689a 100644 > > --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c > > +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c > > @@ -593,9 +593,8 @@ static int npc_scan_kex(struct rvu *rvu, int blkaddr, > u8 intf) > > * exact match code. > > */ > > masked_cfg = cfg & NPC_EXACT_NIBBLE; > > - bitnr = NPC_EXACT_NIBBLE_START; > > - for_each_set_bit_from(bitnr, (unsigned long *)&masked_cfg, > > - NPC_EXACT_NIBBLE_START) { > > + bitnr = NPC_EXACT_NIBBLE_START - 1; > > + for_each_set_bit_from(bitnr, (unsigned long *)&masked_cfg, > > +NPC_EXACT_NIBBLE_END + 1) { > > npc_scan_exact_result(mcam, bitnr, key_nibble, intf); > > key_nibble++; > > } > > -- > > 2.25.1 > >
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c index 006beb5cf98d..27603078689a 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c @@ -593,9 +593,8 @@ static int npc_scan_kex(struct rvu *rvu, int blkaddr, u8 intf) * exact match code. */ masked_cfg = cfg & NPC_EXACT_NIBBLE; - bitnr = NPC_EXACT_NIBBLE_START; - for_each_set_bit_from(bitnr, (unsigned long *)&masked_cfg, - NPC_EXACT_NIBBLE_START) { + bitnr = NPC_EXACT_NIBBLE_START - 1; + for_each_set_bit_from(bitnr, (unsigned long *)&masked_cfg, NPC_EXACT_NIBBLE_END + 1) { npc_scan_exact_result(mcam, bitnr, key_nibble, intf); key_nibble++; }