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 8D9208DB4 for ; Fri, 30 Oct 2015 14:40:45 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 30 Oct 2015 06:40:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,218,1444719600"; d="scan'208";a="839310301" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 30 Oct 2015 06:40:45 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 30 Oct 2015 06:40:44 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 30 Oct 2015 06:40:43 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.253]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.47]) with mapi id 14.03.0248.002; Fri, 30 Oct 2015 21:40:42 +0800 From: "Liang, Cunming" To: "Tao, Zhe" , "dev@dpdk.org" Thread-Topic: [dpdk-dev][PATCH 1/4 v3] add vector PMD RX for FVL Thread-Index: AQHRExM1sZJLhI4AY06AwfeQv8dYZ56EB+Ig Date: Fri, 30 Oct 2015 13:40:41 +0000 Message-ID: References: <1446202336-8723-1-git-send-email-zhe.tao@intel.com> <1446210115-13927-1-git-send-email-zhe.tao@intel.com> <1446210115-13927-2-git-send-email-zhe.tao@intel.com> In-Reply-To: <1446210115-13927-2-git-send-email-zhe.tao@intel.com> 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 1/4 v3] add vector PMD RX for FVL 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: Fri, 30 Oct 2015 13:40:46 -0000 Hi, > -----Original Message----- > From: Tao, Zhe > Sent: Friday, October 30, 2015 9:02 PM > To: dev@dpdk.org > Cc: Tao, Zhe; Liang, Cunming > Subject: [dpdk-dev][PATCH 1/4 v3] add vector PMD RX for FVL >=20 > The vPMD RX function uses the multi-buffer and SSE instructions to > accelerate the RX speed, but now the pktype cannot be supported by the vP= MD > RX, > because it will decrease the performance heavily. >=20 > Signed-off-by: Zhe Tao > --- > config/common_bsdapp | 2 + > config/common_linuxapp | 2 + > drivers/net/i40e/Makefile | 1 + > drivers/net/i40e/i40e_rxtx.c | 28 ++- > drivers/net/i40e/i40e_rxtx.h | 28 ++- > drivers/net/i40e/i40e_rxtx_vec.c | 484 > +++++++++++++++++++++++++++++++++++++++ > 6 files changed, 540 insertions(+), 5 deletions(-) > create mode 100644 drivers/net/i40e/i40e_rxtx_vec.c >=20 [...] > +void __attribute__((weak)) > +i40e_rx_queue_release_mbufs_vec(struct i40e_rx_queue __rte_unused*rxq) > +{ > + return; > +} > diff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h > index 4385142..961a415 100644 > --- a/drivers/net/i40e/i40e_rxtx.h > +++ b/drivers/net/i40e/i40e_rxtx.h > @@ -44,13 +44,27 @@ > #define I40E_TX_FLAG_INSERT_VLAN ((uint32_t)(1 << 1)) > #define I40E_TX_FLAG_TSYN ((uint32_t)(1 << 2)) >=20 > -#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC > #define RTE_PMD_I40E_RX_MAX_BURST 32 > -#endif > +#define RTE_PMD_I40E_TX_MAX_BURST 32 > + > +#define RTE_I40E_VPMD_RX_BURST 32 > +#define RTE_I40E_VPMD_TX_BURST 32 > +#define RTE_I40E_RXQ_REARM_THRESH 32 > +#define RTE_I40E_MAX_RX_BURST RTE_I40E_RXQ_REARM_THRESH > +#define RTE_I40E_TX_MAX_FREE_BUF_SZ 64 > +#define RTE_I40E_DESCS_PER_LOOP 4 >=20 > #define I40E_RXBUF_SZ_1024 1024 > #define I40E_RXBUF_SZ_2048 2048 >=20 > +#undef container_of > +#define container_of(ptr, type, member) ({ \ > + typeof(((type *)0)->member)(*__mptr) =3D (ptr); \ > + (type *)((char *)__mptr - offsetof(type, member)); }) > + > +#define I40E_TD_CMD (I40E_TX_DESC_CMD_ICRC |\ > + I40E_TX_DESC_CMD_EOP) > + > enum i40e_header_split_mode { > i40e_header_split_none =3D 0, > i40e_header_split_enabled =3D 1, > @@ -100,6 +114,11 @@ struct i40e_rx_queue { > struct rte_mbuf fake_mbuf; /**< dummy mbuf */ > struct rte_mbuf *rx_stage[RTE_PMD_I40E_RX_MAX_BURST * 2]; > #endif > + > + uint16_t rxrearm_nb; /**< number of remaining to be re-armed */ > + uint16_t rxrearm_start; /**< the idx we start the re-arming from */ > + uint64_t mbuf_initializer; /**< value to init mbufs */ > + > uint8_t port_id; /**< device port ID */ > uint8_t crc_len; /**< 0 if CRC stripped, 4 otherwise */ > uint16_t queue_id; /**< RX queue index */ > @@ -210,4 +229,9 @@ uint32_t i40e_dev_rx_queue_count(struct rte_eth_dev > *dev, > uint16_t rx_queue_id); > int i40e_dev_rx_descriptor_done(void *rx_queue, uint16_t offset); >=20 > +uint16_t i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, > + uint16_t nb_pkts); > +int i40e_rxq_vec_setup(struct i40e_rx_queue *rxq); > +void i40e_rx_queue_release_mbufs_vec(struct i40e_rx_queue *rxq); > + > #endif /* _I40E_RXTX_H_ */ > diff --git a/drivers/net/i40e/i40e_rxtx_vec.c b/drivers/net/i40e/i40e_rxt= x_vec.c > new file mode 100644 > index 0000000..a95916b > --- /dev/null > +++ b/drivers/net/i40e/i40e_rxtx_vec.c > @@ -0,0 +1,484 @@ [...] > + > +#include > + > +#ifndef __INTEL_COMPILER > +#pragma GCC diagnostic ignored "-Wcast-qual" > +#endif > + > +static inline void > +i40e_rxq_rearm(struct i40e_rx_queue *rxq) > +{ > + int i; > + uint16_t rx_id; > + Tiny typo, not necessary to reserve a blank line between these two definiti= on. > + volatile union i40e_rx_desc *rxdp; > + struct i40e_rx_entry *rxep =3D &rxq->sw_ring[rxq->rxrearm_start]; > + struct rte_mbuf *mb0, *mb1; > + __m128i hdr_room =3D _mm_set_epi64x(RTE_PKTMBUF_HEADROOM, > + RTE_PKTMBUF_HEADROOM); > + __m128i dma_addr0, dma_addr1; > + [...] > + > + /* vPMD receive routine, now only accept (nb_pkts =3D=3D > RTE_I40E_VPMD_RX_BURST) > + * in one loop > + * > + * Notice: > + * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet > + * - nb_pkts > RTE_I40E_VPMD_RX_BURST, only scan > RTE_I40E_VPMD_RX_BURST > + * numbers of DD bits > + Remove the blank line. > + */ > +static inline uint16_t > +_recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts, > + uint16_t nb_pkts, uint8_t *split_packet) > +{ [...]