public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [net PATCH] octeontx2-af: Fix start and end bit for scan config
@ 2023-03-02  3:28 Ratheesh Kannoth
  2023-03-02  9:21 ` Leon Romanovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Ratheesh Kannoth @ 2023-03-02  3:28 UTC (permalink / raw)
  To: netdev, linux-kernel, davem, edumazet, kuba, pabeni, leon
  Cc: sgoutham, Ratheesh Kannoth

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: 88fffc65f940 (octeontx2-af: Exact match scan from kex profile)
Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Reviewed-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
---
 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 327d3c6b1175..9c7bbef27e31 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
@@ -603,9 +603,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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [net PATCH] octeontx2-af: Fix start and end bit for scan config
  2023-03-02  3:28 [net PATCH] octeontx2-af: Fix start and end bit for scan config Ratheesh Kannoth
@ 2023-03-02  9:21 ` Leon Romanovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2023-03-02  9:21 UTC (permalink / raw)
  To: Ratheesh Kannoth
  Cc: netdev, linux-kernel, davem, edumazet, kuba, pabeni, sgoutham

On Thu, Mar 02, 2023 at 08:58:55AM +0530, Ratheesh Kannoth wrote:
> 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: 88fffc65f940 (octeontx2-af: Exact match scan from kex profile)

This is wrong Fixes line. It should be:
Fixes: 812103edf670 ("octeontx2-af: Exact match scan from kex profile")

Thanks

> Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
> Reviewed-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
> ---
>  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 327d3c6b1175..9c7bbef27e31 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
> @@ -603,9 +603,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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-02  9:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-02  3:28 [net PATCH] octeontx2-af: Fix start and end bit for scan config Ratheesh Kannoth
2023-03-02  9:21 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox