From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9A87C04A95 for ; Sun, 25 Sep 2022 08:10:51 +0000 (UTC) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A5671400D4; Sun, 25 Sep 2022 10:10:50 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id EC43B4003F for ; Sun, 25 Sep 2022 10:10:48 +0200 (CEST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: mbuf pool pointer optimization is obsolete Date: Sun, 25 Sep 2022 10:10:46 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87354@smartserver.smartshare.dk> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: mbuf pool pointer optimization is obsolete Thread-Index: AdjQtlDUAOB5CPJjS36El6F8Xac6AA== From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Olivier Matz" , "Thomas Monjalon" , Cc: "Ferruh Yigit" , "Andrew Rybchenko" 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 Dear Olivier, Thomas and DPDK PMD developers: In November 2020, the pool pointer in the mbuf structure was moved to = the first cache line [1]. [1]: = http://git.dpdk.org/dpdk/commit/lib/librte_mbuf/rte_mbuf_core.h?id=3D4630= 290af46ed44a58515067b6d2add9c044252a That patch also made rte_mbuf_to_baddr() obsolete, but we didn't notice = back then. I think this function should be deprecated and marked for = removal. And its note about the pool pointer being in the 2nd cache line = should be removed. Furthermore, some PMDs still seem to use an alternative pool pointer = (e.g. in the port queue structure) instead of the pool pointer in the = mbuf; possibly inspired by the optimization advice given in the = documentation for rte_mbuf_to_baddr(): "@note: Accessing mempool pointer = of a mbuf is expensive because the pointer is stored in the 2nd cache = line of mbuf. If mempool is known, it is better not to reference the = mempool pointer in mbuf but calling rte_mbuf_buf_addr() would be more = efficient." Since this precondition (i.e. the pool pointer being located in the = mbuf's 2nd cache line) is no longer true, PMD developers should consider = if their design (using an mempool pointer from elsewhere) is still = optimal, or if using the pool pointer in the mbuf structure would be = better. Med venlig hilsen / Kind regards, -Morten Br=F8rup