DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xing, Beilei" <beilei.xing@intel.com>
To: "Rybalchenko, Kirill" <kirill.rybalchenko@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Chilikin, Andrey" <andrey.chilikin@intel.com>,
	"Wu, Jingjing" <jingjing.wu@intel.com>
Subject: Re: [dpdk-dev] [PATCH v3 5/6] app/testpmd: add new commands to manipulate with pctype mapping
Date: Mon, 25 Sep 2017 11:54:19 +0000	[thread overview]
Message-ID: <94479800C636CB44BD422CB454846E01320373B6@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1505917983-119112-6-git-send-email-kirill.rybalchenko@intel.com>



> -----Original Message-----
> From: Rybalchenko, Kirill
> Sent: Wednesday, September 20, 2017 10:33 PM
> To: dev@dpdk.org
> Cc: Rybalchenko, Kirill <kirill.rybalchenko@intel.com>; Chilikin, Andrey
> <andrey.chilikin@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>
> Subject: [PATCH v3 5/6] app/testpmd: add new commands to manipulate
> with pctype mapping
> 
> Add new commands to manipulate with dynamic flow type to pctype
> mapping table in i40e PMD.
> Commands allow to print table, modify it and reset to default value.
> 
> v3:
> changed command syntax from 'pctype mapping...' to 'port config pctype
> mapping...' and 'show port pctype mapping'
> 
> Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
> ---
>  app/test-pmd/cmdline.c                      | 335
> +++++++++++++++++++++++++++-
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  46 ++++
>  drivers/net/i40e/rte_pmd_i40e_version.map   |   2 +-
>  3 files changed, 372 insertions(+), 11 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> 4f2d731..4f68267 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c

<snip>

> +
> +/* show port pctype mapping get */
> +
> +/* Common result structure for show port pctype mapping get */ struct

show port pctype mapping get  ->   show port pctype mapping ?

> +cmd_pctype_mapping_get_result {
> +	cmdline_fixed_string_t show;
> +	cmdline_fixed_string_t port;
> +	uint8_t port_id;
> +	cmdline_fixed_string_t pctype;
> +	cmdline_fixed_string_t mapping;
> +};
> +
> +/* Common CLI fields for pctype mapping get */

"get" should be removed.

> +cmdline_parse_token_string_t cmd_pctype_mapping_get_show =
> +	TOKEN_STRING_INITIALIZER
> +		(struct cmd_pctype_mapping_get_result,
> +		 show, "show");
> +cmdline_parse_token_string_t cmd_pctype_mapping_get_port =
> +	TOKEN_STRING_INITIALIZER
> +		(struct cmd_pctype_mapping_get_result,
> +		 port, "port");
> +cmdline_parse_token_num_t cmd_pctype_mapping_get_port_id =
> +	TOKEN_NUM_INITIALIZER
> +		(struct cmd_pctype_mapping_get_result,
> +		 port_id, UINT8);
> +cmdline_parse_token_string_t cmd_pctype_mapping_get_pctype =
> +	TOKEN_STRING_INITIALIZER
> +		(struct cmd_pctype_mapping_get_result,
> +		 pctype, "pctype");
> +cmdline_parse_token_string_t cmd_pctype_mapping_get_mapping =
> +	TOKEN_STRING_INITIALIZER
> +		(struct cmd_pctype_mapping_get_result,
> +		 mapping, "mapping");
> +
> +static void
> +cmd_pctype_mapping_get_parsed(
> +	void *parsed_result,
> +	__attribute__((unused)) struct cmdline *cl,
> +	__attribute__((unused)) void *data)
> +{
> +	struct cmd_pctype_mapping_get_result *res = parsed_result;
> +	int ret = -ENOTSUP;
> +#ifdef RTE_LIBRTE_I40E_PMD
> +	struct rte_pmd_i40e_flow_type_mapping
> mapping[RTE_PMD_I40E_FLOW_TYPE_MAX];
> +	int i, j;
> +#endif
> +
> +	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
> +		return;
> +
> +#ifdef RTE_LIBRTE_I40E_PMD
> +	ret = rte_pmd_i40e_flow_type_mapping_get(res->port_id,
> mapping);
> +#endif
> +
> +	switch (ret) {
> +	case 0:
> +		break;
> +	case -ENODEV:
> +		printf("invalid port_id %d\n", res->port_id);
> +		return;
> +	case -ENOTSUP:
> +		printf("function not implemented\n");
> +		return;
> +	default:
> +		printf("programming error: (%s)\n", strerror(-ret));
> +		return;
> +	}
> +
> +#ifdef RTE_LIBRTE_I40E_PMD
> +	for (i = 0; i < RTE_PMD_I40E_FLOW_TYPE_MAX; i++) {
> +		if (mapping[i].pctype != 0ULL) {
> +			int first_pctype = 1;
> +

first_pctype should be moved to the beginning of the function.

> +			printf("pctype: ");
> +			for (j = 0; j < RTE_PMD_I40E_PCTYPE_MAX; j++) {
> +				if (mapping[i].pctype & (1ULL << j)) {
> +					printf(first_pctype ? "%02d" : ",%02d",
> j);
> +					first_pctype = 0;
> +				}
> +			}
> +			printf("  ->  flowtype: %02d\n",
> mapping[i].flow_type);
> +		}
> +	}
> +#endif
> +}
> +

<snip>


> +static void
> +cmd_pctype_mapping_update_parsed(
> +	void *parsed_result,
> +	__attribute__((unused)) struct cmdline *cl,
> +	__attribute__((unused)) void *data)
> +{
> +	struct cmd_pctype_mapping_update_result *res = parsed_result;
> +	int ret = -ENOTSUP;
> +#ifdef RTE_LIBRTE_I40E_PMD
> +	struct rte_pmd_i40e_flow_type_mapping mapping; #endif
> +	unsigned int nb_item, i;

Should "i" be defined when RTE_LIBRTE_I40E_PMD is defined? otherwise 
it will be defined but not used when RTE_LIBRTE_I40E_PMD is not defined.

> +	unsigned int pctype_list[RTE_PMD_I40E_PCTYPE_MAX];
> +
> +	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
> +		return;
> +
> +	nb_item = parse_item_list(res->pctype_list, "pctypes",
> RTE_PMD_I40E_PCTYPE_MAX,
> +				  pctype_list, 1);
> +
> +
> +#ifdef RTE_LIBRTE_I40E_PMD
> +	mapping.flow_type = res->flow_type;
> +	for (i = 0, mapping.pctype = 0ULL; i < nb_item; i++)
> +		mapping.pctype |= (1ULL << pctype_list[i]);
> +	ret = rte_pmd_i40e_flow_type_mapping_update(res->port_id,
> +						&mapping,
> +						1,
> +						0);
> +#endif
> +

<snip>

> diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> index 2ed62f5..2911fe1 100644
> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> @@ -408,6 +408,14 @@ Reset VF statistics::
> 
>     testpmd> clear vf stats (port_id) (vf_id)
> 
> +show port pctype mapping
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Length of  the wave line should be the same as length of " show port pctype mapping "?

> +
> +List all items from the pctype mapping table::
> +
> +   testpmd> show port (port_id) pctype mapping get

"get" should be removed.

> +
> +
>  Configuration Functions
>  -----------------------
> 
> @@ -1310,6 +1318,27 @@ Reset ptype mapping table::
> 
>     testpmd> ptype mapping reset (port_id)

port config <port_id> pctype mapping reset?

> 
> +pctype mapping
> +~~~~~~~~~~~~~

I think all about " pctype mapping " can be removed as you use "port config pctype mapping", right?

> +
> +List all items from the pctype mapping table::
> +
> +   testpmd> pctype mapping get (port_id)
> +
> +Update hardware defined pctype to software defined flow type mapping
> table::
> +
> +   testpmd> pctype mapping update (port_id)
> + (pctype_id_0[,pctype_id_1]*) (flow_type_d)
> +
> +where:
> +
> +* ``pctype_id_x``: hardware pctype id as index of bit in bitmask value of the
> pctype mapping table.
> +
> +* ``flow_type_id``: software flow type id as the index of the pctype
> mapping table.
> +
> +Reset pctype mapping table::
> +
> +   testpmd> pctype mapping reset (port_id)
> +
>  Port Functions
>  --------------
> 
> @@ -1697,6 +1726,23 @@ Enable/disable the E-tag support::
> 
>     testpmd> port config (port_id|all) l2-tunnel E-tag (enable|disable)
> 
> +port config pctype mapping
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Pay attention to the length of the wave line.

> +
> +Reset pctype mapping table::
> +
> +   testpmd> port config (port_id) pctype mapping reset
> +
> +Update hardware defined pctype to software defined flow type mapping
> table::
> +
> +   testpmd> port config (port_id) pctype mapping update
> + (pctype_id_0[,pctype_id_1]*) (flow_type_id)
> +
> +where:
> +
> +* ``pctype_id_x``: hardware pctype id as index of bit in bitmask value of the
> pctype mapping table.
> +
> +* ``flow_type_id``: software flow type id as the index of the pctype
> mapping table.
> +
> 
>  Link Bonding Functions
>  ----------------------
> diff --git a/drivers/net/i40e/rte_pmd_i40e_version.map
> b/drivers/net/i40e/rte_pmd_i40e_version.map
> index 438ca81..9292454 100644
> --- a/drivers/net/i40e/rte_pmd_i40e_version.map
> +++ b/drivers/net/i40e/rte_pmd_i40e_version.map
> @@ -52,6 +52,6 @@ DPDK_17.11 {
>  	rte_pmd_i40e_add_vf_mac_addr;
>  	rte_pmd_i40e_flow_type_mapping_update;
>  	rte_pmd_i40e_flow_type_mapping_get;
> -	rte_pmd_i40e_flow_type_mapping_get;
> +	rte_pmd_i40e_flow_type_mapping_reset;

It should be fixed in patch 4/6.

> 
>  } DPDK_17.08;
> --
> 2.5.5

  reply	other threads:[~2017-09-25 11:54 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1503569908-104074-1-git-send-email-kirill.rybalchenko@intel.com>
2017-09-01 15:02 ` [dpdk-dev] [PATCH v2 0/4] net/i40e: implement dynamic mapping of flow types to pctypes Kirill Rybalchenko
2017-09-01 15:02   ` [dpdk-dev] [PATCH v2 1/4] net/i40e: implement dynamic mapping of sw flow types to hw pctypes Kirill Rybalchenko
2017-09-04 16:49     ` Ananyev, Konstantin
2017-09-08 16:58     ` Ferruh Yigit
2017-09-01 15:02   ` [dpdk-dev] [PATCH v2 2/4] net/i40e: add new functions to manipulate with pctype mapping table Kirill Rybalchenko
2017-09-04 17:24     ` Iremonger, Bernard
2017-09-08 17:01     ` Ferruh Yigit
2017-09-01 15:02   ` [dpdk-dev] [PATCH v2 3/4] app/testpmd: add new commands to manipulate with pctype mapping Kirill Rybalchenko
2017-09-04 17:29     ` Iremonger, Bernard
2017-09-08 17:02     ` Ferruh Yigit
2017-09-01 15:02   ` [dpdk-dev] [PATCH v2 4/4] ethdev: remove unnecessary check for new flow type Kirill Rybalchenko
2017-09-08 17:01     ` Ferruh Yigit
2017-09-04 17:16   ` [dpdk-dev] [PATCH v2 0/4] net/i40e: implement dynamic mapping of flow types to pctypes Iremonger, Bernard
2017-09-20 14:32   ` [dpdk-dev] [PATCH v3 0/6] " Kirill Rybalchenko
2017-09-20 14:32     ` [dpdk-dev] [PATCH v3 1/6] net/i40e: remove unnecessary bit operations Kirill Rybalchenko
2017-09-20 14:32     ` [dpdk-dev] [PATCH v3 2/6] net/i40e: add definition for invalid pctype Kirill Rybalchenko
2017-09-22  7:29       ` Xing, Beilei
2017-09-20 14:33     ` [dpdk-dev] [PATCH v3 3/6] net/i40e: implement dynamic mapping of sw flow types to hw pctypes Kirill Rybalchenko
2017-09-25  9:44       ` Xing, Beilei
2017-09-20 14:33     ` [dpdk-dev] [PATCH v3 4/6] net/i40e: add new functions to manipulate with pctype mapping table Kirill Rybalchenko
2017-09-22  7:27       ` Xing, Beilei
2017-09-20 14:33     ` [dpdk-dev] [PATCH v3 5/6] app/testpmd: add new commands to manipulate with pctype mapping Kirill Rybalchenko
2017-09-25 11:54       ` Xing, Beilei [this message]
2017-09-20 14:33     ` [dpdk-dev] [PATCH v3 6/6] ethdev: remove unnecessary check for new flow type Kirill Rybalchenko
2017-10-02 15:08     ` [dpdk-dev] [PATCH v4 0/5] net/i40e: implement dynamic mapping of flow types to pctypes Kirill Rybalchenko
2017-10-02 15:08       ` [dpdk-dev] [PATCH v4 1/5] net/i40e: remove unnecessary bit operations Kirill Rybalchenko
2017-10-02 15:08       ` [dpdk-dev] [PATCH v4 2/5] net/i40e: implement dynamic mapping of sw flow types to hw pctypes Kirill Rybalchenko
2017-10-02 15:09       ` [dpdk-dev] [PATCH v4 3/5] net/i40e: add new functions to manipulate with pctype mapping table Kirill Rybalchenko
2017-10-02 15:09       ` [dpdk-dev] [PATCH v4 4/5] app/testpmd: add new commands to manipulate with pctype mapping Kirill Rybalchenko
2017-10-03 21:42         ` Ferruh Yigit
2017-10-02 15:09       ` [dpdk-dev] [PATCH v4 5/5] ethdev: remove unnecessary check for new flow type Kirill Rybalchenko
2017-10-03 21:44       ` [dpdk-dev] [PATCH v4 0/5] net/i40e: implement dynamic mapping of flow types to pctypes Ferruh Yigit
2017-10-04 12:52       ` [dpdk-dev] [PATCH v5 " Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 1/5] net/i40e: remove unnecessary bit operations Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 2/5] net/i40e: implement dynamic mapping of sw flow types to hw pctypes Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 3/5] net/i40e: add new functions to manipulate with pctype mapping table Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 4/5] app/testpmd: add new commands to manipulate with pctype mapping Kirill Rybalchenko
2017-10-04 12:52         ` [dpdk-dev] [PATCH v5 5/5] ethdev: remove unnecessary check for new flow type Kirill Rybalchenko
2017-10-04 21:48         ` [dpdk-dev] [PATCH v5 0/5] net/i40e: implement dynamic mapping of flow types to pctypes Ferruh Yigit
2017-10-05  1:28           ` Ferruh Yigit

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=94479800C636CB44BD422CB454846E01320373B6@SHSMSX101.ccr.corp.intel.com \
    --to=beilei.xing@intel.com \
    --cc=andrey.chilikin@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=kirill.rybalchenko@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).