From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0F88FA04AB; Mon, 31 Aug 2020 07:25:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 25534137D; Mon, 31 Aug 2020 07:25:09 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 146A6CF3 for ; Mon, 31 Aug 2020 07:25:04 +0200 (CEST) IronPort-SDR: Nk9d03bNoyhXwLO9UnHC5H3wTLi/tadSDYCDxlWJkU85bce+83pMuqi/Ssd39T5phblLMNw1cw hJI/lx7/HBDA== X-IronPort-AV: E=McAfee;i="6000,8403,9729"; a="136445640" X-IronPort-AV: E=Sophos;i="5.76,374,1592895600"; d="scan'208";a="136445640" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2020 22:25:03 -0700 IronPort-SDR: KPtaNf3KQ72klse+FjgHnlPm3wxo/bMjbERY+B0Yt4j0kZ1pdmNPUI7cS8uJ0HWZQNWYaYElu+ 6CleUwtb4aog== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,374,1592895600"; d="scan'208";a="476586212" Received: from jguo15x-mobl.ccr.corp.intel.com (HELO [10.67.68.171]) ([10.67.68.171]) by orsmga005.jf.intel.com with ESMTP; 30 Aug 2020 22:25:00 -0700 To: "Zhang, Qi Z" , "Yang, Qiming" , "Xing, Beilei" , "Zhao1, Wei" , "Wu, Jingjing" Cc: "Richardson, Bruce" , "dev@dpdk.org" , "Zhang, Helin" , "mb@smartsharesystems.com" , "Yigit, Ferruh" , "barbette@kth.se" References: <20200827101008.76906-1-jia.guo@intel.com> <20200827101008.76906-4-jia.guo@intel.com> <039ED4275CED7440929022BC67E706115522E229@SHSMSX107.ccr.corp.intel.com> From: Jeff Guo Message-ID: <772bdc53-08a8-d084-903e-d71991625502@intel.com> Date: Mon, 31 Aug 2020 13:24:59 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <039ED4275CED7440929022BC67E706115522E229@SHSMSX107.ccr.corp.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH v2 3/5] net/ice: maximize vector rx burst for ice X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" hi, qi On 8/31/2020 12:41 PM, Zhang, Qi Z wrote: > >> -----Original Message----- >> From: Guo, Jia >> Sent: Thursday, August 27, 2020 6:10 PM >> To: Yang, Qiming ; Xing, Beilei >> ; Zhao1, Wei ; Zhang, Qi Z >> ; Wu, Jingjing >> Cc: Richardson, Bruce ; dev@dpdk.org; Guo, Jia >> ; Zhang, Helin ; >> mb@smartsharesystems.com; Yigit, Ferruh ; >> 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 >> --- >> 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