From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Qi Zhang" <qi.z.zhang@intel.com>, <bruce.richardson@intel.com>,
<wenzhuo.lu@intel.com>
Cc: <dev@dpdk.org>, <wenjun1.wu@intel.com>, <olivier.matz@6wind.com>
Subject: RE: [PATCH] net/ice: support IOVA as PA mode
Date: Mon, 12 Dec 2022 09:05:16 +0100 [thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87580@smartserver.smartshare.dk> (raw)
In-Reply-To: <20221212154501.1303789-1-qi.z.zhang@intel.com>
> 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"
>
> Claim pmd_supports_disable_iova_as_pa. Remove buf_iova access when
> RTE_IOVA_AS_PA is not defined.
>
> 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.
>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
[...]
> @@ -868,16 +867,12 @@ ice_vtx(volatile struct ice_tx_desc *txdp,
>
> __m256i desc2_3 =
> _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 =
> _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 = _mm512_set1_epi64
> (offsetof(struct rte_mbuf, buf_iova));
> +#else
> + const __m512i iova_offsets = _mm512_set1_epi64
> + (offsetof(struct rte_mbuf, buf_addr));
> +#endif
> const __m512i headroom = _mm512_set1_epi64(RTE_PKTMBUF_HEADROOM);
>
> #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);
>
> - __m128i descriptor = _mm_set_epi64x(high_qw,
> - pkt->buf_iova + pkt->data_off);
> + __m128i descriptor = _mm_set_epi64x(high_qw,
> _PKT_DATA_OFF_AS_U64(pkt));
> _mm_store_si128((__m128i *)txdp, descriptor);
> }
>
> @@ -1132,14 +1135,10 @@ ice_vtx(volatile struct ice_tx_desc *txdp,
> struct rte_mbuf **pkt,
>
> __m512i desc0_3 =
> _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);
> }
>
> 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
>
> +#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ørup <mb@smartsharesystems.com>
next prev parent reply other threads:[~2022-12-12 8:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-12 15:45 Qi Zhang
2022-12-12 8:05 ` Morten Brørup [this message]
2022-12-12 13:28 ` Zhang, Qi Z
2022-12-12 21:36 ` [PATCH v2] net/ice: support IOVA as VA mode Qi Zhang
2022-12-12 13:27 ` Zhang, Qi Z
2023-01-29 12:42 ` Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=98CBD80474FA8B44BF855DF32C47DC35D87580@smartserver.smartshare.dk \
--to=mb@smartsharesystems.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=olivier.matz@6wind.com \
--cc=qi.z.zhang@intel.com \
--cc=wenjun1.wu@intel.com \
--cc=wenzhuo.lu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).