From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4ECEDA0C58; Tue, 30 Nov 2021 07:09:13 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B6B4D411AE; Tue, 30 Nov 2021 07:09:10 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id E0CEC411CB for ; Tue, 30 Nov 2021 07:09:08 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1AU3fANb017736 for ; Mon, 29 Nov 2021 22:09:08 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=3IS5WPhG+UZr0WAA3vQL5kHl/NVPxgYNygwzkbFVq5g=; b=WYBeqcS9NNHxjVoMvsVPQovgq1xV+4x868OKyaGFQGsb5RZTW4eVwYC//Htd+eUlroGn Jqu1VHtpB9sAYM9TH0qznUBcHxbmZm7BOwdJ3fAYjIZ7sRj/82FenjUySc3GIiLWBsii Zz5oB5bcWGKYLiHesKfL6gL1kcIxl8DDRm0ciPUcLS+h0y3utwbhKN9o49jJ5ljyEURO 464Ut3/qf0xZwSDqdrh0wxA4RicOUrRtQkceyZauTn6NU5h7xFrQBkGBaRSkol8w14Cy W+i1+Or9nH0B1IxahKTt5M1HyP9hIoUzZMtbj6MZsd0EcSsc7mCQyJgHEA0cQC09+qLD pA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3cmtkpmsqr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 29 Nov 2021 22:09:08 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 29 Nov 2021 22:09:05 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Mon, 29 Nov 2021 22:09:06 -0800 Received: from lab-ci-142.marvell.com (unknown [10.28.36.142]) by maili.marvell.com (Postfix) with ESMTP id 17E033F7073; Mon, 29 Nov 2021 22:09:02 -0800 (PST) From: Ashwin Sekhar T K To: CC: , , , , , , , , , Subject: [PATCH 2/3] common/cnxk: wait for sqb pool to fill Date: Tue, 30 Nov 2021 11:37:01 +0530 Message-ID: <20211130060702.2697517-3-asekhar@marvell.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211130060702.2697517-1-asekhar@marvell.com> References: <20211130060702.2697517-1-asekhar@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: bZ6Af05Ba9vwIG0z7F1W4RNHewX07Tz9 X-Proofpoint-ORIG-GUID: bZ6Af05Ba9vwIG0z7F1W4RNHewX07Tz9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-30_05,2021-11-28_01,2020-04-07_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Wait for SQB pool to get filled with the freed pointers before proceeding. Signed-off-by: Ashwin Sekhar T K --- drivers/common/cnxk/roc_nix_queue.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/common/cnxk/roc_nix_queue.c b/drivers/common/cnxk/roc_nix_queue.c index c8c8401d81..c638cd43e4 100644 --- a/drivers/common/cnxk/roc_nix_queue.c +++ b/drivers/common/cnxk/roc_nix_queue.c @@ -638,11 +638,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: -- 2.32.0