DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Morten Brørup" <mb@smartsharesystems.com>,
	"Richardson,  Bruce" <bruce.richardson@intel.com>,
	"Lu, Wenzhuo" <wenzhuo.lu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Wu, Wenjun1" <wenjun1.wu@intel.com>,
	"Matz, Olivier" <olivier.matz@6wind.com>
Subject: RE: [PATCH] net/ice: support IOVA as PA mode
Date: Mon, 12 Dec 2022 13:28:29 +0000	[thread overview]
Message-ID: <DM4PR11MB5994596AA27B4509DA256C22D7E29@DM4PR11MB5994.namprd11.prod.outlook.com> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D87580@smartserver.smartshare.dk>



> -----Original Message-----
> From: Morten Brørup <mb@smartsharesystems.com>
> Sent: Monday, December 12, 2022 4:05 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Cc: dev@dpdk.org; Wu, Wenjun1 <wenjun1.wu@intel.com>; Matz, Olivier
> <olivier.matz@6wind.com>
> Subject: RE: [PATCH] net/ice: support IOVA as PA mode
> 
> > 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>

Thanks, v2 has been submitted to address your comments.

  reply	other threads:[~2022-12-12 13:28 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
2022-12-12 13:28   ` Zhang, Qi Z [this message]
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=DM4PR11MB5994596AA27B4509DA256C22D7E29@DM4PR11MB5994.namprd11.prod.outlook.com \
    --to=qi.z.zhang@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=olivier.matz@6wind.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).