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 B9C8AA04AB; Mon, 31 Aug 2020 06:42:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1B33BCF3; Mon, 31 Aug 2020 06:42:29 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 5BDE4255 for ; Mon, 31 Aug 2020 06:42:27 +0200 (CEST) IronPort-SDR: xzxZXbVwlLrl28Sf6M2F39xp15GhKPEhN6h817XuU3AkKOZA3BftC6xFJeb7PMxcTDUpmW8bwh LjKBXmPxZxRQ== X-IronPort-AV: E=McAfee;i="6000,8403,9729"; a="221147168" X-IronPort-AV: E=Sophos;i="5.76,374,1592895600"; d="scan'208";a="221147168" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2020 21:42:26 -0700 IronPort-SDR: F0BnmTcEGUnwsS9siTjdKtSJnpbw5Kdo7qSR3XGDF1TjFd45ObN+OfI3py2oUpvs+sF0PwcCXE IbPf3T/W8kKw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,374,1592895600"; d="scan'208";a="282976765" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga008.fm.intel.com with ESMTP; 30 Aug 2020 21:42:25 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 30 Aug 2020 21:41:35 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 30 Aug 2020 21:41:35 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 30 Aug 2020 21:41:34 -0700 Received: from shsmsx107.ccr.corp.intel.com ([169.254.9.141]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.115]) with mapi id 14.03.0439.000; Mon, 31 Aug 2020 12:41:31 +0800 From: "Zhang, Qi Z" To: "Guo, Jia" , "Yang, Qiming" , "Xing, Beilei" , "Zhao1, Wei" , "Wu, Jingjing" CC: "Richardson, Bruce" , "dev@dpdk.org" , "Zhang, Helin" , "mb@smartsharesystems.com" , "Yigit, Ferruh" , "barbette@kth.se" Thread-Topic: [PATCH v2 3/5] net/ice: maximize vector rx burst for ice Thread-Index: AQHWfFqyP+G2EnwwSU6ysJxhieYOA6lRp+LA Date: Mon, 31 Aug 2020 04:41:31 +0000 Message-ID: <039ED4275CED7440929022BC67E706115522E229@SHSMSX107.ccr.corp.intel.com> References: <20200827101008.76906-1-jia.guo@intel.com> <20200827101008.76906-4-jia.guo@intel.com> In-Reply-To: <20200827101008.76906-4-jia.guo@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.5.1.3 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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" > -----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, Ji= a > ; Zhang, Helin ; > mb@smartsharesystems.com; Yigit, Ferruh ; > barbette@kth.se > Subject: [PATCH v2 3/5] net/ice: maximize vector rx burst for ice >=20 > The limitation of burst size in vector rx was removed, since it should re= trieve as > much received packets as possible. And also the scattered receive path sh= ould > use a wrapper function to achieve the goal of burst maximizing. >=20 > 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(-) >=20 > 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; > } >=20 > -/** > - * 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 c= ase when nb_pkgs > ICE_VPMD_RX_BURST? For small packet number case, nothing changed, right? > 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, } >=20 > /** > - * vPMD receive routine that reassembles single burst of 32 scattered pa= ckets > - * 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, >=20 > /** > * 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_pk= ts, > 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, } >=20 > /** > + * vPMD raw receive routine, only accept(nb_pkts >=3D 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_pk= ts, > @@ -264,9 +265,6 @@ _ice_recv_raw_pkts_vec(struct ice_rx_queue *rxq, > struct rte_mbuf **rx_pkts, > const __m128i eop_check =3D _mm_set_epi64x(0x0000000200000002LL, > 0x0000000200000002LL); >=20 > - /* nb_pkts shall be less equal than ICE_MAX_RX_BURST */ > - nb_pkts =3D RTE_MIN(nb_pkts, ICE_MAX_RX_BURST); > - > /* nb_pkts has to be floor-aligned to ICE_DESCS_PER_LOOP */ > nb_pkts =3D RTE_ALIGN_FLOOR(nb_pkts, ICE_DESCS_PER_LOOP); >=20 > @@ -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); } >=20 > -/* 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 =3D rx_queue; > uint8_t split_flags[ICE_VPMD_RX_BURST] =3D {0}; @@ -496,6 +489,32 @@ > ice_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, > &split_flags[i]); > } >=20 > +/** > + * 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 =3D 0; > + > + while (nb_pkts > ICE_VPMD_RX_BURST) { > + uint16_t burst; > + > + burst =3D ice_recv_scattered_burst_vec(rx_queue, > + rx_pkts + retval, > + ICE_VPMD_RX_BURST); > + retval +=3D burst; > + nb_pkts -=3D 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