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

Ferruh Yigit ferruh.yigit at intel.com
Wed Oct 11 04:15:57 CEST 2017


On 10/10/2017 4:01 AM, Zhao1, Wei wrote:
> Hi,Ferruh
> 
>> -----Original Message-----
>> From: Zhao1, Wei
>> Sent: Tuesday, October 10, 2017 10:56 AM
>> To: Yigit, Ferruh <ferruh.yigit at intel.com>; dev at dpdk.org
>> Subject: RE: [dpdk-dev] [PATCH v7 2/2] app/testpmd: add API for
>> configuration of queue region
>>
>> Hi,
>>
>>> -----Original Message-----
>>> From: Yigit, Ferruh
>>> Sent: Wednesday, October 4, 2017 2:04 AM
>>> To: Zhao1, Wei <wei.zhao1 at intel.com>; dev at dpdk.org
>>> Subject: Re: [dpdk-dev] [PATCH v7 2/2] app/testpmd: add API for
>>> configuration of queue region
>>>
>>> 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)" ?
>>
>> Ok.
>>
>>>
>>>>  			, 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?
>>
>> Do you mean to add the check code :
>>
>> 	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
>> 		return;
>>
>> maybe all CLI parser function NEED it.
> 
> Sorry, maybe it should be this mode.
>  
> 	int ret = -ENOTSUP;
> 
> 	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
> 		return ret;

Yep, this one.
For the case I40E config not enabled, and when called for devices other
than i40e, function should return -ENOTSUP;


More information about the dev mailing list