octeontx2-af: Configure AF VFs to talk over LBK channels
Configure AF VFs such that they are able to talk over consecutive loopback channels. If 8 VFs are attached to AF then communication will work as below: TX RX lbk0 -> lbk1 lbk1 -> lbk0 lbk2 -> lbk3 lbk3 -> lbk2 lbk4 -> lbk5 lbk5 -> lbk4 lbk6 -> lbk7 lbk7 -> lbk6 Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
9bd6caf335
commit
8bb991c5e7
@@ -174,7 +174,9 @@ enum nix_scheduler {
|
|||||||
|
|
||||||
#define MAX_LMAC_PKIND 12
|
#define MAX_LMAC_PKIND 12
|
||||||
#define NIX_LINK_CGX_LMAC(a, b) (0 + 4 * (a) + (b))
|
#define NIX_LINK_CGX_LMAC(a, b) (0 + 4 * (a) + (b))
|
||||||
|
#define NIX_LINK_LBK(a) (12 + (a))
|
||||||
#define NIX_CHAN_CGX_LMAC_CHX(a, b, c) (0x800 + 0x100 * (a) + 0x10 * (b) + (c))
|
#define NIX_CHAN_CGX_LMAC_CHX(a, b, c) (0x800 + 0x100 * (a) + 0x10 * (b) + (c))
|
||||||
|
#define NIX_CHAN_LBK_CHX(a, b) (0 + 0x100 * (a) + (b))
|
||||||
|
|
||||||
/* NIX LSO format indices.
|
/* NIX LSO format indices.
|
||||||
* As of now TSO is the only one using, so statically assigning indices.
|
* As of now TSO is the only one using, so statically assigning indices.
|
||||||
|
|||||||
@@ -258,6 +258,11 @@ static inline u64 rvupf_read64(struct rvu *rvu, u64 offset)
|
|||||||
/* Function Prototypes
|
/* Function Prototypes
|
||||||
* RVU
|
* RVU
|
||||||
*/
|
*/
|
||||||
|
static inline int is_afvf(u16 pcifunc)
|
||||||
|
{
|
||||||
|
return !(pcifunc & ~RVU_PFVF_FUNC_MASK);
|
||||||
|
}
|
||||||
|
|
||||||
int rvu_alloc_bitmap(struct rsrc_bmap *rsrc);
|
int rvu_alloc_bitmap(struct rsrc_bmap *rsrc);
|
||||||
int rvu_alloc_rsrc(struct rsrc_bmap *rsrc);
|
int rvu_alloc_rsrc(struct rsrc_bmap *rsrc);
|
||||||
void rvu_free_rsrc(struct rsrc_bmap *rsrc, int id);
|
void rvu_free_rsrc(struct rsrc_bmap *rsrc, int id);
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ static int nix_interface_init(struct rvu *rvu, u16 pcifunc, int type, int nixlf)
|
|||||||
{
|
{
|
||||||
struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc);
|
struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc);
|
||||||
u8 cgx_id, lmac_id;
|
u8 cgx_id, lmac_id;
|
||||||
int pkind, pf;
|
int pkind, pf, vf;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
pf = rvu_get_pf(pcifunc);
|
pf = rvu_get_pf(pcifunc);
|
||||||
@@ -170,6 +170,14 @@ static int nix_interface_init(struct rvu *rvu, u16 pcifunc, int type, int nixlf)
|
|||||||
rvu_npc_set_pkind(rvu, pkind, pfvf);
|
rvu_npc_set_pkind(rvu, pkind, pfvf);
|
||||||
break;
|
break;
|
||||||
case NIX_INTF_TYPE_LBK:
|
case NIX_INTF_TYPE_LBK:
|
||||||
|
vf = (pcifunc & RVU_PFVF_FUNC_MASK) - 1;
|
||||||
|
pfvf->rx_chan_base = NIX_CHAN_LBK_CHX(0, vf);
|
||||||
|
pfvf->tx_chan_base = vf & 0x1 ? NIX_CHAN_LBK_CHX(0, vf - 1) :
|
||||||
|
NIX_CHAN_LBK_CHX(0, vf + 1);
|
||||||
|
pfvf->rx_chan_cnt = 1;
|
||||||
|
pfvf->tx_chan_cnt = 1;
|
||||||
|
rvu_npc_install_promisc_entry(rvu, pcifunc, nixlf,
|
||||||
|
pfvf->rx_chan_base, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -684,7 +692,7 @@ int rvu_mbox_handler_nix_lf_alloc(struct rvu *rvu,
|
|||||||
struct nix_lf_alloc_req *req,
|
struct nix_lf_alloc_req *req,
|
||||||
struct nix_lf_alloc_rsp *rsp)
|
struct nix_lf_alloc_rsp *rsp)
|
||||||
{
|
{
|
||||||
int nixlf, qints, hwctx_size, err, rc = 0;
|
int nixlf, qints, hwctx_size, intf, err, rc = 0;
|
||||||
struct rvu_hwinfo *hw = rvu->hw;
|
struct rvu_hwinfo *hw = rvu->hw;
|
||||||
u16 pcifunc = req->hdr.pcifunc;
|
u16 pcifunc = req->hdr.pcifunc;
|
||||||
struct rvu_block *block;
|
struct rvu_block *block;
|
||||||
@@ -839,7 +847,8 @@ int rvu_mbox_handler_nix_lf_alloc(struct rvu *rvu,
|
|||||||
/* Config Rx pkt length, csum checks and apad enable / disable */
|
/* Config Rx pkt length, csum checks and apad enable / disable */
|
||||||
rvu_write64(rvu, blkaddr, NIX_AF_LFX_RX_CFG(nixlf), req->rx_cfg);
|
rvu_write64(rvu, blkaddr, NIX_AF_LFX_RX_CFG(nixlf), req->rx_cfg);
|
||||||
|
|
||||||
err = nix_interface_init(rvu, pcifunc, NIX_INTF_TYPE_CGX, nixlf);
|
intf = is_afvf(pcifunc) ? NIX_INTF_TYPE_LBK : NIX_INTF_TYPE_CGX;
|
||||||
|
err = nix_interface_init(rvu, pcifunc, intf, nixlf);
|
||||||
if (err)
|
if (err)
|
||||||
goto free_mem;
|
goto free_mem;
|
||||||
|
|
||||||
@@ -1354,6 +1363,10 @@ static int nix_update_bcast_mce_list(struct rvu *rvu, u16 pcifunc, bool add)
|
|||||||
struct rvu_pfvf *pfvf;
|
struct rvu_pfvf *pfvf;
|
||||||
int blkaddr;
|
int blkaddr;
|
||||||
|
|
||||||
|
/* Broadcast pkt replication is not needed for AF's VFs, hence skip */
|
||||||
|
if (is_afvf(pcifunc))
|
||||||
|
return 0;
|
||||||
|
|
||||||
blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NIX, pcifunc);
|
blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NIX, pcifunc);
|
||||||
if (blkaddr < 0)
|
if (blkaddr < 0)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1966,6 +1979,12 @@ int rvu_mbox_handler_nix_rxvlan_alloc(struct rvu *rvu, struct msg_req *req,
|
|||||||
int blkaddr, nixlf, err;
|
int blkaddr, nixlf, err;
|
||||||
struct rvu_pfvf *pfvf;
|
struct rvu_pfvf *pfvf;
|
||||||
|
|
||||||
|
/* LBK VFs do not have separate MCAM UCAST entry hence
|
||||||
|
* skip allocating rxvlan for them
|
||||||
|
*/
|
||||||
|
if (is_afvf(pcifunc))
|
||||||
|
return 0;
|
||||||
|
|
||||||
pfvf = rvu_get_pfvf(rvu, pcifunc);
|
pfvf = rvu_get_pfvf(rvu, pcifunc);
|
||||||
if (pfvf->rxvlan)
|
if (pfvf->rxvlan)
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -314,6 +314,10 @@ void rvu_npc_install_ucast_entry(struct rvu *rvu, u16 pcifunc,
|
|||||||
int blkaddr, index, kwi;
|
int blkaddr, index, kwi;
|
||||||
u64 mac = 0;
|
u64 mac = 0;
|
||||||
|
|
||||||
|
/* AF's VFs work in promiscuous mode */
|
||||||
|
if (is_afvf(pcifunc))
|
||||||
|
return;
|
||||||
|
|
||||||
blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);
|
blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);
|
||||||
if (blkaddr < 0)
|
if (blkaddr < 0)
|
||||||
return;
|
return;
|
||||||
@@ -368,12 +372,12 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc,
|
|||||||
struct nix_rx_action action = { };
|
struct nix_rx_action action = { };
|
||||||
int blkaddr, index, kwi;
|
int blkaddr, index, kwi;
|
||||||
|
|
||||||
blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);
|
/* Only PF or AF VF can add a promiscuous entry */
|
||||||
if (blkaddr < 0)
|
if ((pcifunc & RVU_PFVF_FUNC_MASK) && !is_afvf(pcifunc))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Only PF or AF VF can add a promiscuous entry */
|
blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);
|
||||||
if (pcifunc & RVU_PFVF_FUNC_MASK)
|
if (blkaddr < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
index = npc_get_nixlf_mcam_index(mcam, pcifunc,
|
index = npc_get_nixlf_mcam_index(mcam, pcifunc,
|
||||||
|
|||||||
Reference in New Issue
Block a user