[v1,9/9] net/octeon_ep: set watermark for output queues

Message ID 20230404141855.1025625-10-sedara@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series extend octeon ep driver functionality |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation fail ninja build failure
ci/Intel-compilation fail Compilation issues
ci/intel-Testing success Testing PASS
ci/github-robot: build fail github build: failed
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing fail Testing issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing warning Testing issues
ci/iol-unit-testing fail Testing issues
ci/iol-x86_64-compile-testing fail Testing issues
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Sathesh B Edara April 4, 2023, 2:18 p.m. UTC
  This patch sets the watermark level for SDP
output queues to send backpressure to NIX,
when available Rx buffers fall below watermark.

Signed-off-by: Sathesh Edara <sedara@marvell.com>
---
 drivers/net/octeon_ep/cnxk_ep_vf.c    | 7 ++++++-
 drivers/net/octeon_ep/otx_ep_common.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/octeon_ep/cnxk_ep_vf.c b/drivers/net/octeon_ep/cnxk_ep_vf.c
index 931aac887b..e26060b604 100644
--- a/drivers/net/octeon_ep/cnxk_ep_vf.c
+++ b/drivers/net/octeon_ep/cnxk_ep_vf.c
@@ -243,7 +243,12 @@  cnxk_ep_vf_setup_oq_regs(struct otx_ep_device *otx_ep, uint32_t oq_no)
 	}
 
 	otx_ep_dbg("SDP_R[%d]_sent: %x", oq_no, rte_read32(droq->pkts_sent_reg));
-		return 0;
+
+	/* Set Watermark for backpressure */
+	oct_ep_write64(OTX_EP_OQ_WMARK_MIN,
+		       otx_ep->hw_addr + CNXK_EP_R_OUT_WMARK(oq_no));
+
+	return 0;
 }
 
 static int
diff --git a/drivers/net/octeon_ep/otx_ep_common.h b/drivers/net/octeon_ep/otx_ep_common.h
index 029d013aef..0f189d4570 100644
--- a/drivers/net/octeon_ep/otx_ep_common.h
+++ b/drivers/net/octeon_ep/otx_ep_common.h
@@ -22,6 +22,7 @@ 
 #define OTX_EP_MAX_OQ_DESCRIPTORS   (8192)
 #define OTX_EP_OQ_BUF_SIZE          (2048)
 #define OTX_EP_MIN_RX_BUF_SIZE      (64)
+#define OTX_EP_OQ_WMARK_MIN         (256)
 
 #define OTX_EP_OQ_INFOPTR_MODE      (0)
 #define OTX_EP_OQ_REFIL_THRESHOLD   (16)