octeontx2-pf: QOS: Perform cache sync on send queue teardown
authorHariprasad Kelam <hkelam@marvell.com>
Thu, 22 May 2025 09:47:41 +0000 (15:17 +0530)
committerPaolo Abeni <pabeni@redhat.com>
Wed, 28 May 2025 06:41:16 +0000 (08:41 +0200)
QOS is designed to create a new send queue whenever  a class
is created, ensuring proper shaping and scheduling. However,
when multiple send queues are created and deleted in a loop,
SMMU errors are observed.

This patch addresses the issue by performing an data cache sync
during the teardown of QOS send queues.

Fixes: ab6dddd2a669 ("octeontx2-pf: qos send queues management")
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250522094742.1498295-1-hkelam@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c

index c5dbae0..58d572c 100644 (file)
@@ -256,6 +256,26 @@ out:
        return err;
 }
 
+static int otx2_qos_nix_npa_ndc_sync(struct otx2_nic *pfvf)
+{
+       struct ndc_sync_op *req;
+       int rc;
+
+       mutex_lock(&pfvf->mbox.lock);
+
+       req = otx2_mbox_alloc_msg_ndc_sync_op(&pfvf->mbox);
+       if (!req) {
+               mutex_unlock(&pfvf->mbox.lock);
+               return -ENOMEM;
+       }
+
+       req->nix_lf_tx_sync = true;
+       req->npa_lf_sync = true;
+       rc = otx2_sync_mbox_msg(&pfvf->mbox);
+       mutex_unlock(&pfvf->mbox.lock);
+       return rc;
+}
+
 void otx2_qos_disable_sq(struct otx2_nic *pfvf, int qidx)
 {
        struct otx2_qset *qset = &pfvf->qset;
@@ -285,6 +305,8 @@ void otx2_qos_disable_sq(struct otx2_nic *pfvf, int qidx)
 
        otx2_qos_sqb_flush(pfvf, sq_idx);
        otx2_smq_flush(pfvf, otx2_get_smq_idx(pfvf, sq_idx));
+       /* NIX/NPA NDC sync */
+       otx2_qos_nix_npa_ndc_sync(pfvf);
        otx2_cleanup_tx_cqes(pfvf, cq);
 
        mutex_lock(&pfvf->mbox.lock);