patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Xueming(Steven) Li" <xuemingl@nvidia.com>
To: "Min Hu (Connor)" <humin29@huawei.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Cc: "ferruh.yigit@intel.com" <ferruh.yigit@intel.com>
Subject: Re: [dpdk-stable] [PATCH 20.11 4/4] net/hns3: fix verification of NEON support
Date: Tue, 18 May 2021 04:27:11 +0000	[thread overview]
Message-ID: <BY5PR12MB4324117BFC70CC523FB9C1F6A12C9@BY5PR12MB4324.namprd12.prod.outlook.com> (raw)
In-Reply-To: <1621259445-5182-4-git-send-email-humin29@huawei.com>

Thanks, merged!

> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Monday, May 17, 2021 9:51 PM
> To: stable@dpdk.org
> Cc: ferruh.yigit@intel.com; Xueming(Steven) Li <xuemingl@nvidia.com>
> Subject: [PATCH 20.11 4/4] net/hns3: fix verification of NEON support
> 
> From: Chengwen Feng <fengchengwen@huawei.com>
> 
> [ upstream commit e40ad6fca467b8671c7dfa7435b602997f5358e1 ]
> 
> This patch adds verification of whether NEON supported.
> 
> Fixes: a3d4f4d291d7 ("net/hns3: support NEON Rx")
> Fixes: e31f123db06b ("net/hns3: support NEON Tx")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>  drivers/net/hns3/hns3_rxtx.c | 27 +++++++++++++++++++++------
>  1 file changed, 21 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index 896567c..7a7d6ff 100644
> --- a/drivers/net/hns3/hns3_rxtx.c
> +++ b/drivers/net/hns3/hns3_rxtx.c
> @@ -10,7 +10,7 @@
>  #include <rte_io.h>
>  #include <rte_net.h>
>  #include <rte_malloc.h>
> -#if defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_SVE)
> +#if defined(RTE_ARCH_ARM64)
>  #include <rte_cpuflags.h>
>  #endif
> 
> @@ -2483,6 +2483,16 @@ hns3_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,  }
> 
>  static bool
> +hns3_get_default_vec_support(void)
> +{
> +#if defined(RTE_ARCH_ARM64)
> +	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_NEON))
> +		return true;
> +#endif
> +	return false;
> +}
> +
> +static bool
>  hns3_check_sve_support(void)
>  {
>  #if defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_SVE) @@ -2498,9 +2508,12 @@ hns3_get_rx_function(struct
> rte_eth_dev *dev)
>  	struct hns3_adapter *hns = dev->data->dev_private;
>  	uint64_t offloads = dev->data->dev_conf.rxmode.offloads;
> 
> -	if (hns->rx_vec_allowed && hns3_rx_check_vec_support(dev) == 0)
> -		return hns3_check_sve_support() ? hns3_recv_pkts_vec_sve :
> -		       hns3_recv_pkts_vec;
> +	if (hns->rx_vec_allowed && hns3_rx_check_vec_support(dev) == 0) {
> +		if (hns3_get_default_vec_support())
> +			return hns3_recv_pkts_vec;
> +		else if (hns3_check_sve_support())
> +			return hns3_recv_pkts_vec_sve;
> +	}
> 
>  	if (hns->rx_simple_allowed && !dev->data->scattered_rx &&
>  	    (offloads & DEV_RX_OFFLOAD_TCP_LRO) == 0) @@ -3734,8 +3747,10 @@ hns3_get_tx_function(struct rte_eth_dev *dev,
> eth_tx_prep_t *prep)
> 
>  	if (hns->tx_vec_allowed && hns3_tx_check_vec_support(dev) == 0) {
>  		*prep = NULL;
> -		return hns3_check_sve_support() ? hns3_xmit_pkts_vec_sve :
> -			hns3_xmit_pkts_vec;
> +		if (hns3_get_default_vec_support())
> +			return hns3_xmit_pkts_vec;
> +		else if (hns3_check_sve_support())
> +			return hns3_xmit_pkts_vec_sve;
>  	}
> 
>  	if (hns->tx_simple_allowed &&
> --
> 2.7.4


  reply	other threads:[~2021-05-18  4:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 13:50 [dpdk-stable] [PATCH 20.11 1/4] net/hns3: fix possible mismatched response of mailbox Min Hu (Connor)
2021-05-17 13:50 ` [dpdk-stable] [PATCH 20.11 2/4] net/hns3: fix VF handling LSC event in secondary process Min Hu (Connor)
2021-05-18  4:15   ` Xueming(Steven) Li
2021-05-17 13:50 ` [dpdk-stable] [PATCH 20.11 3/4] net/hns3: fix timing in mailbox Min Hu (Connor)
2021-05-18  4:27   ` Xueming(Steven) Li
2021-05-17 13:50 ` [dpdk-stable] [PATCH 20.11 4/4] net/hns3: fix verification of NEON support Min Hu (Connor)
2021-05-18  4:27   ` Xueming(Steven) Li [this message]
2021-05-18  4:14 ` [dpdk-stable] [PATCH 20.11 1/4] net/hns3: fix possible mismatched response of mailbox Xueming(Steven) Li

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=BY5PR12MB4324117BFC70CC523FB9C1F6A12C9@BY5PR12MB4324.namprd12.prod.outlook.com \
    --to=xuemingl@nvidia.com \
    --cc=ferruh.yigit@intel.com \
    --cc=humin29@huawei.com \
    --cc=stable@dpdk.org \
    /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).