]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Octeontx2-af: fix pause frame configuration in GMP mode
authorHariprasad Kelam <hkelam@marvell.com>
Tue, 26 Mar 2024 05:27:20 +0000 (10:57 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Apr 2024 10:59:16 +0000 (12:59 +0200)
[ Upstream commit 40d4b4807cadd83fb3f46cc8cd67a945b5b25461 ]

The Octeontx2 MAC block (CGX) has separate data paths (SMU and GMP) for
different speeds, allowing for efficient data transfer.

The previous patch which added pause frame configuration has a bug due
to which pause frame feature is not working in GMP mode.

This patch fixes the issue by configurating appropriate registers.

Fixes: f7e086e754fe ("octeontx2-af: Pause frame configuration at cgx")
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240326052720.4441-1-hkelam@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/cgx.c

index 55dfe1a20bc99404b090ec35541a9ac7d8e8158e..7f82baf8e7403b673cab22039a0bff384afc79a3 100644 (file)
@@ -403,6 +403,11 @@ int cgx_lmac_set_pause_frm(void *cgxd, int lmac_id,
        if (!cgx || lmac_id >= cgx->lmac_count)
                return -ENODEV;
 
+       cfg = cgx_read(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL);
+       cfg &= ~CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK;
+       cfg |= rx_pause ? CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK : 0x0;
+       cgx_write(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL, cfg);
+
        cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL);
        cfg &= ~CGX_SMUX_RX_FRM_CTL_CTL_BCK;
        cfg |= rx_pause ? CGX_SMUX_RX_FRM_CTL_CTL_BCK : 0x0;