[dpdk-dev] [PATCH v2 2/2] app/testpmd: add CLI for tm mode

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Mon Sep 18 16:03:08 CEST 2017



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Jasvinder Singh
> Sent: Thursday, September 14, 2017 12:53 PM
> To: dev at dpdk.org
> Cc: Dumitrescu, Cristian <cristian.dumitrescu at intel.com>; Wu, Jingjing
> <jingjing.wu at intel.com>
> Subject: [dpdk-dev] [PATCH v2 2/2] app/testpmd: add CLI for tm mode
> 
> Add following CLIs in testpmd application;
> - commands to build hierarchical tree for the QoS Scheduler.
> - commands for runtime update of the hierarchical tree.
> - commands to display TM capability information.
>   (per port, per hierarchy level and per hierarchy node)
> - command to set the packet field mask and offset value for
>   classification.
> - command to set traffic class translation table entry
> - stats collection

This patch should be split into multiple patches, as it is quite big
and it is adding multiple commands that can be arranged in different
categories, in different patches.

Also, as you are adding several commands about traffic management,
you could separate these in a different file (i.e. cmdline_tm.c).


> 
> Signed-off-by: Jasvinder Singh <jasvinder.singh at intel.com>
> ---
>  app/test-pmd/cmdline.c | 2975
> ++++++++++++++++++++++++++++++++++++++++++++----
>  1 file changed, 2785 insertions(+), 190 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index cd8c358..cb837ce 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c

...

> +
> +	/* Command type: add */
> +	if (strcmp(res->cmd_type, "add") == 0) {
> +		/* Port link status */
> +		rte_eth_link_get_nowait(port_id, &link);
> +		if (link.link_status == ETH_LINK_UP) {
> +			printf(" Port %u link up (error)\n", port_id);
> +			return;
> +		}

If you are checking if the device is started or stopped,
you should probably use "is_port_started" function.

> +
> +		/* TM hierarchy status */
> +		if (port->softport.tm.hierarchy_frozen == 1)
> +			port->softport.tm.hierarchy_frozen = 0;
> +	}
> +
> +	/* Command type: set (update) */



More information about the dev mailing list