DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ashwin Sekhar T K <asekhar@marvell.com>
To: <dev@dpdk.org>
Cc: <ndabilpuram@marvell.com>, <jerinj@marvell.com>,
	<skori@marvell.com>, <skoteshwar@marvell.com>,
	<pbhagavatula@marvell.com>, <kirankumark@marvell.com>,
	<psatheesh@marvell.com>, <asekhar@marvell.com>,
	<anoobj@marvell.com>, <gakhil@marvell.com>
Subject: [PATCH 3/3] common/cnxk: wait for xaq pool to fill
Date: Tue, 30 Nov 2021 11:37:02 +0530	[thread overview]
Message-ID: <20211130060702.2697517-4-asekhar@marvell.com> (raw)
In-Reply-To: <20211130060702.2697517-1-asekhar@marvell.com>

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(+)

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:
-- 
2.32.0


  parent reply	other threads:[~2021-11-30  6:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30  6:06 [PATCH 0/3] Wait for NPA pools to get filled Ashwin Sekhar T K
2021-11-30  6:07 ` [PATCH 1/3] common/cnxk: add support to wait for pool filling Ashwin Sekhar T K
2021-11-30  6:07 ` [PATCH 2/3] common/cnxk: wait for sqb pool to fill Ashwin Sekhar T K
2021-11-30  6:07 ` Ashwin Sekhar T K [this message]
2022-01-10  7:15 ` [PATCH 0/3] Wait for NPA pools to get filled Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211130060702.2697517-4-asekhar@marvell.com \
    --to=asekhar@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=pbhagavatula@marvell.com \
    --cc=psatheesh@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).