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 39B1D43D0E; Wed, 27 Mar 2024 20:46:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16066402C0; Wed, 27 Mar 2024 20:46:01 +0100 (CET) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 963CB402B2 for ; Wed, 27 Mar 2024 20:45:59 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 8866720C86; Wed, 27 Mar 2024 20:45:58 +0100 (CET) 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 v7 1/4] net/i40e: use inline prefetch function Date: Wed, 27 Mar 2024 20:45:56 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F33C@smartserver.smartshare.dk> In-Reply-To: <20240327181439.GA20331@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v7 1/4] net/i40e: use inline prefetch function Thread-Index: AdqAcqMD826CBFWKTQKqMtvc9LBQNQADCyqQ References: <1706657173-26166-1-git-send-email-roretzla@linux.microsoft.com> <1710972098-2209-1-git-send-email-roretzla@linux.microsoft.com> <1710972098-2209-2-git-send-email-roretzla@linux.microsoft.com> <98CBD80474FA8B44BF855DF32C47DC35E9F332@smartserver.smartshare.dk> <20240327181439.GA20331@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Tyler Retzlaff" Cc: , "Yuying Zhang" , "Ajit Khaparde" , "Andrew Boyer" , "Andrew Rybchenko" , "Bruce Richardson" , "Chenbo Xia" , "Chengwen Feng" , "Dariusz Sosnowski" , "David Christensen" , "Hyong Youb Kim" , "Jerin Jacob" , "Jie Hai" , "Jingjing Wu" , "John Daley" , "Kevin Laatz" , "Kiran Kumar K" , "Konstantin Ananyev" , "Maciej Czekaj" , "Matan Azrad" , "Maxime Coquelin" , "Nithin Dabilpuram" , "Ori Kam" , "Ruifeng Wang" , "Satha Rao" , "Somnath Kotur" , "Suanming Mou" , "Sunil Kumar Kori" , "Viacheslav Ovsiienko" , "Yisen Zhuang" 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: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] > Sent: Wednesday, 27 March 2024 19.15 >=20 > On Tue, Mar 26, 2024 at 11:16:10AM +0100, Morten Br=F8rup wrote: > > > From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] > > > Sent: Wednesday, 20 March 2024 23.02 > > > > > > Don't directly access the cacheline1 field in rte_mbuf struct for > > > prefetch instead just use rte_mbuf_prefetch_part2() to prefetch. > > > > > > Signed-off-by: Tyler Retzlaff > > > --- > > > drivers/net/i40e/i40e_rxtx_vec_avx512.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx512.c > > > b/drivers/net/i40e/i40e_rxtx_vec_avx512.c > > > index f3050cd..0238b03 100644 > > > --- a/drivers/net/i40e/i40e_rxtx_vec_avx512.c > > > +++ b/drivers/net/i40e/i40e_rxtx_vec_avx512.c > > > @@ -826,7 +826,7 @@ > > > free[0] =3D m; > > > nb_free =3D 1; > > > for (i =3D 1; i < n; i++) { > > > - rte_prefetch0(&txep[i + 3].mbuf->cacheline1); > > > + rte_mbuf_prefetch_part2(txep[i + 3].mbuf); > > > > @Yuying Zhang: > > If this prefetch is for m->next, I think it can be omitted if = m->next > is in the first cache line: > > > > - rte_prefetch0(&txep[i + 3].mbuf->cacheline1); > > +#if RTE_IOVA_IN_MBUF > > + rte_mbuf_prefetch_part2(txep[i + 3].mbuf); > > +#endif >=20 > Yuying Zhang any reply here to confirm? >=20 > If not I will leave it unconditionally prefetch. I think you should leave it unconditionally prefetch under all = circumstances. An optimization to omit it (if it can be conditionally omitted) belongs = in a separate patch. Also, Intel might want to test and document the = performance improvement of such a patch. >=20 > > > > If so, it belongs in a separate patch anyway. > > > > > m =3D rte_pktmbuf_prefree_seg(txep[i].mbuf); > > > if (likely(m)) { > > > if (likely(m->pool =3D=3D free[0]->pool)) { > > > -- > > > 1.8.3.1 > > > > Reviewed-by: Morten Br=F8rup