]> www.infradead.org Git - users/griffoul/linux.git/commitdiff
Octeontx2-af: Broadcast XON on all channels
authorHariprasad Kelam <hkelam@marvell.com>
Wed, 20 Aug 2025 06:46:25 +0000 (12:16 +0530)
committerJakub Kicinski <kuba@kernel.org>
Fri, 22 Aug 2025 01:22:11 +0000 (18:22 -0700)
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 <hkelam@marvell.com>
Link: https://patch.msgid.link/20250820064625.1464361-1-hkelam@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
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

index c6bb3aaa8e0d03be797a45f90d7c5d11fc3e9c1c..2d78e08f985f0c0eea355b2c1f1e686aa074ee25 100644 (file)
@@ -1164,6 +1164,9 @@ cpt:
        rvu_program_channels(rvu);
        cgx_start_linkup(rvu);
 
+       rvu_block_bcast_xon(rvu, BLKADDR_NIX0);
+       rvu_block_bcast_xon(rvu, BLKADDR_NIX1);
+
        err = rvu_mcs_init(rvu);
        if (err) {
                dev_err(rvu->dev, "%s: Failed to initialize mcs\n", __func__);
index 7ee1fdeb5295f371697337e5a7b955e23a5075f4..1692033b46b0e3da2ce75e437742cc02985bb423 100644 (file)
@@ -1017,6 +1017,7 @@ int rvu_nix_mcast_update_mcam_entry(struct rvu *rvu, u16 pcifunc,
 void rvu_nix_flr_free_bpids(struct rvu *rvu, u16 pcifunc);
 int rvu_alloc_cint_qint_mem(struct rvu *rvu, struct rvu_pfvf *pfvf,
                            int blkaddr, int nixlf);
+void rvu_block_bcast_xon(struct rvu *rvu, int blkaddr);
 /* NPC APIs */
 void rvu_npc_freemem(struct rvu *rvu);
 int rvu_npc_get_pkind(struct rvu *rvu, u16 pf);
index 60db1f616cc82f85c3d92c7e304c7a6b3919ff0f..828316211b2454dfe1634a4d6199538c81a27111 100644 (file)
@@ -6616,3 +6616,19 @@ unlock_grp:
 
        return ret;
 }
+
+/* On CN10k and older series of silicons, hardware may incorrectly
+ * assert XOFF on certain channels. Issue a write on NIX_AF_RX_CHANX_CFG
+ * to broadcacst XON on the same.
+ */
+void rvu_block_bcast_xon(struct rvu *rvu, int blkaddr)
+{
+       struct rvu_block *block = &rvu->hw->block[blkaddr];
+       u64 cfg;
+
+       if (!block->implemented || is_cn20k(rvu->pdev))
+               return;
+
+       cfg = rvu_read64(rvu, blkaddr, NIX_AF_RX_CHANX_CFG(0));
+       rvu_write64(rvu, blkaddr, NIX_AF_RX_CHANX_CFG(0), cfg);
+}