octeontx2-af: Create BPIDs free pool
authorGeetha sowjanya <gakula@marvell.com>
Wed, 31 Jan 2024 07:54:40 +0000 (13:24 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Feb 2024 12:12:35 +0000 (12:12 +0000)
commitd6212d2e41a0cb1ff6b059db79c70752cdafc95e
treee0d1b99db6f1cd64924b52b8b5a0d8b7f1ec56e4
parent094bdd48afb8dde4ac71a6a672b096108ded9f49
octeontx2-af: Create BPIDs free pool

In current driver 64 BPIDs are reserved for LBK interfaces.
These bpids are 1-to-1 mapped to LBK interface channel numbers.
In some usecases one LBK interface required more than one
bpids and in some case they may not require at all.
These usescase can't be address with the current implementation
as it always reserves only one bpid per LBK channel.
This patch addresses this issue by creating free bpid pool from these
64 bpids instead of 1-to-1 mapping to the lbk channel.
Now based on usecase LBK interface can request a bpid using (bp_enable()).

This patch also reduces the number of bpids for cgx interfaces to 8
and adds proper error code

Signed-off-by: Geetha sowjanya <gakula@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/af/mbox.h
drivers/net/ethernet/marvell/octeontx2/af/rvu.c
drivers/net/ethernet/marvell/octeontx2/af/rvu.h
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h