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 22223A034C; Mon, 12 Dec 2022 09:05:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C39934021D; Mon, 12 Dec 2022 09:05:21 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id F1D3F40151 for ; Mon, 12 Dec 2022 09:05:19 +0100 (CET) Content-class: urn:content-classes:message Subject: RE: [PATCH] net/ice: support IOVA as PA mode MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Mon, 12 Dec 2022 09:05:16 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87580@smartserver.smartshare.dk> In-Reply-To: <20221212154501.1303789-1-qi.z.zhang@intel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] net/ice: support IOVA as PA mode Thread-Index: AdkN/BYCnrKY0ayMQuKj9Iz9sKfetAAAVOEA References: <20221212154501.1303789-1-qi.z.zhang@intel.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Qi Zhang" , , Cc: , , 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: Qi Zhang [mailto:qi.z.zhang@intel.com] > Sent: Monday, 12 December 2022 16.45 > Subject: [PATCH] net/ice: support IOVA as PA mode Typo: "IOVA as PA mode" -> "IOVA as VA mode" >=20 > Claim pmd_supports_disable_iova_as_pa. Remove buf_iova access when > RTE_IOVA_AS_PA is not defined. >=20 > The patch simply replace buf_iova with buf_addr at no IOVA as PA mode. Please use "IOVA as VA mode" instead of "no IOVA as PA mode". Also in the other PMD patches. > Some SIMD instructions in data path may be over used, further > optimization is expected. >=20 > Signed-off-by: Qi Zhang > --- [...] > @@ -868,16 +867,12 @@ ice_vtx(volatile struct ice_tx_desc *txdp, >=20 > __m256i desc2_3 =3D > _mm256_set_epi64x > - (hi_qw3, > - pkt[3]->buf_iova + pkt[3]->data_off, > - hi_qw2, > - pkt[2]->buf_iova + pkt[2]->data_off); > + (hi_qw3, _PKT_DATA_OFF_AS_U64(pkt[3]), > + hi_qw2, _PKT_DATA_OFF_AS_U64(pkt[2])); > __m256i desc0_1 =3D > _mm256_set_epi64x > - (hi_qw1, > - pkt[1]->buf_iova + pkt[1]->data_off, > - hi_qw0, > - pkt[0]->buf_iova + pkt[0]->data_off); > + (hi_qw1, _PKT_DATA_OFF_AS_U64(pkt[1]), > + hi_qw0, _PKT_DATA_OFF_AS_U64(pkt[0])); > _mm256_store_si256((void *)(txdp + 2), desc2_3); > _mm256_store_si256((void *)txdp, desc0_1); > } > diff --git a/drivers/net/ice/ice_rxtx_vec_avx512.c > b/drivers/net/ice/ice_rxtx_vec_avx512.c > index 5bfd5152df..e76ba1a245 100644 > --- a/drivers/net/ice/ice_rxtx_vec_avx512.c > +++ b/drivers/net/ice/ice_rxtx_vec_avx512.c > @@ -55,9 +55,13 @@ ice_rxq_rearm(struct ice_rx_queue *rxq) > return; > } > } > - > +#if RTE_IOVA_AS_PA > const __m512i iova_offsets =3D _mm512_set1_epi64 > (offsetof(struct rte_mbuf, buf_iova)); > +#else > + const __m512i iova_offsets =3D _mm512_set1_epi64 > + (offsetof(struct rte_mbuf, buf_addr)); > +#endif > const __m512i headroom =3D _mm512_set1_epi64(RTE_PKTMBUF_HEADROOM); >=20 > #ifndef RTE_LIBRTE_ICE_16BYTE_RX_DESC > @@ -1092,8 +1096,7 @@ ice_vtx1(volatile struct ice_tx_desc *txdp, > if (do_offload) > ice_txd_enable_offload(pkt, &high_qw); >=20 > - __m128i descriptor =3D _mm_set_epi64x(high_qw, > - pkt->buf_iova + pkt->data_off); > + __m128i descriptor =3D _mm_set_epi64x(high_qw, > _PKT_DATA_OFF_AS_U64(pkt)); > _mm_store_si128((__m128i *)txdp, descriptor); > } >=20 > @@ -1132,14 +1135,10 @@ ice_vtx(volatile struct ice_tx_desc *txdp, > struct rte_mbuf **pkt, >=20 > __m512i desc0_3 =3D > _mm512_set_epi64 > - (hi_qw3, > - pkt[3]->buf_iova + pkt[3]->data_off, > - hi_qw2, > - pkt[2]->buf_iova + pkt[2]->data_off, > - hi_qw1, > - pkt[1]->buf_iova + pkt[1]->data_off, > - hi_qw0, > - pkt[0]->buf_iova + pkt[0]->data_off); > + (hi_qw3, _PKT_DATA_OFF_AS_U64(pkt[3]), > + hi_qw2, _PKT_DATA_OFF_AS_U64(pkt[2]), > + hi_qw1, _PKT_DATA_OFF_AS_U64(pkt[1]), > + hi_qw0, _PKT_DATA_OFF_AS_U64(pkt[0])); > _mm512_storeu_si512((void *)txdp, desc0_3); > } >=20 > diff --git a/drivers/net/ice/ice_rxtx_vec_common.h > b/drivers/net/ice/ice_rxtx_vec_common.h > index eec6ea2134..ff530324ba 100644 > --- a/drivers/net/ice/ice_rxtx_vec_common.h > +++ b/drivers/net/ice/ice_rxtx_vec_common.h > @@ -11,6 +11,12 @@ > #pragma GCC diagnostic ignored "-Wcast-qual" > #endif >=20 > +#if RTE_IOVA_AS_PA > +#define _PKT_DATA_OFF_AS_U64(pkt) ((pkt)->buf_iova + (pkt)->data_off) > +#else > +#define _PKT_DATA_OFF_AS_U64(pkt) ((u64)(pkt)->buf_addr + (pkt)- > >data_off) > +#endif > + You should use rte_pktmbuf_iova(m) instead of defining this macro. It = does the same. Excellent, thank you. Acked-by: Morten Br=F8rup