Skip to content

Commit 64451b9

Browse files
Hariprasad Kelamdavem330
authored andcommitted
octeontx2-af: fix infinite loop in unmapping NPC counter
unmapping npc counter works in a way by traversing all mcam entries to find which mcam rule is associated with counter. But loop cursor variable 'entry' is not incremented before checking next mcam entry which resulting in infinite loop. This in turn hogs the kworker thread forever and no other mbox message is processed by AF driver after that. Fix this by updating entry value before checking next mcam entry. Fixes: a958dd5 ("octeontx2-af: Map or unmap NPC MCAM entry and counter") Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f12098c commit 64451b9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/net/ethernet/marvell/octeontx2/af

‎drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2490,10 +2490,10 @@ int rvu_mbox_handler_npc_mcam_free_counter(struct rvu *rvu,
24902490
index = find_next_bit(mcam->bmap, mcam->bmap_entries, entry);
24912491
if (index >= mcam->bmap_entries)
24922492
break;
2493+
entry = index + 1;
24932494
if (mcam->entry2cntr_map[index] != req->cntr)
24942495
continue;
24952496

2496-
entry = index + 1;
24972497
npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr,
24982498
index, req->cntr);
24992499
}

0 commit comments

Comments
 (0)