common/cnxk: add NDC sync after NPA aura pool init
PATCH 1/1 common/cnxk: add NDC sync after NPA aura pool init
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.
--- drivers/common/cnxk/roc_npa.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-)
drivers/common/cnxk/roc_npa.c +26 -2
@@ -85,6 +85,7 @@ npa_aura_pool_init(struct mbox *m_box, uint32_t aura_id, struct npa_aura_s *aurastruct 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;
Signature · 1 line
2.39.5 (Apple Git-154)
PATCH 1/1 common/cnxk: add NDC sync after NPA aura pool init
This patch is not required as the issues seen were a side effect of using IOVA as PA mode which is not supported in CNXK platforms.
Refer ticket: https://bugs.dpdk.org/show_bug.cgi?id=2031
Thanks
Ashwin