octeontx2-af: fix infinite loop in unmapping NPC counter
authorHariprasad Kelam <hkelam@marvell.com>
Thu, 18 Mar 2021 14:15:48 +0000 (19:45 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Mar 2021 21:12:42 +0000 (14:12 -0700)
commit64451b98306bf1334a62bcd020ec92bdb4cb68db
tree5bfe3d1462e19f059817b8b046299dbbe4fc81b3
parentf12098ce9b43e1a6fcaa524acbd90f9118a74c0a
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: a958dd59f9ce ("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>
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c