]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:30:23 +0000 (14:30 +0200)
commit99ec8db108488433e65ebb131b0ccc7d3deca37d
tree7a420d42b17e792ee8992b48dc5ee3bbbc36b46a
parentf4e51680456d77b78014a669b31de5b86738e635
octeontx2-af: fix infinite loop in unmapping NPC counter

[ Upstream commit 64451b98306bf1334a62bcd020ec92bdb4cb68db ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c