From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 6D870591F for ; Wed, 5 Aug 2015 08:30:10 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 04 Aug 2015 23:30:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,614,1432623600"; d="scan'208";a="742467025" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by orsmga001.jf.intel.com with ESMTP; 04 Aug 2015 23:30:10 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by PGSMSX101.gar.corp.intel.com (10.221.44.78) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 5 Aug 2015 14:28:09 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.126]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.45]) with mapi id 14.03.0224.002; Wed, 5 Aug 2015 14:28:07 +0800 From: "Liang, Cunming" To: Zoltan Kiss , "dev@dpdk.org" Thread-Topic: [PATCH v3] ixgbe: remove vector pmd burst size restriction Thread-Index: AQHQzqtTDxqi+wKrmkeccygocCa/y537gRSAgAFuENA= Date: Wed, 5 Aug 2015 06:28:07 +0000 Message-ID: References: <1438673558-13284-1-git-send-email-cunming.liang@intel.com> <1438688832-15396-1-git-send-email-cunming.liang@intel.com> <55C0E79F.4030404@linaro.org> In-Reply-To: <55C0E79F.4030404@linaro.org> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 v3] ixgbe: remove vector pmd burst size restriction X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2015 06:30:11 -0000 Hi Zoltan, > -----Original Message----- > From: Zoltan Kiss [mailto:zoltan.kiss@linaro.org] > Sent: Wednesday, August 05, 2015 12:26 AM > To: Liang, Cunming; dev@dpdk.org > Cc: Ananyev, Konstantin > Subject: Re: [PATCH v3] ixgbe: remove vector pmd burst size restriction >=20 >=20 >=20 > On 04/08/15 12:47, Cunming Liang wrote: > > On receive side, the burst size now floor aligns to RTE_IXGBE_DESCS_PER= _LOOP > power of 2. > > According to this rule, the burst size less than 4 still won't receive = anything. > > (Before this change, the burst size less than 32 can't receive anything= .) > > _recv_*_pkts_vec returns no more than 32(RTE_IXGBE_RXQ_REARM_THRESH) > packets. > > > > On transmit side, the max burst size no longer bind with a constant, ho= wever it > still > > require to check the cross tx_rs_thresh violation. > > > > There's no obvious performance drop found on both recv_pkts_vec > > and recv_scattered_pkts_vec on burst size 32. > > > > Signed-off-by: Cunming Liang > > --- > > v3 change: > > - reword the init print log > > > > v2 change: > > - keep max rx burst size in 32 > > - reword some comments > > > > drivers/net/ixgbe/ixgbe_rxtx.c | 4 +++- > > drivers/net/ixgbe/ixgbe_rxtx.h | 5 ++--- > > drivers/net/ixgbe/ixgbe_rxtx_vec.c | 39 > +++++++++++++++++++++----------------- > > 3 files changed, 27 insertions(+), 21 deletions(-) > > > > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_r= xtx.c > > index 91023b9..03eb45d 100644 > > --- a/drivers/net/ixgbe/ixgbe_rxtx.c > > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c > > @@ -4008,7 +4008,9 @@ ixgbe_set_rx_function(struct rte_eth_dev *dev) > > */ > > } else if (adapter->rx_vec_allowed) { > > PMD_INIT_LOG(DEBUG, "Vector rx enabled, please make sure RX " > > - "burst size no less than 32."); > > + "burst size no less than %d (port=3D%d).", > > + RTE_IXGBE_DESCS_PER_LOOP, > > + dev->data->port_id); >=20 > A tab seems to be missing from the indentation, otherwise: >=20 > Reviewed-by: Zoltan Kiss >=20 Thanks for the review. I double checked indentation agian, it looks fine. 1st string line 4x/tab intention + space alignment, the other variable line= s 3x/tab indentation + space alignment. According to the 'coding_style.rst' Indentation section - 'As with all styl= e guideline, code should match style already in use in an existing file.' The style keeps the same as its following condition check. It passes 'check= patch.pl' checking as well. Thanks, /Steve > > > > dev->rx_pkt_burst =3D ixgbe_recv_pkts_vec; > > } else if (adapter->rx_bulk_alloc_allowed) { > > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_r= xtx.h > > index 113682a..b9eca67 100644 > > --- a/drivers/net/ixgbe/ixgbe_rxtx.h > > +++ b/drivers/net/ixgbe/ixgbe_rxtx.h > > @@ -47,9 +47,8 @@ > > (uint64_t) ((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM) > > > > #ifdef RTE_IXGBE_INC_VECTOR > > -#define RTE_IXGBE_VPMD_RX_BURST 32 > > -#define RTE_IXGBE_VPMD_TX_BURST 32 > > -#define RTE_IXGBE_RXQ_REARM_THRESH RTE_IXGBE_VPMD_RX_BURST > > +#define RTE_IXGBE_RXQ_REARM_THRESH 32 > > +#define RTE_IXGBE_MAX_RX_BURST > RTE_IXGBE_RXQ_REARM_THRESH > > #define RTE_IXGBE_TX_MAX_FREE_BUF_SZ 64 > > #endif > > > > diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c > b/drivers/net/ixgbe/ixgbe_rxtx_vec.c > > index cf25a53..2ca0e4c 100644 > > --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c > > +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c > > @@ -245,13 +245,13 @@ desc_to_olflags_v(__m128i descs[4], struct > rte_mbuf **rx_pkts) > > #endif > > > > /* > > - * vPMD receive routine, now only accept (nb_pkts =3D=3D > RTE_IXGBE_VPMD_RX_BURST) > > - * in one loop > > + * vPMD raw receive routine, only accept(nb_pkts >=3D > RTE_IXGBE_DESCS_PER_LOOP) > > * > > * Notice: > > - * - nb_pkts < RTE_IXGBE_VPMD_RX_BURST, just return no packet > > - * - nb_pkts > RTE_IXGBE_VPMD_RX_BURST, only scan > RTE_IXGBE_VPMD_RX_BURST > > + * - nb_pkts < RTE_IXGBE_DESCS_PER_LOOP, just return no packet > > + * - nb_pkts > RTE_IXGBE_MAX_RX_BURST, only scan > RTE_IXGBE_MAX_RX_BURST > > * numbers of DD bit > > + * - floor align nb_pkts to a RTE_IXGBE_DESC_PER_LOOP power-of-two > > * - don't support ol_flags for rss and csum err > > */ > > static inline uint16_t > > @@ -286,8 +286,11 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, > struct rte_mbuf **rx_pkts, > > __m128i dd_check, eop_check; > > #endif /* RTE_NEXT_ABI */ > > > > - if (unlikely(nb_pkts < RTE_IXGBE_VPMD_RX_BURST)) > > - return 0; > > + /* nb_pkts shall be less equal than RTE_IXGBE_MAX_RX_BURST */ > > + nb_pkts =3D RTE_MIN(nb_pkts, RTE_IXGBE_MAX_RX_BURST); > > + > > + /* nb_pkts has to be floor-aligned to RTE_IXGBE_DESCS_PER_LOOP */ > > + nb_pkts =3D RTE_ALIGN_FLOOR(nb_pkts, RTE_IXGBE_DESCS_PER_LOOP); > > > > /* Just the act of getting into the function from the application is > > * going to cost about 7 cycles */ > > @@ -356,7 +359,7 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, > struct rte_mbuf **rx_pkts, > > * D. fill info. from desc to mbuf > > */ > > #endif /* RTE_NEXT_ABI */ > > - for (pos =3D 0, nb_pkts_recd =3D 0; pos < RTE_IXGBE_VPMD_RX_BURST; > > + for (pos =3D 0, nb_pkts_recd =3D 0; pos < nb_pkts; > > pos +=3D RTE_IXGBE_DESCS_PER_LOOP, > > rxdp +=3D RTE_IXGBE_DESCS_PER_LOOP) { > > #ifdef RTE_NEXT_ABI > > @@ -518,13 +521,13 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, > struct rte_mbuf **rx_pkts, > > } > > > > /* > > - * vPMD receive routine, now only accept (nb_pkts =3D=3D > RTE_IXGBE_VPMD_RX_BURST) > > - * in one loop > > + * vPMD receive routine, only accept(nb_pkts >=3D > RTE_IXGBE_DESCS_PER_LOOP) > > * > > * Notice: > > - * - nb_pkts < RTE_IXGBE_VPMD_RX_BURST, just return no packet > > - * - nb_pkts > RTE_IXGBE_VPMD_RX_BURST, only scan > RTE_IXGBE_VPMD_RX_BURST > > + * - nb_pkts < RTE_IXGBE_DESCS_PER_LOOP, just return no packet > > + * - nb_pkts > RTE_IXGBE_MAX_RX_BURST, only scan > RTE_IXGBE_MAX_RX_BURST > > * numbers of DD bit > > + * - floor align nb_pkts to a RTE_IXGBE_DESC_PER_LOOP power-of-two > > * - don't support ol_flags for rss and csum err > > */ > > uint16_t > > @@ -538,12 +541,11 @@ static inline uint16_t > > reassemble_packets(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_b= ufs, > > uint16_t nb_bufs, uint8_t *split_flags) > > { > > - struct rte_mbuf *pkts[RTE_IXGBE_VPMD_RX_BURST]; /*finished pkts*/ > > + struct rte_mbuf *pkts[nb_bufs]; /*finished pkts*/ > > struct rte_mbuf *start =3D rxq->pkt_first_seg; > > struct rte_mbuf *end =3D rxq->pkt_last_seg; > > unsigned pkt_idx, buf_idx; > > > > - > > for (buf_idx =3D 0, pkt_idx =3D 0; buf_idx < nb_bufs; buf_idx++) { > > if (end !=3D NULL) { > > /* processing a split packet */ > > @@ -603,14 +605,17 @@ reassemble_packets(struct ixgbe_rx_queue *rxq, > struct rte_mbuf **rx_bufs, > > * > > * Notice: > > * - don't support ol_flags for rss and csum err > > - * - now only accept (nb_pkts =3D=3D RTE_IXGBE_VPMD_RX_BURST) > > + * - nb_pkts < RTE_IXGBE_DESCS_PER_LOOP, just return no packet > > + * - nb_pkts > RTE_IXGBE_MAX_RX_BURST, only scan > RTE_IXGBE_MAX_RX_BURST > > + * numbers of DD bit > > + * - floor align nb_pkts to a RTE_IXGBE_DESC_PER_LOOP power-of-two > > */ > > uint16_t > > ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pk= ts, > > uint16_t nb_pkts) > > { > > struct ixgbe_rx_queue *rxq =3D rx_queue; > > - uint8_t split_flags[RTE_IXGBE_VPMD_RX_BURST] =3D {0}; > > + uint8_t split_flags[RTE_IXGBE_MAX_RX_BURST] =3D {0}; > > > > /* get some new buffers */ > > uint16_t nb_bufs =3D _recv_raw_pkts_vec(rxq, rx_pkts, nb_pkts, > > @@ -735,8 +740,8 @@ ixgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf > **tx_pkts, > > uint64_t rs =3D IXGBE_ADVTXD_DCMD_RS|DCMD_DTYP_FLAGS; > > int i; > > > > - if (unlikely(nb_pkts > RTE_IXGBE_VPMD_TX_BURST)) > > - nb_pkts =3D RTE_IXGBE_VPMD_TX_BURST; > > + /* cross rx_thresh boundary is not allowed */ > > + nb_pkts =3D RTE_MIN(nb_pkts, txq->tx_rs_thresh); > > > > if (txq->nb_tx_free < txq->tx_free_thresh) > > ixgbe_tx_free_bufs(txq); > >