diff options
author | Geetha sowjanya <gakula@marvell.com> | 2018-10-22 20:55:53 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-23 06:15:38 +0300 |
commit | 94d942c5fb970ac2166216838b278613decfa9a0 (patch) | |
tree | 8869a049839791c85c961ca3260035dbd419a4d5 /drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | |
parent | 23923ea4b144ed43ad8f6e5110b06221d0ff1656 (diff) | |
download | linux-94d942c5fb970ac2166216838b278613decfa9a0.tar.xz |
octeontx2-af: Config pkind for CGX mapped PFs
For each CGX LMAC that is mapped to a RVU PF, allocate
a pkind and config the same in CGX. For a received packet
at CGX LMAC interface this pkind is used by NPC block
to start parsing of packet.
Signed-off-by: Geetha sowjanya <gakula@marvell.com>
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_cgx.c')
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c index e0aee2176637..188185c15b4a 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c @@ -50,7 +50,7 @@ static inline u8 cgxlmac_id_to_bmap(u8 cgx_id, u8 lmac_id) return ((cgx_id & 0xF) << 4) | (lmac_id & 0xF); } -static void *rvu_cgx_pdata(u8 cgx_id, struct rvu *rvu) +void *rvu_cgx_pdata(u8 cgx_id, struct rvu *rvu) { if (cgx_id >= rvu->cgx_cnt) return NULL; @@ -60,10 +60,11 @@ static void *rvu_cgx_pdata(u8 cgx_id, struct rvu *rvu) static int rvu_map_cgx_lmac_pf(struct rvu *rvu) { + struct npc_pkind *pkind = &rvu->hw->pkind; int cgx_cnt = rvu->cgx_cnt; int cgx, lmac_cnt, lmac; int pf = PF_CGXMAP_BASE; - int size; + int size, free_pkind; if (!cgx_cnt) return 0; @@ -96,6 +97,8 @@ static int rvu_map_cgx_lmac_pf(struct rvu *rvu) for (lmac = 0; lmac < lmac_cnt; lmac++, pf++) { rvu->pf2cgxlmac_map[pf] = cgxlmac_id_to_bmap(cgx, lmac); rvu->cgxlmac2pf_map[CGX_OFFSET(cgx) + lmac] = 1 << pf; + free_pkind = rvu_alloc_rsrc(&pkind->rsrc); + pkind->pfchan_map[free_pkind] = ((pf) & 0x3F) << 16; rvu->cgx_mapped_pfs++; } } |