[dpdk-dev] [PATCH 1/3] app/testpmd: metering and policing CLI clean up

Wu, Jingjing jingjing.wu at intel.com
Sun Jan 7 15:25:24 CET 2018



> -----Original Message-----
> From: Singh, Jasvinder
> Sent: Tuesday, November 21, 2017 12:39 AM
> To: dev at dpdk.org
> Cc: Dumitrescu, Cristian <cristian.dumitrescu at intel.com>; Wu, Jingjing
> <jingjing.wu at intel.com>; Mcnamara, John <john.mcnamara at intel.com>
> Subject: [PATCH 1/3] app/testpmd: metering and policing CLI clean up
> 
> This patch updates the metering and policing CLIs as follows:
> - change name of set port meter CLI to create port meter and add meter
>   enable option, dscp table entries arguments, action mask, policer actions
>   and previous meter color option as an input color
> - set the right metering algorithm in add meter profile CLIs related to
>   srtcm(rfc2697) and trtcm(rfc2698,rfc4115)
> - change clear flag type from uint32_t to string in show meter stats CLI
> 
> Signed-off-by: Jasvinder Singh <jasvinder.singh at intel.com>
Acked-by: Jingjing Wu <jingjing.wu at intel.com>

With minor comment: 

> +static int
> +parse_dscp_table_entries(char *str, enum rte_mtr_color *dscp_table)
> +{
> +	char *token;
> +	int i = 0;
> +
> +	token = strtok_r(str, PARSE_DELIMITER, &str);
> +	if (token == NULL)
> +		return 0;
> +
> +	/* Allocate memory for dscp table */
> +	dscp_table = (enum rte_mtr_color *)malloc(MAX_DSCP_TABLE_ENTRIES *
> +		sizeof(enum rte_mtr_color));
> +
> +	while (1) {
> +		if (strcmp(token, "G") == 0 ||
> +			strcmp(token, "g") == 0)
> +			dscp_table[i++] = RTE_MTR_GREEN;
> +		else if (strcmp(token, "Y") == 0 ||
> +			strcmp(token, "y") == 0)
> +			dscp_table[i++] = RTE_MTR_YELLOW;
> +		else if (strcmp(token, "R") == 0 ||
> +			strcmp(token, "r") == 0)
> +			dscp_table[i++] = RTE_MTR_RED;
> +		else {
> +			free(dscp_table);
> +			return -1;
> +		}
> +		if (i == MAX_DSCP_TABLE_ENTRIES)
> +			break;
Is that meaning the size dscp table must be 64, can it be less than 64?

Thanks
Jingjing


More information about the dev mailing list