* [net PATCH] octeontx2-af: Fix max NPC MCAM entry check while validating ref_entry
@ 2024-01-01 14:50 Suman Ghosh
2024-01-04 2:10 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Suman Ghosh @ 2024-01-01 14:50 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, sgoutham, sbhatta, jerinj, gakula,
hkelam, lcherian, netdev, linux-kernel
Cc: Suman Ghosh
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.
Fixes: f92749586176 ("octeontx2-af: NPC MCAM entry alloc/free support")
Signed-off-by: Suman Ghosh <sumang@marvell.com>
---
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
index 0bcf3e559280..3784347b6fd8 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -2678,18 +2678,17 @@ int rvu_mbox_handler_npc_mcam_alloc_entry(struct rvu *rvu,
rsp->entry = NPC_MCAM_ENTRY_INVALID;
rsp->free_count = 0;
- /* Check if ref_entry is within range */
- if (req->priority && req->ref_entry >= mcam->bmap_entries) {
- dev_err(rvu->dev, "%s: reference entry %d is out of range\n",
- __func__, req->ref_entry);
- return NPC_MCAM_INVALID_REQ;
- }
+ /* Check if ref_entry is greater that the range
+ * then set it to max value.
+ */
+ if (req->ref_entry > mcam->bmap_entries)
+ req->ref_entry = mcam->bmap_entries;
/* ref_entry can't be '0' if requested priority is high.
* Can't be last entry if requested priority is low.
*/
if ((!req->ref_entry && req->priority == NPC_MCAM_HIGHER_PRIO) ||
- ((req->ref_entry == (mcam->bmap_entries - 1)) &&
+ ((req->ref_entry == mcam->bmap_entries) &&
req->priority == NPC_MCAM_LOWER_PRIO))
return NPC_MCAM_INVALID_REQ;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [net PATCH] octeontx2-af: Fix max NPC MCAM entry check while validating ref_entry
2024-01-01 14:50 [net PATCH] octeontx2-af: Fix max NPC MCAM entry check while validating ref_entry Suman Ghosh
@ 2024-01-04 2:10 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-01-04 2:10 UTC (permalink / raw)
To: Suman Ghosh
Cc: davem, edumazet, kuba, pabeni, sgoutham, sbhatta, jerinj, gakula,
hkelam, lcherian, netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 1 Jan 2024 20:20:42 +0530 you wrote:
> 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.
>
> Fixes: f92749586176 ("octeontx2-af: NPC MCAM entry alloc/free support")
> Signed-off-by: Suman Ghosh <sumang@marvell.com>
>
> [...]
Here is the summary with links:
- [net] octeontx2-af: Fix max NPC MCAM entry check while validating ref_entry
https://git.kernel.org/netdev/net-next/c/4ebb1f95e0c3
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-04 2:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-01 14:50 [net PATCH] octeontx2-af: Fix max NPC MCAM entry check while validating ref_entry Suman Ghosh
2024-01-04 2:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox