DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Leyi Rong <leyi.rong@intel.com>,
	wenzhuo.lu@intel.com, qi.z.zhang@intel.com,
	xiaolong.ye@intel.com
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v4] net/iavf: enable AVX2 for iavf
Date: Mon, 30 Sep 2019 14:08:32 +0100	[thread overview]
Message-ID: <f9309c7e-ccdc-5d16-fef4-9ff5c98b0b6a@intel.com> (raw)
In-Reply-To: <20190923060257.86135-1-leyi.rong@intel.com>

On 9/23/2019 7:02 AM, Leyi Rong wrote:
> This patch enables AVX data path for iavf PMD.
> 
> Signed-off-by: Leyi Rong <leyi.rong@intel.com>

<...>

> @@ -1741,26 +1720,43 @@ iavf_set_rx_function(struct rte_eth_dev *dev)
>  {
>  	struct iavf_adapter *adapter =
>  		IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> +#ifdef RTE_ARCH_X86
>  	struct iavf_rx_queue *rxq;
>  	int i;
> +	bool use_avx2 = false;
>  
> -	if (adapter->rx_vec_allowed) {
> -		if (dev->data->scattered_rx) {
> -			PMD_DRV_LOG(DEBUG, "Using Vector Scattered Rx callback"
> -				    " (port=%d).", dev->data->port_id);
> -			dev->rx_pkt_burst = iavf_recv_scattered_pkts_vec;
> -		} else {
> -			PMD_DRV_LOG(DEBUG, "Using Vector Rx callback"
> -				    " (port=%d).", dev->data->port_id);
> -			dev->rx_pkt_burst = iavf_recv_pkts_vec;
> -		}
> +	if (!iavf_rx_vec_dev_check(dev)) {
>  		for (i = 0; i < dev->data->nb_rx_queues; i++) {
>  			rxq = dev->data->rx_queues[i];
> -			if (!rxq)
> -				continue;
> -			iavf_rxq_vec_setup(rxq);
> +			(void)iavf_rxq_vec_setup(rxq);
>  		}
> -	} else if (dev->data->scattered_rx) {
> +
> +		if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
> +		    rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1)
> +			use_avx2 = true;
> +
> +		if (dev->data->scattered_rx) {
> +			PMD_DRV_LOG(DEBUG,
> +				    "Using %sVector Scattered Rx (port %d).",
> +				    use_avx2 ? "avx2 " : "",
> +				    dev->data->port_id);
> +			dev->rx_pkt_burst = use_avx2 ?
> +					    iavf_recv_scattered_pkts_vec_avx2 :
> +					    iavf_recv_scattered_pkts_vec;

Hi Leyi,

Will this build if config option 'CONFIG_RTE_LIBRTE_IAVF_INC_VECTOR' is disabled?
And indeed why not eliminate 'CONFIG_RTE_LIBRTE_IAVF_INC_VECTOR' at all? Please
check ice for the sample.

And another thing is to remove the __rte_weak, for the consistency, since it has
been removed from the i40e.

  parent reply	other threads:[~2019-09-30 13:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04 10:06 [dpdk-dev] [PATCH] " Leyi Rong
2019-09-04 13:29 ` Aaron Conole
2019-09-06  3:28 ` [dpdk-dev] [PATCH v2] " Leyi Rong
2019-09-19  8:44 ` [dpdk-dev] [PATCH v3] " Leyi Rong
2019-09-19 12:55   ` Zhang, Qi Z
2019-09-23  6:02 ` [dpdk-dev] [PATCH v4] " Leyi Rong
2019-09-23  6:49   ` Zhang, Qi Z
2019-09-30  9:47   ` Ye Xiaolong
2019-09-30 13:08   ` Ferruh Yigit [this message]
2019-10-16  8:14 ` [dpdk-dev] [PATCH v5] " Leyi Rong
2019-10-20  1:12   ` Ye Xiaolong

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=f9309c7e-ccdc-5d16-fef4-9ff5c98b0b6a@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=leyi.rong@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=wenzhuo.lu@intel.com \
    --cc=xiaolong.ye@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).