DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Singh, Jasvinder" <jasvinder.singh@intel.com>
To: "Wu, Jingjing" <jingjing.wu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>,
	"Mcnamara, John" <john.mcnamara@intel.com>
Subject: Re: [dpdk-dev] [PATCH 1/3] app/testpmd: metering and policing CLI clean up
Date: Mon, 8 Jan 2018 10:25:21 +0000	[thread overview]
Message-ID: <54CBAA185211B4429112C315DA58FF6D332C01CE@IRSMSX103.ger.corp.intel.com> (raw)
In-Reply-To: <9BB6961774997848B5B42BEC655768F810EF8B9E@SHSMSX103.ccr.corp.intel.com>



> -----Original Message-----
> From: Wu, Jingjing
> Sent: Sunday, January 7, 2018 2:25 PM
> To: Singh, Jasvinder <jasvinder.singh@intel.com>; dev@dpdk.org
> Cc: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Mcnamara, John
> <john.mcnamara@intel.com>
> Subject: RE: [PATCH 1/3] app/testpmd: metering and policing CLI clean up
> 
> 
> 
> > -----Original Message-----
> > From: Singh, Jasvinder
> > Sent: Tuesday, November 21, 2017 12:39 AM
> > To: dev@dpdk.org
> > Cc: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Wu, Jingjing
> > <jingjing.wu@intel.com>; Mcnamara, John <john.mcnamara@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@intel.com>
> Acked-by: Jingjing Wu <jingjing.wu@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?

The DSCP field is represented by 6 bits in the byte long TOS field of the IP header. Therefore, DSCP table should be have 64 entries for the packets classification.

> Thanks
> Jingjing

  reply	other threads:[~2018-01-08 10:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-20 16:39 Jasvinder Singh
2017-11-20 16:39 ` [dpdk-dev] [PATCH 2/3] app/testpmd: add CLI for metering and policing API Jasvinder Singh
2018-01-07 14:37   ` Wu, Jingjing
2017-11-20 16:39 ` [dpdk-dev] [PATCH 3/3] doc: add description of traffic metering and policing funcs in testpmd Jasvinder Singh
2017-12-11 11:18   ` Marko Kovacevic
2017-12-11 11:22   ` Mcnamara, John
2017-12-11 11:31   ` Mcnamara, John
2018-01-07 14:25 ` [dpdk-dev] [PATCH 1/3] app/testpmd: metering and policing CLI clean up Wu, Jingjing
2018-01-08 10:25   ` Singh, Jasvinder [this message]
2018-01-09 23:56   ` Thomas Monjalon

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=54CBAA185211B4429112C315DA58FF6D332C01CE@IRSMSX103.ger.corp.intel.com \
    --to=jasvinder.singh@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=john.mcnamara@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).