common/cnxk: improve MCAM entries management
authorSatheesh Paul <psatheesh@marvell.com>
Tue, 5 Oct 2021 02:55:27 +0000 (08:25 +0530)
committerJerin Jacob <jerinj@marvell.com>
Tue, 19 Oct 2021 19:00:11 +0000 (21:00 +0200)
commit1f66919817ee899c9d369d81ebe64ddac32bb814
tree9ae4e96ab83b2d0d85f2134b9d1f7eff1f3cc815
parent5ea354a1f2cc40936db381d84c22f5fbc9dbc4fa
common/cnxk: improve MCAM entries management

This patch removes the MCAM preallocation scheme. The free
entry cache is removed and for every flow created, an MCAM
allocation request is made to the kernel. Each priority level
has a list of MCAM entries. For every flow rule added, the
MCAM entry obtained from kernel is checked if it is at the
correct user specified priority. If not, the existing rules
are moved across MCAM entries so that the user specified
priority is maintained.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
drivers/common/cnxk/roc_npc.c
drivers/common/cnxk/roc_npc_mcam.c
drivers/common/cnxk/roc_npc_priv.h
drivers/common/cnxk/roc_npc_utils.c