DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jeff Guo <jia.guo@intel.com>
To: "Zhang, Qi Z" <qi.z.zhang@intel.com>,
	"Yang, Qiming" <qiming.yang@intel.com>,
	"Xing, Beilei" <beilei.xing@intel.com>,
	"Zhao1, Wei" <wei.zhao1@intel.com>,
	"Wu, Jingjing" <jingjing.wu@intel.com>
Cc: "Richardson, Bruce" <bruce.richardson@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Zhang, Helin" <helin.zhang@intel.com>,
	"mb@smartsharesystems.com" <mb@smartsharesystems.com>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>,
	"barbette@kth.se" <barbette@kth.se>
Subject: Re: [dpdk-dev] [PATCH v2 3/5] net/ice: maximize vector rx burst for ice
Date: Mon, 31 Aug 2020 13:24:59 +0800	[thread overview]
Message-ID: <772bdc53-08a8-d084-903e-d71991625502@intel.com> (raw)
In-Reply-To: <039ED4275CED7440929022BC67E706115522E229@SHSMSX107.ccr.corp.intel.com>

hi, qi

On 8/31/2020 12:41 PM, Zhang, Qi Z wrote:
>
>> -----Original Message-----
>> From: Guo, Jia <jia.guo@intel.com>
>> Sent: Thursday, August 27, 2020 6:10 PM
>> To: Yang, Qiming <qiming.yang@intel.com>; Xing, Beilei
>> <beilei.xing@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>; Zhang, Qi Z
>> <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
>> Cc: Richardson, Bruce <bruce.richardson@intel.com>; dev@dpdk.org; Guo, Jia
>> <jia.guo@intel.com>; Zhang, Helin <helin.zhang@intel.com>;
>> mb@smartsharesystems.com; Yigit, Ferruh <ferruh.yigit@intel.com>;
>> barbette@kth.se
>> Subject: [PATCH v2 3/5] net/ice: maximize vector rx burst for ice
>>
>> The limitation of burst size in vector rx was removed, since it should retrieve as
>> much received packets as possible. And also the scattered receive path should
>> use a wrapper function to achieve the goal of burst maximizing.
>>
>> Signed-off-by: Jeff Guo <jia.guo@intel.com>
>> ---
>>   drivers/net/ice/ice_rxtx_vec_avx2.c | 11 +------
>> drivers/net/ice/ice_rxtx_vec_sse.c  | 49 ++++++++++++++++++++---------
>>   2 files changed, 35 insertions(+), 25 deletions(-)
>>
>> diff --git a/drivers/net/ice/ice_rxtx_vec_avx2.c
>> b/drivers/net/ice/ice_rxtx_vec_avx2.c
>> index be50677c2..b7e624fda 100644
>> --- a/drivers/net/ice/ice_rxtx_vec_avx2.c
>> +++ b/drivers/net/ice/ice_rxtx_vec_avx2.c
>> @@ -603,10 +603,6 @@ _ice_recv_raw_pkts_vec_avx2(struct ice_rx_queue
>> *rxq, struct rte_mbuf **rx_pkts,
>>   	return received;
>>   }
>>
>> -/**
>> - * Notice:
>> - * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
>> - */
> Actually this is question for all the patches in the patchset.
> Why we remove above comment? I think the patch should only target for the case when nb_pkgs > ICE_VPMD_RX_BURST?
> For small packet number case, nothing changed, right?


This is just for doc clean, for the reason that there are no need to 
duplicate the doc on these layer-by-layer helper functions which are not 
reflect on code.

And yes, there is not changed for small packet number case.


>
>>   uint16_t
>>   ice_recv_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
>>   		       uint16_t nb_pkts)
>> @@ -615,9 +611,7 @@ ice_recv_pkts_vec_avx2(void *rx_queue, struct
>> rte_mbuf **rx_pkts,  }
>>
>>   /**
>> - * vPMD receive routine that reassembles single burst of 32 scattered packets
>> - * Notice:
>> - * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
>> + * vPMD receive routine that reassembles scattered packets
>>    */
>>   static uint16_t
>>   ice_recv_scattered_burst_vec_avx2(void *rx_queue, struct rte_mbuf
>> **rx_pkts, @@ -657,9 +651,6 @@ ice_recv_scattered_burst_vec_avx2(void
>> *rx_queue, struct rte_mbuf **rx_pkts,
>>
>>   /**
>>    * vPMD receive routine that reassembles scattered packets.
>> - * Main receive routine that can handle arbitrary burst sizes
>> - * Notice:
>> - * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
>>    */
>>   uint16_t
>>   ice_recv_scattered_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
>> diff --git a/drivers/net/ice/ice_rxtx_vec_sse.c
>> b/drivers/net/ice/ice_rxtx_vec_sse.c
>> index 382ef31f3..25ae368cc 100644
>> --- a/drivers/net/ice/ice_rxtx_vec_sse.c
>> +++ b/drivers/net/ice/ice_rxtx_vec_sse.c
>> @@ -205,10 +205,11 @@ ice_rx_desc_to_ptype_v(__m128i descs[4], struct
>> rte_mbuf **rx_pkts,  }
>>
>>   /**
>> + * vPMD raw receive routine, only accept(nb_pkts >= ICE_DESCS_PER_LOOP)
>> + *
>>    * Notice:
>>    * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
>> - * - nb_pkts > ICE_VPMD_RX_BURST, only scan ICE_VPMD_RX_BURST
>> - *   numbers of DD bits
>> + * - floor align nb_pkts to a ICE_DESCS_PER_LOOP power-of-two
>>    */
>>   static inline uint16_t
>>   _ice_recv_raw_pkts_vec(struct ice_rx_queue *rxq, struct rte_mbuf **rx_pkts,
>> @@ -264,9 +265,6 @@ _ice_recv_raw_pkts_vec(struct ice_rx_queue *rxq,
>> struct rte_mbuf **rx_pkts,
>>   	const __m128i eop_check = _mm_set_epi64x(0x0000000200000002LL,
>>   						 0x0000000200000002LL);
>>
>> -	/* nb_pkts shall be less equal than ICE_MAX_RX_BURST */
>> -	nb_pkts = RTE_MIN(nb_pkts, ICE_MAX_RX_BURST);
>> -
>>   	/* nb_pkts has to be floor-aligned to ICE_DESCS_PER_LOOP */
>>   	nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, ICE_DESCS_PER_LOOP);
>>
>> @@ -444,8 +442,6 @@ _ice_recv_raw_pkts_vec(struct ice_rx_queue *rxq,
>> struct rte_mbuf **rx_pkts,
>>   /**
>>    * Notice:
>>    * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
>> - * - nb_pkts > ICE_VPMD_RX_BURST, only scan ICE_VPMD_RX_BURST
>> - *   numbers of DD bits
>>    */
>>   uint16_t
>>   ice_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, @@ -454,15
>> +450,12 @@ ice_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
>>   	return _ice_recv_raw_pkts_vec(rx_queue, rx_pkts, nb_pkts, NULL);  }
>>
>> -/* vPMD receive routine that reassembles scattered packets
>> - * Notice:
>> - * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
>> - * - nb_pkts > ICE_VPMD_RX_BURST, only scan ICE_VPMD_RX_BURST
>> - *   numbers of DD bits
>> +/**
>> + * vPMD receive routine that reassembles scattered packets
>>    */
>> -uint16_t
>> -ice_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
>> -			    uint16_t nb_pkts)
>> +static uint16_t
>> +ice_recv_scattered_burst_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
>> +			     uint16_t nb_pkts)
>>   {
>>   	struct ice_rx_queue *rxq = rx_queue;
>>   	uint8_t split_flags[ICE_VPMD_RX_BURST] = {0}; @@ -496,6 +489,32 @@
>> ice_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
>>   					     &split_flags[i]);
>>   }
>>
>> +/**
>> + * vPMD receive routine that reassembles scattered packets.
>> + */
>> +uint16_t
>> +ice_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
>> +			    uint16_t nb_pkts)
>> +{
>> +	uint16_t retval = 0;
>> +
>> +	while (nb_pkts > ICE_VPMD_RX_BURST) {
>> +		uint16_t burst;
>> +
>> +		burst = ice_recv_scattered_burst_vec(rx_queue,
>> +						     rx_pkts + retval,
>> +						     ICE_VPMD_RX_BURST);
>> +		retval += burst;
>> +		nb_pkts -= burst;
>> +		if (burst < ICE_VPMD_RX_BURST)
>> +			return retval;
>> +	}
>> +
>> +	return retval + ice_recv_scattered_burst_vec(rx_queue,
>> +						     rx_pkts + retval,
>> +						     nb_pkts);
>> +}
>> +
>>   static inline void
>>   ice_vtx1(volatile struct ice_tx_desc *txdp, struct rte_mbuf *pkt,
>>   	 uint64_t flags)
>> --
>> 2.20.1

  reply	other threads:[~2020-08-31  5:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-27 10:10 [dpdk-dev] [PATCH v2 0/5] maximize vector rx burst for PMDs Jeff Guo
2020-08-27 10:10 ` [dpdk-dev] [PATCH v2 1/5] net/ixgbe: maximize vector rx burst for ixgbe Jeff Guo
2020-08-27 10:10 ` [dpdk-dev] [PATCH v2 2/5] net/i40e: maximize vector rx burst for i40e Jeff Guo
2020-08-27 10:10 ` [dpdk-dev] [PATCH v2 3/5] net/ice: maximize vector rx burst for ice Jeff Guo
2020-08-31  4:41   ` Zhang, Qi Z
2020-08-31  5:24     ` Jeff Guo [this message]
2020-08-27 10:10 ` [dpdk-dev] [PATCH v2 4/5] net/iavf: maximize vector rx burst for iavf Jeff Guo
2020-08-27 10:10 ` [dpdk-dev] [PATCH v2 5/5] net/fm10k: maximize vector rx burst for fm10k Jeff Guo
2020-08-27 12:38 ` [dpdk-dev] [PATCH v2 0/5] maximize vector rx burst for PMDs Morten Brørup
2020-08-28  2:06   ` Wang, Haiyue
2020-08-28  6:39     ` Jeff Guo
2020-08-28 11:45       ` Morten Brørup
2020-08-28 20:30       ` Stephen Hemminger
2020-08-31 14:27         ` Wang, Haiyue

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=772bdc53-08a8-d084-903e-d71991625502@intel.com \
    --to=jia.guo@intel.com \
    --cc=barbette@kth.se \
    --cc=beilei.xing@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=helin.zhang@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=mb@smartsharesystems.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=wei.zhao1@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).