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 4242E606A31A for ; Tue, 1 Dec 2026 00:06:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=PNdZaAww Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72F75402B8; Tue, 1 Dec 2026 01:06:20 +0100 (CET) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTPS id C7DF740285 for ; Tue, 1 Dec 2026 01:06:18 +0100 (CET) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2f0414c1062so66167865ad.2 for ; Mon, 30 Nov 2026 16:06:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1796083577; x=1796688377; darn=dpdk.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=qP6LadWMITFjxZ4tM2DYjHaAzbPmdYdAN3Z6+iY3xEw=; b=PNdZaAwwv/JV0aJRPCuPng+bEjDO7jg+IMU6ie1Pd+nw8e6h2tU0+YzarQlV4ptI5C tZ0XSgwFKG2GxhLxPyiNG1LoyvoNAU3tOVfeSM+i026GVTRVrHby/WXDeXPH/XuWvxfP bB+NUOGbcWPzTRWgc5hEf85KGQWZAh/7m1loXl/xy3rwiQI665BVVRpFnTFLdeT2PFll 3VIGd59bY2TUXR2us+axCVbDsPE6MX9r7wxUg/9cgYNHQ58djDfxERKHkRTyJtWyBRWl +AIGDXaR3jr//snw1qapXqRPbC/xhCJgX+EPG/FsRiUfPLiRoQh/9Plwb29myhNehCLX YN/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796083577; x=1796688377; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=qP6LadWMITFjxZ4tM2DYjHaAzbPmdYdAN3Z6+iY3xEw=; b=WX4ouQOfGs29eIkLyfl5JLf/mLf8thYwEgxtWtlzMx9zExTJsegogDilywEorSEmhw JzRHa1TsTwCcpP4LZdIKtZy4l69dAlwWanH8Kg4HuERUIwytMN32aPv3Tj3XI23uRj6a ESE4DGU+/lxjzFFEk3b1gi9pRbsj+K5jLooxKMqbsn0GU0iN2nF11/4DjvcnTIG7IBgN t9JCWCOKx4M8FjhgFKu4pgyMDDdcZ0ZmpwOOE+6k11Z0fiTBTiFq78pEK0Ys+lOpRNZT J95m2JRo52sy95kM6pS/sGfcGdlqx4BznNTqOs02La5s28y/XA6Otk3M1GyoEBKChkWV 64Zw== X-Gm-Message-State: APuU4Z+QddjViZglbc+anX3d7ZHu4xzYBUtZU4BlflsFdiJ6qD40RCk5 Dv2oJQgfAlgdJKO9igDaS5TVViv8Gd27VLAnUDBzQnlbaKCQC5OWYBSGDvgHIf8nenk= X-Gm-Gg: AZFdTZc0fC5BM/hTXg0Hp6S1EzKAQdhMtGV25S8p3nQUqY3ctTYqLAl6HFt/ffH2hhx 5ShUIoaiJbrcghlyQ1SoFbpO0oKAkcB9jXVyolbg0Kxko3SYLn0ST6lsLm3Yqe1zKCS9tTTUN3o bah10tNh29sKKnZP9Q6CDC7a6QU/OJmIi4Z6wmeLFUBjwceeq6n0OjYBCHlCjdAzpd5HNMKPm++ 1NC5WbvxRb+VekM5GiFnapCDlcso7T68pUrE7MD7LCMk9EHUPGJoELSem/IRp4Hhs84j/qvfWv2 gIHgM0LRmzfthbz8JI81NzMtYdan2+PQ/hoXLjJC7Hb5MGt9EbXseQiKfms/QwXCdFSGai0zm1n PpHayM/yK3/Z4Nkqqqij5giRSD6Fj+XiaZaEENExUtzZLccILvuFdPpTYYkfuVsnNIWT2iLpzks tDfJA7Ah1vTBXRWtm96RtqPdWvnfazCJ3ahvPO2Ij2SRsnBIGmqQjmyhArKcM34SXud9UyWbwbs g4WziPyJRtEzQIp74PzwlEMyxw3qxhyZbct2MlVZPpE1pDPlzCt+oOEm3Vmzi+UvpxVV006PsGr 08HLyKLrzWUKWvXQAY71dfYw10Ly+bR+ZXr3GN1HmA9c/KtzVX2vBsTna8yGXhAT4JAwfW/y2gQ x95c514ambuNyoR2a X-Received: by 2002:a17:903:b0e:b0:2ef:f9a6:1e5f with SMTP id d9443c01a7336-2f03f144747mr334154675ad.27.1796083576961; Mon, 30 Nov 2026 16:06:16 -0800 (PST) Received: from phoenix.local (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f0fe7f9d1asm73278475ad.54.2026.11.30.16.06.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 16:06:16 -0800 (PST) Date: Mon, 30 Nov 2026 16:06:14 -0800 From: Stephen Hemminger To: Robert Sanford Cc: dev@dpdk.org, andrew.rybchenko@oktetlabs.ru, mb@smartsharesystems.com, olivier.matz@6wind.com, thomas@monjalon.net, Robert Sanford , stable@dpdk.org Subject: Re: [PATCH v5 2/3] mempool: fix dump of unpopulated pool Message-ID: <20261130160614.7885e568@phoenix.local> In-Reply-To: <20261130205152.7107-3-rsanford2@gmail.com> References: <20261112154342.1484709-1-rsanford2@gmail.com> <20261130205152.7107-1-rsanford2@gmail.com> <20261130205152.7107-3-rsanford2@gmail.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,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 On Mon, 30 Nov 2026 15:51:51 -0500 Robert Sanford wrote: > From: Robert Sanford > > rte_mempool_create_empty() adds a mempool to the mempool list before > the mempool has a store. The store is allocated, and > RTE_MEMPOOL_F_POOL_CREATED is set, by the first populate call. In > between, rte_mempool_dump() queries the mempool driver for the number > of objects in the store. With the ring driver this dereferences a NULL > ring, and the process crashes. rte_mempool_list_dump() calls > rte_mempool_dump() for every mempool on the list, so it crashes when > another thread has created a mempool but not populated it yet. The > telemetry /mempool/info handler has the same problem: its > rte_mempool_walk() callback queries the driver for the same count. > > Add rte_mempool_is_created(), which tests RTE_MEMPOOL_F_POOL_CREATED. > In rte_mempool_dump() and in the telemetry callback, query the mempool > driver only when it returns true, and report a common pool count of 0 > otherwise, since the mempool has no objects yet. The rest of the > mempool information is still reported. In statistics builds, > rte_mempool_dump() also skips rte_mempool_ops_get_info() for such a > mempool. The info is now zeroed first; it was left uninitialized for > drivers without a get_info operation. > > The populating thread sets the flag without holding a lock, so set it > with an atomic fetch-or with release ordering, and test it with an > atomic load with acquire ordering. A reader that sees the flag then > also sees the store. > > rte_mempool_walk() still passes mempools that are not populated yet to > its callback. Document that the callback must check > rte_mempool_is_created() before querying the mempool driver. > > rte_mempool_is_created() is public API because applications need it > too: a callback passed to rte_mempool_walk() must not query the > mempool driver of a mempool that is not created yet, and it has no > other way to check that. The function is trivial and the library > itself uses it, in rte_mempool_dump() and in the telemetry callback, > so it is added directly as stable API, without an experimental stage. > It is not inline, since it is not used in the fast path. > > Fixes: 449c49b93a6b ("mempool: support handler operations") > Fixes: ab8a1cc4e3d8 ("mempool: add object usage counts in telemetry") > Cc: stable@dpdk.org Looks like you are using AI to write code and commits, thats ok. But you need to ask it to be more concise. See: SLOP-MSG here https://github.com/masoncl/review-prompts/blob/main/kernel/slop-indicators.md