From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06F12606A328 for ; Fri, 6 Nov 2026 08:43:53 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5662240297; Fri, 6 Nov 2026 09:43:51 +0100 (CET) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTPS id 3B0C44026A; Fri, 6 Nov 2026 09:43:50 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id E910D2384F; Fri, 6 Nov 2026 09:43:48 +0100 (CET) Content-class: urn:content-classes:message Subject: RE: [PATCH v2 2/3] mempool: fix dump of unpopulated pool X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Fri, 6 Nov 2026 09:43:47 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35F65AFD@smartserver.smartshare.dk> In-Reply-To: <20261103173543.130142-3-rsanford2@gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v2 2/3] mempool: fix dump of unpopulated pool Thread-Index: Ad1rudNVJey6fvaaQEC4EtuPaHv6ygCCR/uA References: <20261103011107.3658840-1-rsanford2@gmail.com> <20261103173543.130142-1-rsanford2@gmail.com> <20261103173543.130142-3-rsanford2@gmail.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Robert Sanford" , Cc: , , "Robert Sanford" , X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Good progress, Robert. One more change requested, see comments inline below. > +/* > + * Check whether the mempool driver has allocated its store. Mempools > are on > + * the mempool list before that, so rte_mempool_dump() and > rte_mempool_walk() > + * callbacks can find them while another thread populates them. > + * Acquire: pairs with the release in mempool_ops_alloc_once(). > + */ > +static bool > +mempool_is_created(const struct rte_mempool *mp) > +{ > + return (rte_atomic_load_explicit( > + (const RTE_ATOMIC(unsigned int) *)&mp->flags, > + rte_memory_order_acquire) & > + RTE_MEMPOOL_F_POOL_CREATED) !=3D 0; > +} mempool_is_created() should be public as rte_mempool_is_created(). Then the rte_mempool_walk() description can refer to it instead of = referring to the RTE_MEMPOOL_F_POOL_CREATED flag. The "Acquire:" comment is an implementation detail; when you make the = function public, move that comment away from the function description = and into the implementation instead. About the function name: When the empty mempool is created, it is assigned the "ring" driver as = default. Until the pool has been populated, it may be assigned a different = mempool driver, e.g. the "stack" driver. I suppose this is why the flag is named CREATED and not POPULATED. And thus, the name rte_mempool_is_created() remains correct, rather than = using a different name. You may consider this information, if you choose to update the function = description. Notes: Although the function is short and simple, it is not fast path, so it = should remain non-inline. You already made it non-inline, so I'm just making sure you keep it that = way. :-) It is used by mempool dump, so I don't think it can be marked = experimental. [...] > * The mempool list is locked while the iterator function runs, so = the > * iterator function must not create or free a mempool. > * > + * The iterator function is also called for mempools that are not > + * populated yet, which do not have RTE_MEMPOOL_F_POOL_CREATED set in > + * their flags. Such a mempool has no store yet, so the iterator > function > + * must check this flag before calling functions that query the Remember referring to the new rte_mempool_is_created() function in this = description. > mempool > + * driver, such as rte_mempool_avail_count(). > + * > * @param func > * Iterator function > * @param arg With the suggested change, Acked-by: Morten Br=F8rup