Skip to content

Commit a7bd721

Browse files
Hariprasad Kelamkuba-moo
authored andcommitted
Octeontx2-af: Broadcast XON on all channels
The NIX block receives traffic from multiple channels, including: MAC block (RPM) Loopback module (LBK) CPT block RPM | ----------------- LBK --| NIX | ----------------- | CPT Due to a hardware errata, CN10k and earlier Octeon silicon series, the hardware may incorrectly assert XOFF on certain channels during reset. As a workaround, a write operation to the NIX_AF_RX_CHANX_CFG register can be performed to broadcast XON signals on the affected channels Signed-off-by: Hariprasad Kelam <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 62d7f40 commit a7bd721

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

drivers/net/ethernet/marvell/octeontx2/af/rvu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,9 @@ static int rvu_setup_hw_resources(struct rvu *rvu)
11641164
rvu_program_channels(rvu);
11651165
cgx_start_linkup(rvu);
11661166

1167+
rvu_block_bcast_xon(rvu, BLKADDR_NIX0);
1168+
rvu_block_bcast_xon(rvu, BLKADDR_NIX1);
1169+
11671170
err = rvu_mcs_init(rvu);
11681171
if (err) {
11691172
dev_err(rvu->dev, "%s: Failed to initialize mcs\n", __func__);

drivers/net/ethernet/marvell/octeontx2/af/rvu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,7 @@ int rvu_nix_mcast_update_mcam_entry(struct rvu *rvu, u16 pcifunc,
10171017
void rvu_nix_flr_free_bpids(struct rvu *rvu, u16 pcifunc);
10181018
int rvu_alloc_cint_qint_mem(struct rvu *rvu, struct rvu_pfvf *pfvf,
10191019
int blkaddr, int nixlf);
1020+
void rvu_block_bcast_xon(struct rvu *rvu, int blkaddr);
10201021
/* NPC APIs */
10211022
void rvu_npc_freemem(struct rvu *rvu);
10221023
int rvu_npc_get_pkind(struct rvu *rvu, u16 pf);

drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6616,3 +6616,19 @@ int rvu_mbox_handler_nix_mcast_grp_update(struct rvu *rvu,
66166616

66176617
return ret;
66186618
}
6619+
6620+
/* On CN10k and older series of silicons, hardware may incorrectly
6621+
* assert XOFF on certain channels. Issue a write on NIX_AF_RX_CHANX_CFG
6622+
* to broadcacst XON on the same.
6623+
*/
6624+
void rvu_block_bcast_xon(struct rvu *rvu, int blkaddr)
6625+
{
6626+
struct rvu_block *block = &rvu->hw->block[blkaddr];
6627+
u64 cfg;
6628+
6629+
if (!block->implemented || is_cn20k(rvu->pdev))
6630+
return;
6631+
6632+
cfg = rvu_read64(rvu, blkaddr, NIX_AF_RX_CHANX_CFG(0));
6633+
rvu_write64(rvu, blkaddr, NIX_AF_RX_CHANX_CFG(0), cfg);
6634+
}

0 commit comments

Comments
 (0)