octeontx2-af: Quiesce traffic before NIX block reset
authorHariprasad Kelam <hkelam@marvell.com>
Fri, 22 Nov 2024 16:20:35 +0000 (21:50 +0530)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 26 Nov 2024 11:09:41 +0000 (12:09 +0100)
commit762ca6eed026346d9d41ed5ac633083c4f1e5071
tree00975249badbed50a9f7c8abcaa691684da3a982
parent6fc2164108462b913a1290fa2c44054c70b060ef
octeontx2-af: Quiesce traffic before NIX block reset

During initialization, the AF driver resets all blocks. The RPM (MAC)
block and NIX block operate on a credit-based model. When the NIX block
resets during active traffic flow, it doesn't release credits to the RPM
block. This causes the RPM FIFO to overflow, leading to receive traffic
struck.

To address this issue, the patch introduces the following changes:
1. Stop receiving traffic at the MAC level during AF driver
   initialization.
2. Perform an X2P reset (prevents RXFIFO of all LMACS from pushing data)
3. Reset the NIX block.
4. Clear the X2P reset and re-enable receiving traffic.

Fixes: 54d557815e15 ("octeontx2-af: Reset all RVU blocks")
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/marvell/octeontx2/af/cgx.c
drivers/net/ethernet/marvell/octeontx2/af/cgx.h
drivers/net/ethernet/marvell/octeontx2/af/lmac_common.h
drivers/net/ethernet/marvell/octeontx2/af/rpm.c
drivers/net/ethernet/marvell/octeontx2/af/rpm.h
drivers/net/ethernet/marvell/octeontx2/af/rvu.c
drivers/net/ethernet/marvell/octeontx2/af/rvu.h
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c