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 B15ADA0547; Wed, 15 Jun 2022 21:36:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50AEA427EB; Wed, 15 Jun 2022 21:36:39 +0200 (CEST) Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) by mails.dpdk.org (Postfix) with ESMTP id 229CB410D0 for ; Wed, 15 Jun 2022 21:36:38 +0200 (CEST) Received: by mail-qv1-f53.google.com with SMTP id 63so9769032qva.10 for ; Wed, 15 Jun 2022 12:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YYfYCPGaOMbFwS7AFzBubuP9n4Cf6xYg9b/IjBSSErE=; b=K1IBe+4xYXkVOirXjt5fNUj7gbSKcDtRszEGwgdXNrfmF5neSrY3kRn+bZyrYKo0fY yFmPRIMfQT8A9RQm5ejAN5E6AwNT50gLZsuw2JrwVmuahzVR2XRXo0IM8Y/agBInZYc9 xgI7dg385l1QIVMLU3bh26a1fz0ViQvCamgG9WkTVQrgliHH2Nf22bnD0RriNkrxcl7g jMpTxHpFKyje+MYAx8jP3UfC1I91pdutfup1YGyboOBrptGbnTRYZuG2L+IVD5yAnZl8 vBMhg00+Ph2fh+m/ANN7Zah1MpNCbbtF173yqlDsCEqPHWSwvxou3OgYIbTK9uJZ7K8y CgtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YYfYCPGaOMbFwS7AFzBubuP9n4Cf6xYg9b/IjBSSErE=; b=llSCeGQtsVeYUm0uGKuKC0QFQUKuaFTVcT806vBdxvk4Cb4Tqgt7ExPW/lXHyAsG6J iIcITtebfhL3tI8ZCnD4pOrbpa7ibHvEhu43K9rPqej3KIL9oVcWxSdcbg/CrH9dtAH1 MyfB1mQr9ggTGXOtBOnamHq1fiiMkh+9NxujDBmDmFPhD1r6qjgPdxGLQiMUX2dKNzJn KOjdOqhpSQ/uHHET6foz1CqoNICSDmLdw5+wLTxzXVEPiiuvGkdjofaUxadZlZwosevj TwLMcDedrdr8Julm0sr71Jv3Sv8qdIUBqszxdE8euDsOxQezsI216Qko2SWFhbirRTNq tVHw== X-Gm-Message-State: AJIora+yHOKMw7wQXLyUWwBdAgS4B8xjpjcsMURYgzVIhgok6JQHA7J1 ZXIxZyqAXUtylHGrqPkcTAfPOGT2YJkSaRcHDkI= X-Google-Smtp-Source: AGRyM1t/TrR3+rKo/TJzdRXDGuLJPULlTxvODGkd8mFUQIWTbY6aU0vO3NWDF4GiethDgP3TynMKH5G1I1CvM9f6Ti8= X-Received: by 2002:a05:622a:8d:b0:305:1c58:a837 with SMTP id o13-20020a05622a008d00b003051c58a837mr1088832qtw.410.1655321797341; Wed, 15 Jun 2022 12:36:37 -0700 (PDT) MIME-Version: 1.0 References: <20220610160714.1827115-1-asekhar@marvell.com> In-Reply-To: <20220610160714.1827115-1-asekhar@marvell.com> From: Jerin Jacob Date: Thu, 16 Jun 2022 01:06:11 +0530 Message-ID: Subject: Re: [PATCH] drivers: wait optionally when counting allocated pointers To: Ashwin Sekhar T K Cc: dpdk-dev , Jerin Jacob , Sunil Kumar Kori , Satha Koteswara Rao Kottidi , Pavan Nikhilesh , Kiran Kumar K , Satheesh Paul , Anoob Joseph , Akhil Goyal , Harman Kalra , Nithin Dabilpuram Content-Type: text/plain; charset="UTF-8" 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 On Fri, Jun 10, 2022 at 9:37 PM Ashwin Sekhar T K wrote: > > 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 Applied to dpdk-next-net-mrvl/for-next-net. Thanks > --- > 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 >