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 CC3CFA00C5; Sun, 3 Jul 2022 09:31:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6323E40E50; Sun, 3 Jul 2022 09:31:04 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id CC14D40685 for ; Sun, 3 Jul 2022 09:31:02 +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: RE: [PATCH] mbuf: add mbuf physical address field to dynamic field Date: Sun, 3 Jul 2022 09:31:01 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D871A4@smartserver.smartshare.dk> In-Reply-To: <20220701122434.1887783-1-sthotton@marvell.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] mbuf: add mbuf physical address field to dynamic field Thread-Index: AdiNRYx/OBDCKEhYRBC2qjkpq5FCFwBZtZEw References: <20220630094538.5b27d0c6@hermes.local> <20220701122434.1887783-1-sthotton@marvell.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Shijith Thotton" , , "Bruce Richardson" , Cc: , , , "Honnappa Nagarahalli" 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: Shijith Thotton [mailto:sthotton@marvell.com] > Sent: Friday, 1 July 2022 14.25 >=20 > >> If all devices are configured to run in IOVA mode as VA, physical > >> address field of mbuf (buf_iova) won't be used. Will some of the hardware vendors please comment on this: Has IOVA VA = mode become common over time, or is it still an exotic bleeding edge = feature? If it has become common, we should let DPDK evolve accordingly, and = consider PA (non-VA) mode legacy, treating it as such. Don't get stuck = in the past. > >> In such cases, > buf_iova > >> space is free to use as a dynamic field. So a new dynamic field > member > >> (dynfield2) is added in mbuf structure to make use of that space. > >> > >> A new mbuf flag RTE_MBUF_F_DYNFIELD2 is introduced to help identify > the > >> mbuf that can use dynfield2. > >> > >> Signed-off-by: Shijith Thotton > > > > This seems like a complex and potentially error prone way to do = this. Perhaps this optimization should be a compile time option instead? > > What is the use case? > > >=20 > PCI drivers with the flag RTE_PCI_DRV_NEED_IOVA_AS_VA only works in > IOVA mode as > VA. buf_iova field of mbuf is not used by those PMDs and can be used = as > a > dynamic area to save space. >=20 > > How much of a performance gain? >=20 > No change in performance. Freeing up 8 bytes in the first mbuf cache line is a major improvement! This could provide a significant performance gain for some applications, = by moving private/dynamic mbuf fields from the second to the first cache = line, thus avoiding to write to the second cache line in the = application's first pipeline stage.