DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Xiaoyun Li <xiaoyun.li@intel.com>,
	beilei.xing@intel.com, qi.z.zhang@intel.com
Cc: dev@dpdk.org, zhiyong.yang@intel.com
Subject: Re: [dpdk-dev] [PATCH v5] net/i40e: add interface to choose latest vector path
Date: Thu, 13 Sep 2018 14:27:11 +0100	[thread overview]
Message-ID: <4958c6fd-2c51-0d36-a079-a3c4406a6b68@intel.com> (raw)
In-Reply-To: <20180912101202.37950-1-xiaoyun.li@intel.com>

On 9/12/2018 11:12 AM, Xiaoyun Li wrote:
> Right now, vector path is limited to only use on later platform.

i40e supports vector instructions for intel, arm and powerpc,
this behavior is only for Intel vector drivers, can be good to clarify,
also it can better to explain a little more what "limited to only use on later
platform" means.

> This patch adds a devarg use-latest-vec to allow the users to
> use the latest vector path that the platform supported. Namely,
> using AVX2 vector path on broadwell is possible.

Again, this is for intel only, and can you put a matrix to clarify what is
supported:

no devarg:
Machine		PMD
avx512		avx2
avx2		sse4.2
sse4.2		sse4.2
< sse4.2	not supported

with devarg:
Machine		PMD
avx512		avx2
avx2		avx2
sse4.2		sse4.2
< sse4.2	not supported


And I am not sure about name of the devarg "use-latest-vec", I can see it has
been discussed already.
What about "use-latest-supported-vec"? Too verbose?
Do you have any other suggestion?

<...>

> @@ -163,6 +163,14 @@ Runtime Config Options
>    Currently hot-plugging of representor ports is not supported so all required
>    representors must be specified on the creation of the PF.
>  
> +- ``Use latest vector`` (default ``disable``)
> +
> +  Vector path was limited to use only on later platform. But users may want the
> +  latest vector path. For example, VPP users may want to use AVX2 vector path on HSW/BDW
> +  because it can get better perf. So ``devargs`` parameter ``use-latest-vec`` is
> +  introduced, for example::
> +    -w 84:00.0,use-latest-vec=1

Do we need to name a specific consumer of DPDK on i40e document? Why not say any
application?

> +
>  Driver compilation and testing
>  ------------------------------
>  
> diff --git a/doc/guides/rel_notes/release_18_11.rst b/doc/guides/rel_notes/release_18_11.rst
> index 3ae6b3f58..34af591a2 100644
> --- a/doc/guides/rel_notes/release_18_11.rst
> +++ b/doc/guides/rel_notes/release_18_11.rst
> @@ -54,6 +54,10 @@ New Features
>       Also, make sure to start the actual text at the margin.
>       =========================================================
>  
> +* **Added a devarg to use the latest vector path.**
> +  A new devarg ``use-latest-vec`` was introduced to allow users to choose
> +  the latest vector path that the platform supported. For example, VPP users
> +  can use AVX2 vector path on BDW/HSW to get better performance.

Same, do we need to name a specific consumer of DPDK on release notes?

<...>

> @@ -1201,6 +1203,46 @@ i40e_aq_debug_write_global_register(struct i40e_hw *hw,
>  	return i40e_aq_debug_write_register(hw, reg_addr, reg_val, cmd_details);
>  }
>  
> +static int
> +i40e_parse_latest_vec(struct rte_eth_dev *dev)
> +{
> +	struct i40e_adapter *ad =
> +		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> +	int kvargs_count, use_latest_vec;
> +	struct rte_kvargs *kvlist;
> +
> +	ad->use_latest_vec = false;
> +
> +	if (!dev->device->devargs)
> +		return 0;
> +
> +	kvlist = rte_kvargs_parse(dev->device->devargs->args, valid_keys);
> +	if (!kvlist)
> +		return -EINVAL;

Agree with Qi to prevent rte_kvargs_parse() call for each devarg, in the future.

> +
> +	kvargs_count = rte_kvargs_count(kvlist, ETH_I40E_USE_LATEST_VEC);
> +	if (!kvargs_count) {
> +		rte_kvargs_free(kvlist);
> +		return 0;
> +	}
> +
> +	if (kvargs_count > 1)
> +		PMD_DRV_LOG(WARNING, "More than one argument \"%s\" and only "
> +			    "the first one is used !",
> +			    ETH_I40E_USE_LATEST_VEC);
> +
> +	use_latest_vec = atoi((&kvlist->pairs[0])->value);

Instead of accessing directly kvlist internals, please use rte_kvargs_process()

<...>

> @@ -12527,4 +12570,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_i40e,
>  			      ETH_I40E_FLOATING_VEB_ARG "=1"
>  			      ETH_I40E_FLOATING_VEB_LIST_ARG "=<string>"
>  			      ETH_I40E_QUEUE_NUM_PER_VF_ARG "=1|2|4|8|16"
> -			      ETH_I40E_SUPPORT_MULTI_DRIVER "=1");
> +			      ETH_I40E_SUPPORT_MULTI_DRIVER "=1"
> +			      ETH_I40E_USE_LATEST_VEC "=1");

= 0|1 ?

  parent reply	other threads:[~2018-09-13 13:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30  2:16 [dpdk-dev] [PATCH] " Xiaoyun Li
2018-08-31 11:24 ` [dpdk-dev] [PATCH v2] " Xiaoyun Li
2018-09-04 11:39 ` [dpdk-dev] [PATCH v3] " Xiaoyun Li
2018-09-05 12:21   ` Zhang, Qi Z
2018-09-07  9:23     ` Li, Xiaoyun
2018-09-10 10:17 ` [dpdk-dev] [PATCH v4] " Xiaoyun Li
2018-09-12  7:45   ` Zhang, Qi Z
2018-09-12  7:50     ` Zhang, Qi Z
2018-09-12 10:12 ` [dpdk-dev] [PATCH v5] " Xiaoyun Li
2018-09-13  1:38   ` Zhang, Qi Z
2018-09-13 13:27   ` Ferruh Yigit [this message]
2018-09-17  7:12     ` Li, Xiaoyun
2018-09-17  9:58 ` [dpdk-dev] [PATCH v6] net/i40e: add interface to use latest vec path Xiaoyun Li
2018-09-17 14:14   ` Ferruh Yigit
2018-09-17 14:37     ` Thomas Monjalon
2018-09-18  1:28       ` Li, Xiaoyun
2018-09-18  2:22 ` [dpdk-dev] [PATCH v7] " Xiaoyun Li
2018-09-18 13:01   ` Ferruh Yigit
2018-09-18 13:52     ` Zhang, Qi Z

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=4958c6fd-2c51-0d36-a079-a3c4406a6b68@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=xiaoyun.li@intel.com \
    --cc=zhiyong.yang@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).