[3/3] common/cnxk: wait for xaq pool to fill

Message ID 20211130060702.2697517-4-asekhar@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series Wait for NPA pools to get filled |

Checks

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

Commit Message

Ashwin Sekhar T K Nov. 30, 2021, 6:07 a.m. UTC
  Wait for XAQ pool to get filled with the freed pointers
before proceeding.

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
---
 drivers/common/cnxk/roc_sso.c | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Patch

diff --git a/drivers/common/cnxk/roc_sso.c b/drivers/common/cnxk/roc_sso.c
index 45ff16ca0e..c1aa3324be 100644
--- a/drivers/common/cnxk/roc_sso.c
+++ b/drivers/common/cnxk/roc_sso.c
@@ -453,6 +453,13 @@  sso_hwgrp_init_xaq_aura(struct dev *dev, struct roc_sso_xaq_data *xaq,
 	}
 	roc_npa_aura_op_range_set(xaq->aura_handle, (uint64_t)xaq->mem, iova);
 
+	if (roc_npa_aura_op_available_wait(xaq->aura_handle, xaq->nb_xaq, 0) !=
+	    xaq->nb_xaq) {
+		plt_err("Failed to free all pointers to the pool");
+		rc = -ENOMEM;
+		goto npa_fill_fail;
+	}
+
 	/* When SW does addwork (enqueue) check if there is space in XAQ by
 	 * comparing fc_addr above against the xaq_lmt calculated below.
 	 * There should be a minimum headroom of 7 XAQs per HWGRP for SSO
@@ -461,6 +468,8 @@  sso_hwgrp_init_xaq_aura(struct dev *dev, struct roc_sso_xaq_data *xaq,
 	xaq->xaq_lmt = xaq->nb_xaq - (nb_hwgrp * SSO_XAQ_CACHE_CNT);
 
 	return 0;
+npa_fill_fail:
+	roc_npa_pool_destroy(xaq->aura_handle);
 npa_fail:
 	plt_free(xaq->mem);
 free_fc: