octeontx2-af: Fix start and end bit for scan config
Ratheesh Kannoth
maintainerPATCH 1/1 octeontx2-af: Fix start and end bit for scan config
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 <[email protected]>
Reviewed-by Sunil Kovvuri Goutham <[email protected]>
--- drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c +2 -3
@@ -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++; }
Signature · 1 line
2.25.1
Quoted 4 lines · 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 mapFixes 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
Quoted 25 lines
Signed-off-by Ratheesh Kannoth <[email protected]>Reviewed-by Sunil Kovvuri Goutham <[email protected]>--- drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c +2
-3@@ -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++; }Signature · 1 line
2.25.1