From: Amiya Ranjan Mohakud <amiyaranjan.mohakud@gmail.com>
To: dev@dpdk.org
Cc: jerinj@marvell.com, ndabilpuram@marvell.com, stable@dpdk.org,
Amiya Ranjan Mohakud <amiyaranjan.mohakud@gmail.com>
Subject: [PATCH] common/cnxk: add NDC sync after NPA aura pool init
Date: Thu, 10 Sep 2026 00:53:23 +0530 [thread overview]
Message-ID: <20260909192323.26886-1-amiyaranjan.mohakud@gmail.com> (raw)
After AF writes aura/pool contexts via AQ (AURA_INIT +
POOL_INIT), the LF data path reads them through NDC.
Without an explicit NDC sync, the first MMIO aura operation
(e.g. roc_npa_aura_op_free during SQB populate) can hit a
stale NDC entry, causing NPA_LF_ERR_INT[AURA_FAULT] (bit 12).
All teardown paths (npa_aura_pool_fini, npa_aura_fini,
roc_npa_pool_op_pc_reset) already perform NDC sync, but the
init path was missing it.
Add ndc_sync_op with npa_lf_sync after successful aura/pool
init to flush NDC-NPA LF entries before any data-path access. Skip
on CN20K which does not use NDC for NPA.
Fixes: 124ff1a4cbb3 ("common/cnxk: support NPA device")
Cc: stable@dpdk.org
Signed-off-by: Amiya Ranjan Mohakud <amiyaranjan.mohakud@gmail.com>
---
drivers/common/cnxk/roc_npa.c | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/drivers/common/cnxk/roc_npa.c b/drivers/common/cnxk/roc_npa.c
index 4a3e96a97a..6339873638 100644
--- a/drivers/common/cnxk/roc_npa.c
+++ b/drivers/common/cnxk/roc_npa.c
@@ -85,6 +85,7 @@ npa_aura_pool_init(struct mbox *m_box, uint32_t aura_id, struct npa_aura_s *aura
struct npa_aq_enq_req *aura_init_req, *pool_init_req;
struct npa_aq_enq_rsp *aura_init_rsp, *pool_init_rsp;
struct mbox_dev *mdev = &m_box->dev[0];
+ struct ndc_sync_op *ndc_req;
int rc = -ENOSPC, off;
struct mbox *mbox;
@@ -128,10 +129,33 @@ npa_aura_pool_init(struct mbox *m_box, uint32_t aura_id, struct npa_aura_s *aura
off = mbox->rx_start + aura_init_rsp->hdr.next_msgoff;
pool_init_rsp = (struct npa_aq_enq_rsp *)((uintptr_t)mdev->mbase + off);
- if (aura_init_rsp->hdr.rc == 0 && pool_init_rsp->hdr.rc == 0)
+ if (aura_init_rsp->hdr.rc != 0 || pool_init_rsp->hdr.rc != 0) {
+ rc = NPA_ERR_AURA_POOL_INIT;
+ goto exit;
+ }
+
+ /* CN20K does not use NDC for NPA */
+ if (roc_model_is_cn20k()) {
rc = 0;
- else
+ goto exit;
+ }
+
+ /* Sync NDC-NPA for LF to ensure the new aura/pool contexts are
+ * visible to the data path before any MMIO aura operations.
+ */
+ ndc_req = mbox_alloc_msg_ndc_sync_op(mbox);
+ if (ndc_req == NULL) {
+ rc = -ENOSPC;
+ goto exit;
+ }
+ ndc_req->npa_lf_sync = 1;
+ rc = mbox_process(mbox);
+ if (rc) {
+ plt_err("Error on NDC-NPA LF sync after init, rc %d", rc);
rc = NPA_ERR_AURA_POOL_INIT;
+ goto exit;
+ }
+ rc = 0;
exit:
mbox_put(mbox);
return rc;
--
2.39.5 (Apple Git-154)
reply other threads:[~2026-09-09 19:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260909192323.26886-1-amiyaranjan.mohakud@gmail.com \
--to=amiyaranjan.mohakud@gmail.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=stable@dpdk.org \
/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