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 B9FA1A0553; Fri, 10 Jun 2022 18:07:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9BB594069C; Fri, 10 Jun 2022 18:07:25 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id E444640689 for ; Fri, 10 Jun 2022 18:07:23 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25A6vZLq008182 for ; Fri, 10 Jun 2022 09:07:22 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=iiWXmXquWtDilbtPz1lQZPka0Q2W4LvGlPu5tfHCPSc=; b=Nw0+QgH0dbC0Hukq+Z8vnygBqnaRq0/XrroIH6tJ206XjnuCdfdu3W/79yLmD+PcP13C ldJtL+DGs1Vb6WEST1XmHy5y53PWsybnM0f1A+Qr/a8DLk/Frq7qPW3oEGkMKz3aGUzH otHyDSNT1cT+ajMuvAwUczsktOhFX5kdG4XVn4NFACQYEC/9x4NaJRWf+fMvE1AbKZgf DpdQqRopDn7yUseC4PYdbMfdQONW/8JycEyNZZy1FqWSFmsszqqNtbMmoFm/WfmQQ2HG aS94A96q+03e0BuQaSe6dcLl1Fcbfb+qxJsjblPfS1+qcKIWxcyPL543F61uzgOOV62P TA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3gm155huhc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 10 Jun 2022 09:07:22 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 10 Jun 2022 09:07:21 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 10 Jun 2022 09:07:20 -0700 Received: from localhost.localdomain (unknown [10.28.36.142]) by maili.marvell.com (Postfix) with ESMTP id 896443F7059; Fri, 10 Jun 2022 09:07:17 -0700 (PDT) From: Ashwin Sekhar T K To: CC: , , , , , , , , , , Subject: [PATCH] drivers: wait optionally when counting allocated pointers Date: Fri, 10 Jun 2022 21:37:14 +0530 Message-ID: <20220610160714.1827115-1-asekhar@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: iDRHPIDrW-DKY-Vn0sFJTwTMGPgaWJ2R X-Proofpoint-ORIG-GUID: iDRHPIDrW-DKY-Vn0sFJTwTMGPgaWJ2R X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-10_06,2022-06-09_02,2022-02-23_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 When counting the batch allocated pointers in cnxk mempool driver, currently it always waits for in-flight batch operations to finish. Add a provision to make this waiting optional. Signed-off-by: Ashwin Sekhar T K --- drivers/common/cnxk/roc_npa.h | 7 +++++-- drivers/mempool/cnxk/cn10k_mempool_ops.c | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/common/cnxk/roc_npa.h b/drivers/common/cnxk/roc_npa.h index 0339876bff..59d13d88a1 100644 --- a/drivers/common/cnxk/roc_npa.h +++ b/drivers/common/cnxk/roc_npa.h @@ -264,7 +264,8 @@ roc_npa_batch_alloc_wait(uint64_t *cache_line) } static inline unsigned int -roc_npa_aura_batch_alloc_count(uint64_t *aligned_buf, unsigned int num) +roc_npa_aura_batch_alloc_count(uint64_t *aligned_buf, unsigned int num, + unsigned int do_wait) { unsigned int count, i; @@ -278,7 +279,9 @@ roc_npa_aura_batch_alloc_count(uint64_t *aligned_buf, unsigned int num) status = (struct npa_batch_alloc_status_s *)&aligned_buf[i]; - roc_npa_batch_alloc_wait(&aligned_buf[i]); + if (do_wait) + roc_npa_batch_alloc_wait(&aligned_buf[i]); + count += status->count; } diff --git a/drivers/mempool/cnxk/cn10k_mempool_ops.c b/drivers/mempool/cnxk/cn10k_mempool_ops.c index a02e01cea0..ba826f0f01 100644 --- a/drivers/mempool/cnxk/cn10k_mempool_ops.c +++ b/drivers/mempool/cnxk/cn10k_mempool_ops.c @@ -177,8 +177,8 @@ cn10k_mempool_get_count(const struct rte_mempool *mp) struct batch_op_mem *mem = &op_data->mem[i]; if (mem->status == BATCH_ALLOC_OP_ISSUED) - count += roc_npa_aura_batch_alloc_count(mem->objs, - BATCH_ALLOC_SZ); + count += roc_npa_aura_batch_alloc_count( + mem->objs, BATCH_ALLOC_SZ, 1); if (mem->status == BATCH_ALLOC_OP_DONE) count += mem->sz; -- 2.25.1