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 259F1440B6; Fri, 24 May 2024 14:20:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E67BD402BF; Fri, 24 May 2024 14:20:17 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 8A45240271 for ; Fri, 24 May 2024 14:20:16 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 6126F2035F; Fri, 24 May 2024 14:20:16 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH v11 2/6] mempool: add functions to get extra mempool info X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Fri, 24 May 2024 14:20:14 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F495@smartserver.smartshare.dk> In-Reply-To: <20240524083651.482541-3-paul.szczepanek@arm.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v11 2/6] mempool: add functions to get extra mempool info Thread-Index: AdqttZNkeWx2+eQbQ0Sos/ec8v37fAAHGFPQ References: <20230927150854.3670391-2-paul.szczepanek@arm.com> <20240524083651.482541-1-paul.szczepanek@arm.com> <20240524083651.482541-3-paul.szczepanek@arm.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Paul Szczepanek" , Cc: "Jack Bond-Preston" , "Yoan Picchi" , "Nathan Brown" 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 > From: Paul Szczepanek [mailto:paul.szczepanek@arm.com] > Sent: Friday, 24 May 2024 10.37 >=20 > +size_t rte_mempool_get_obj_alignment(struct rte_mempool *mp) > +{ > + if (mp =3D=3D NULL) > + return 0; > + > + if (mp->flags & RTE_MEMPOOL_F_NO_CACHE_ALIGN) > + return sizeof(uint64_t); > + else > + return RTE_MEMPOOL_ALIGN; > +} The object alignment depends on the underlying mempool driver. You = cannot assume that it is either sizeof(uint64_t) or cache line aligned. Refer to the calc_mem_size driver operation, which also provides object = alignment information: https://elixir.bootlin.com/dpdk/v24.03/source/lib/mempool/rte_mempool.h#L= 529 If you need this function, you need to add a new driver operation, and = your function above can be the default for this operation, like for the = the calc_mem_size driver operation: https://elixir.bootlin.com/dpdk/v24.03/source/lib/mempool/rte_mempool_ops= .c#L120