Skip to content

Commit 748a158

Browse files
Hariprasad Kelamgregkh
authored andcommitted
octeontx2-af: fix infinite loop in unmapping NPC counter
[ Upstream commit 64451b9 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent b553f45 commit 748a158

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
@@ -2035,10 +2035,10 @@ int rvu_mbox_handler_npc_mcam_free_counter(struct rvu *rvu,
20352035
index = find_next_bit(mcam->bmap, mcam->bmap_entries, entry);
20362036
if (index >= mcam->bmap_entries)
20372037
break;
2038+
entry = index + 1;
20382039
if (mcam->entry2cntr_map[index] != req->cntr)
20392040
continue;
20402041

2041-
entry = index + 1;
20422042
npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr,
20432043
index, req->cntr);
20442044
}

0 commit comments

Comments
 (0)