diff options
author | Sunil Goutham <sgoutham@marvell.com> | 2018-11-19 16:17:27 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-19 17:56:07 -0800 |
commit | f92749586176f884044f47da62dcc231f6b43cd5 (patch) | |
tree | 0e9729966bd36cf06ca56254dd38378a26bec96b /drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | |
parent | octeontx2-af: Relax resource lock into mutex (diff) | |
download | linux-dev-f92749586176f884044f47da62dcc231f6b43cd5.tar.xz linux-dev-f92749586176f884044f47da62dcc231f6b43cd5.zip |
octeontx2-af: NPC MCAM entry alloc/free support
This patch adds NPC MCAM entry management and support for
allocating and freeing them via mailbox. Both contiguous and
non-contiguous allocations are supported. Incase of contiguous,
if request cannot be met then max contiguous number of available
entries are allocated.
High or low priority index allocation w.r.t a reference MCAM index
is also supported.
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c')
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c index ff7f8f3cedb5..0491e358b769 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c @@ -55,6 +55,17 @@ struct mce { u16 pcifunc; }; +bool is_nixlf_attached(struct rvu *rvu, u16 pcifunc) +{ + struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); + int blkaddr; + + blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NIX, pcifunc); + if (!pfvf->nixlf || blkaddr < 0) + return false; + return true; +} + int rvu_get_nixlf_count(struct rvu *rvu) { struct rvu_block *block; |