octeontx2-af: Fix max NPC MCAM entry check while validating ref_entry
authorSuman Ghosh <sumang@marvell.com>
Mon, 1 Jan 2024 14:50:42 +0000 (20:20 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Feb 2024 20:14:25 +0000 (20:14 +0000)
commit225b254911ef2e800fe25e4bcb9fecdb693ab66b
tree04ecc086b7650454089da3528545d67c33296fa1
parentd973bf8ec3e861bd4e0b1bbe6a23c9e63a63a369
octeontx2-af: Fix max NPC MCAM entry check while validating ref_entry

[ Upstream commit 4ebb1f95e0c3c3e0eec5bb21aa43097580c4b6e4 ]

As of today, the last MCAM entry was not getting allocated because of
a <= check with the max_bmap count. This patch modifies that and if the
requested entry is greater than the available entries then set it to the
max value.

Signed-off-by: Suman Ghosh <sumang@marvell.com>
Link: https://lore.kernel.org/r/20240101145042.419697-1-sumang@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c