]> git.droids-corp.org - dpdk.git/commitdiff
common/cnxk: wait for SQB pool to fill
authorAshwin Sekhar T K <asekhar@marvell.com>
Tue, 30 Nov 2021 06:07:01 +0000 (11:37 +0530)
committerJerin Jacob <jerinj@marvell.com>
Mon, 10 Jan 2022 07:15:43 +0000 (08:15 +0100)
Wait for SQB pool to get filled with the freed pointers
before proceeding.

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/common/cnxk/roc_nix_queue.c

index d5f6813e699cc2c2e67910dd91390774bc6017fd..bd63e091a9eac8c63bfab06aed09335b15644ef9 100644 (file)
@@ -653,11 +653,21 @@ sqb_pool_populate(struct roc_nix *roc_nix, struct roc_nix_sq *sq)
                roc_npa_aura_op_free(sq->aura_handle, 0, iova);
                iova += blk_sz;
        }
+
+       if (roc_npa_aura_op_available_wait(sq->aura_handle, NIX_MAX_SQB, 0) !=
+           NIX_MAX_SQB) {
+               plt_err("Failed to free all pointers to the pool");
+               rc = NIX_ERR_NO_MEM;
+               goto npa_fail;
+       }
+
        roc_npa_aura_op_range_set(sq->aura_handle, (uint64_t)sq->sqe_mem, iova);
        roc_npa_aura_limit_modify(sq->aura_handle, sq->nb_sqb_bufs);
        sq->aura_sqb_bufs = NIX_MAX_SQB;
 
        return rc;
+npa_fail:
+       plt_free(sq->sqe_mem);
 nomem:
        roc_npa_pool_destroy(sq->aura_handle);
 fail: