DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Liang, Cunming" <cunming.liang@intel.com>
To: "Tao, Zhe" <zhe.tao@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/4 v3] add vector PMD RX for FVL
Date: Fri, 30 Oct 2015 13:40:41 +0000	[thread overview]
Message-ID: <D0158A423229094DA7ABF71CF2FA0DA312D94148@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1446210115-13927-2-git-send-email-zhe.tao@intel.com>

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
> 
> 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 vPMD
> RX,
> because it will decrease the performance heavily.
> 
> Signed-off-by: Zhe Tao <zhe.tao@intel.com>
> ---
>  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
> 

[...]
> +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))
> 
> -#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
> 
>  #define I40E_RXBUF_SZ_1024 1024
>  #define I40E_RXBUF_SZ_2048 2048
> 
> +#undef container_of
> +#define container_of(ptr, type, member) ({ \
> +		typeof(((type *)0)->member)(*__mptr) = (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 = 0,
>  	i40e_header_split_enabled = 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);
> 
> +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_rxtx_vec.c
> new file mode 100644
> index 0000000..a95916b
> --- /dev/null
> +++ b/drivers/net/i40e/i40e_rxtx_vec.c
> @@ -0,0 +1,484 @@
[...]
> +
> +#include <tmmintrin.h>
> +
> +#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 definition.
> +	volatile union i40e_rx_desc *rxdp;
> +	struct i40e_rx_entry *rxep = &rxq->sw_ring[rxq->rxrearm_start];
> +	struct rte_mbuf *mb0, *mb1;
> +	__m128i hdr_room = _mm_set_epi64x(RTE_PKTMBUF_HEADROOM,
> +			RTE_PKTMBUF_HEADROOM);
> +	__m128i dma_addr0, dma_addr1;
> +
[...]
> +
> + /* vPMD receive routine, now only accept (nb_pkts ==
> 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)
> +{
[...]

  reply	other threads:[~2015-10-30 13:40 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-27 17:05 [dpdk-dev] [PATCH 0/4] i40e: add vector PMD support " Zhe Tao
2015-09-27 17:05 ` [dpdk-dev] [PATCH 1/4] add vector PMD RX " Zhe Tao
2015-09-27 23:15   ` Ananyev, Konstantin
     [not found]   ` <2601191342CEEE43887BDE71AB97725836A9CE35@irsmsx105.ger.corp.intel.com>
2015-09-29 13:06     ` [dpdk-dev] FW: " Ananyev, Konstantin
2015-09-29 14:27   ` [dpdk-dev] " Bruce Richardson
2015-09-27 17:05 ` [dpdk-dev] [PATCH 2/4] add vector PMD TX " Zhe Tao
2015-09-27 17:05 ` [dpdk-dev] [PATCH 3/4] add vector PMD scatter RX " Zhe Tao
2015-09-27 17:05 ` [dpdk-dev] [PATCH 4/4] add RX and TX selection function " Zhe Tao
2015-10-30 10:52 ` [dpdk-dev] [PATCH 0/8 v2] i40e: add vector PMD support " Zhe Tao
2015-10-30 10:52   ` [dpdk-dev] [PATCH 1/8 v2] add vector PMD RX " Zhe Tao
2015-10-30 10:52   ` [dpdk-dev] [PATCH 2/8 v2] add vector PMD TX " Zhe Tao
2015-10-30 10:52   ` [dpdk-dev] [PATCH 3/8 v2] add vector PMD scatter RX " Zhe Tao
2015-10-30 10:52   ` [dpdk-dev] [PATCH 4/8 v2] add RX and TX selection function " Zhe Tao
2015-10-30 10:52   ` [dpdk-dev] [PATCH 5/8 v2] edit the comments Zhe Tao
2015-10-30 10:52   ` [dpdk-dev] [PATCH 6/8 v2] change the postion of data prefetch for splitter packets Zhe Tao
2015-10-30 10:52   ` [dpdk-dev] [PATCH 7/8 v2] move all the extra definition out of share code Zhe Tao
2015-10-30 10:52   ` [dpdk-dev] [PATCH 8/8 v2] update the release note Zhe Tao
2015-10-30 13:01   ` [dpdk-dev] [PATCH 0/4 v3] i40e: add vector PMD support for FVL Zhe Tao
2015-10-30 13:01     ` [dpdk-dev] [PATCH 1/4 v3] add vector PMD RX " Zhe Tao
2015-10-30 13:40       ` Liang, Cunming [this message]
2015-10-30 13:01     ` [dpdk-dev] [PATCH 2/4 v3] add vector PMD TX " Zhe Tao
2015-10-30 13:29       ` Liang, Cunming
2015-11-03 21:20       ` Stephen Hemminger
2015-10-30 13:01     ` [dpdk-dev] [PATCH 3/4 v3] add vector PMD scatter RX " Zhe Tao
2015-10-30 13:46       ` Liang, Cunming
2015-10-30 13:01     ` [dpdk-dev] [PATCH 4/4 v3] add RX and TX selection function " Zhe Tao
2015-10-30 14:16     ` [dpdk-dev] [PATCH 0/4 v4] i40e: add vector PMD support " Zhe Tao
2015-10-30 14:16       ` [dpdk-dev] [PATCH 1/4 v4] add vector PMD RX " Zhe Tao
2015-10-30 15:33         ` Thomas Monjalon
2015-10-30 14:16       ` [dpdk-dev] [PATCH 2/4 v4] add vector PMD TX " Zhe Tao
2015-10-30 14:16       ` [dpdk-dev] [PATCH 3/4 v4] add vector PMD scatter RX " Zhe Tao
2015-10-30 14:16       ` [dpdk-dev] [PATCH 4/4 v4] add RX and TX selection function " Zhe Tao
2015-10-30 15:59         ` Thomas Monjalon
2015-10-30 14:24       ` [dpdk-dev] [PATCH 0/4 v4] i40e: add vector PMD support " Liang, Cunming
2015-10-30 15:41         ` Thomas Monjalon
2015-10-30 16:02           ` Thomas Monjalon

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=D0158A423229094DA7ABF71CF2FA0DA312D94148@shsmsx102.ccr.corp.intel.com \
    --to=cunming.liang@intel.com \
    --cc=dev@dpdk.org \
    --cc=zhe.tao@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).