DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>
To: "Xing, Beilei" <beilei.xing@intel.com>,
	"Wu, Jingjing" <jingjing.wu@intel.com>,
	"Zhang, Qi Z" <qi.z.zhang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Chilikin, Andrey" <andrey.chilikin@intel.com>
Subject: Re: [dpdk-dev] [PATCH v6 2/2] app/testpmd: add configuration for input set
Date: Thu, 4 Jan 2018 06:51:59 +0000	[thread overview]
Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B709791@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1512719514-138425-3-git-send-email-beilei.xing@intel.com>

Hi Beilei

> -----Original Message-----
> From: Xing, Beilei
> Sent: Friday, December 8, 2017 3:52 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Chilikin, Andrey <andrey.chilikin@intel.com>
> Subject: [PATCH v6 2/2] app/testpmd: add configuration for input set
> 
> This patch adds command to configure input set for RSS/flow director/flow
> director flexible payload.
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> ---
>  app/test-pmd/cmdline.c | 237
> +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 237 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> f71d963..79fdd0b 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c


> 
> @@ -14652,6 +14661,232 @@ cmdline_parse_inst_t cmd_ddp_get_list = {
>  	},
>  };
> 
> +/* Configure input set */
> +struct cmd_cfg_input_set_result {
> +	cmdline_fixed_string_t port;
> +	cmdline_fixed_string_t cfg;
> +	portid_t port_id;
> +	cmdline_fixed_string_t pctype;
> +	uint8_t pctype_id;
> +	cmdline_fixed_string_t inset_type;
> +	cmdline_fixed_string_t opt;
> +	cmdline_fixed_string_t field;
> +	uint8_t field_idx;
> +};
> +
> +static void
> +cmd_cfg_input_set_parsed(
> +	void *parsed_result,
> +	__attribute__((unused)) struct cmdline *cl,
> +	__attribute__((unused)) void *data)
> +{
> +	struct cmd_cfg_input_set_result *res = parsed_result; #ifdef
> +RTE_LIBRTE_I40E_PMD
> +	enum rte_pmd_i40e_inset_type inset_type = INSET_NONE;
> +	struct rte_pmd_i40e_inset inset;
> +	int ret;
> +#endif
> +
> +	if (res->port_id > nb_ports) {
> +		printf("Invalid port, range is [0, %d]\n", nb_ports - 1);
> +		return;
> +	}
> +
> +	if (!all_ports_stopped()) {
> +		printf("Please stop all ports first\n");
> +		return;
> +	}
> +
> +#ifdef RTE_LIBRTE_I40E_PMD
I don't think it's good to comment all the code below.  Because if you run this CLI on a NIC which is not i40e, the CLI will fail silently. Please reference the existing code about how to use this macro.

> +	if (!strcmp(res->inset_type, "hash_inset"))
> +		inset_type = INSET_HASH;
> +	else if (!strcmp(res->inset_type, "fdir_inset"))
> +		inset_type = INSET_FDIR;
> +	else if (!strcmp(res->inset_type, "fdir_flx_inset"))
> +		inset_type = INSET_FDIR_FLX;
> +	ret = rte_pmd_i40e_inset_get(res->port_id, res->pctype_id,
> +				     &inset, inset_type);
> +	if (ret) {
> +		printf("Failed to get input set.\n");
> +		return;
> +	}
> +
> +	if (!strcmp(res->opt, "get")) {
> +		ret = rte_pmd_i40e_inset_field_get(inset.inset,
> +						   res->field_idx);
> +		if (ret)
> +			printf("Field index %d is enabled.\n", res->field_idx);
> +		else
> +			printf("Field index %d is disabled.\n", res->field_idx);
> +		return;
> +	} else if (!strcmp(res->opt, "set"))
> +		ret = rte_pmd_i40e_inset_field_set(&inset.inset,
> +						   res->field_idx);
> +	else if (!strcmp(res->opt, "clear"))
> +		ret = rte_pmd_i40e_inset_field_clear(&inset.inset,
> +						     res->field_idx);
> +	if (ret) {
> +		printf("Failed to configure input set field.\n");
> +		return;
> +	}
> +
> +	ret = rte_pmd_i40e_inset_set(res->port_id, res->pctype_id,
> +				     &inset, inset_type);
> +	if (ret) {
> +		printf("Failed to set input set.\n");
> +		return;
> +	}
> +
> +#endif


Another thing, please update the testpmd_funcs.rst for the new CLIs.

> --
> 2.5.5

  reply	other threads:[~2018-01-04  6:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-24 14:59 [dpdk-dev] [PATCH 0/2] net/i40e: support input set configuration Beilei Xing
2017-11-24 14:59 ` [dpdk-dev] [PATCH 1/2] " Beilei Xing
2017-11-24 14:59 ` [dpdk-dev] [PATCH 2/2] app/testpmd: add configuration for input set Beilei Xing
2017-11-27  7:16 ` [dpdk-dev] [PATCH v2 0/2] net/i40e: support input set configuration Beilei Xing
2017-11-27  7:16   ` [dpdk-dev] [PATCH v2 1/2] " Beilei Xing
2017-11-27  7:16   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: add configuration for input set Beilei Xing
2017-11-29  9:43   ` [dpdk-dev] [PATCH v3 0/2] net/i40e: support input set configuration Beilei Xing
2017-11-29  9:43     ` [dpdk-dev] [PATCH v3 1/2] " Beilei Xing
2017-11-29  9:43     ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: add configuration for input set Beilei Xing
2017-12-07  6:00     ` [dpdk-dev] [PATCH v4 0/2] net/i40e: support input set configuration Beilei Xing
2017-12-07  6:00       ` [dpdk-dev] [PATCH v4 1/2] " Beilei Xing
2017-12-07  6:00       ` [dpdk-dev] [PATCH v4 2/2] app/testpmd: add configuration for input set Beilei Xing
2017-12-07  8:43       ` [dpdk-dev] [PATCH v5 0/2] net/i40e: support input set configuration Beilei Xing
2017-12-07  8:43         ` [dpdk-dev] [PATCH v5 1/2] " Beilei Xing
2017-12-07  8:43         ` [dpdk-dev] [PATCH v5 2/2] app/testpmd: add configuration for input set Beilei Xing
2017-12-08  7:51         ` [dpdk-dev] [PATCH v6 0/2] net/i40e: support input set configuration Beilei Xing
2017-12-08  7:51           ` [dpdk-dev] [PATCH v6 1/2] " Beilei Xing
2018-01-02 12:48             ` Zhang, Qi Z
2017-12-08  7:51           ` [dpdk-dev] [PATCH v6 2/2] app/testpmd: add configuration for input set Beilei Xing
2018-01-04  6:51             ` Lu, Wenzhuo [this message]
2018-01-05  3:03           ` [dpdk-dev] [PATCH v7 0/2] support input set configuration Beilei Xing
2018-01-05  3:03             ` [dpdk-dev] [PATCH v7 1/2] net/i40e: " Beilei Xing
2018-01-05  3:03             ` [dpdk-dev] [PATCH v7 2/2] app/testpmd: add configuration for input set Beilei Xing
2018-01-08  3:09             ` [dpdk-dev] [PATCH v8 0/2] support input set configuration Beilei Xing
2018-01-08  3:09               ` [dpdk-dev] [PATCH v8 1/2] net/i40e: " Beilei Xing
2018-01-10 12:12                 ` Ferruh Yigit
2018-01-10 12:40                   ` Xing, Beilei
2018-01-08  3:09               ` [dpdk-dev] [PATCH v8 2/2] app/testpmd: add configuration for input set Beilei Xing
2018-01-08  3:18                 ` Lu, Wenzhuo
2018-01-09  7:44               ` [dpdk-dev] [PATCH v8 0/2] support input set configuration Zhang, Helin

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=6A0DE07E22DDAD4C9103DF62FEBC09093B709791@shsmsx102.ccr.corp.intel.com \
    --to=wenzhuo.lu@intel.com \
    --cc=andrey.chilikin@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@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).