[dpdk-dev] [PATCH v7 2/2] app/testpmd: add API for configuration of queue region

Ferruh Yigit ferruh.yigit at intel.com
Tue Oct 3 20:04:01 CEST 2017


On 9/29/2017 10:16 AM, Wei Zhao wrote:
> This patch add a API configuration of queue region in rss.
> It can parse the parameters of region index, queue number,
> queue start index, user priority, traffic classes and so on.
> According to commands from command line, it will call i40e
> private API and start the process of set or flush queue region
> configure. As this feature is specific for i40e, so private API
> will be used. Aslo add a document for these new commands.
> Queue region only support PF by now, so this document is
> only for configuration of queue region on PF port.
> 
> Signed-off-by: Wei Zhao <wei.zhao1 at intel.com>
> ---
>  app/test-pmd/cmdline.c                      | 389 ++++++++++++++++++++++++++++
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  41 +++
>  2 files changed, 430 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index 4f2d731..da7dc24 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -637,6 +637,24 @@ static void cmd_help_long_parsed(void *parsed_result,
>  			"ptype mapping update (port_id) (hw_ptype) (sw_ptype)\n"
>  			"    Update a ptype mapping item on a port\n\n"
>  
> +			"set port (port_id) queue-region region_id (value) "
> +			"queue_start_index (value) queue_num (value)\n"
> +			"    Set a queue region on a port\n\n"
> +
> +			"set port (port_id) queue-region region_id (value) "
> +			"flowtype (value)\n"
> +			"    Set a flowtype region index on a port\n\n"
> +
> +			"set port (port_id) queue-region UP (value) region_id (value)\n"
> +			"    Set the mapping of User Priority to "
> +			"queue region on a port\n\n"
> +
> +			"flush port (port_id) queue-region (on|off)\n"
> +			"    flush all queue region related configuration\n\n"
> +
> +			"get port (port_id) queue-region\n"
> +			"	 get all queue region related configuration info\n\n"
> +

You did same thing and created "flush" and "get" root level commands
this time.

For get, existing "show port #P .." can be used:
"show port #P queue-region"

For flush, what do you think:
"set port #P queue-region flush (on|off)" ?

>  			, list_pkt_forwarding_modes()
>  		);
>  	}
> @@ -8228,6 +8246,372 @@ cmdline_parse_inst_t cmd_syn_filter = {
>  		NULL,
>  	},
>  };
> +/* *** queue region set *** */
> +struct cmd_queue_region_result {
> +	cmdline_fixed_string_t set;
> +	cmdline_fixed_string_t port;
> +	uint8_t  port_id;
> +	cmdline_fixed_string_t cmd;
> +	cmdline_fixed_string_t region;
> +	uint8_t  region_id;
> +	cmdline_fixed_string_t queue_start_index;
> +	uint8_t  queue_id;
> +	cmdline_fixed_string_t queue_num;
> +	uint8_t  queue_num_value;
> +};
> +
> +static void
> +cmd_queue_region_parsed(void *parsed_result,
> +			__attribute__((unused)) struct cmdline *cl,
> +			__attribute__((unused)) void *data)
> +{
> +	struct cmd_queue_region_result *res = parsed_result;
> +	int ret = 0;

For port_id other than i40e, this call should return "Not supported",
not success. There are samples to this usage can you please check them?

> +#ifdef RTE_LIBRTE_I40E_PMD
> +	struct rte_i40e_rss_region_conf region_conf;
> +
> +	memset(&region_conf, 0, sizeof(region_conf));
> +	region_conf.op = RTE_PMD_I40E_QUEUE_REGION_SET;
> +	region_conf.region_id = res->region_id;
> +	region_conf.queue_num = res->queue_num_value;
> +	region_conf.queue_start_index = res->queue_id;
> +
> +	ret = rte_pmd_i40e_rss_queue_region_conf(res->port_id, &region_conf);
> +#endif
> +
> +	if (ret < 0)
> +		printf("queue region config programming error: (%s)\n",
> +				strerror(-ret));
> +}

<...>



More information about the dev mailing list