Skip to content

Commit 6537e96

Browse files
Subbaraya Sundeepdavem330
authored andcommitted
octeontx2-af: Fix loop in free and unmap counter
When the given counter does not belong to the entry then code ends up in infinite loop because the loop cursor, entry is not getting updated further. This patch fixes that by updating entry for every iteration. Fixes: a958dd5 ("octeontx2-af: Map or unmap NPC MCAM entry and counter") Signed-off-by: Subbaraya Sundeep <[email protected]> Signed-off-by: Sunil Goutham <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent dc56ad7 commit 6537e96

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/ethernet/marvell/octeontx2/af

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2979,10 +2979,11 @@ int rvu_mbox_handler_npc_mcam_unmap_counter(struct rvu *rvu,
29792979
index = find_next_bit(mcam->bmap, mcam->bmap_entries, entry);
29802980
if (index >= mcam->bmap_entries)
29812981
break;
2982+
entry = index + 1;
2983+
29822984
if (mcam->entry2cntr_map[index] != req->cntr)
29832985
continue;
29842986

2985-
entry = index + 1;
29862987
npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr,
29872988
index, req->cntr);
29882989
}

0 commit comments

Comments
 (0)