DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
From: "Di, ChenxuX" <chenxux.di@intel.com>
To: "Yang, Qiming" <qiming.yang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Xing, Beilei" <beilei.xing@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 5/5] app/testpmd: support query RSS config in flow query
Date: Wed, 1 Jul 2020 01:25:58 +0000
Message-ID: <70714889ee724c6a95371d2811226530@intel.com> (raw)
In-Reply-To: <BN6PR11MB00172CEBC687124F7ECFA026E56F0@BN6PR11MB0017.namprd11.prod.outlook.com>

Hi,

For the current code about flow query <portid> <ruleid> count 
It is printf("%s:\n"
	" hits_set: %u\n"
	" bytes_set: %u\n"
	" hits: %" PRIu64 "\n"
	" bytes: %" PRIu64 "\n",
	name,
	query.count.hits_set,
	query.count.bytes_set,
	query.count.hits,
	query.count.bytes);
and it will display the info like:
COUNT:
 hits_set: xxx
 bytes_set : xxx
 hits: xxx
 bytes: xxx

so for the code style and info style like it, I add some space in the log to make sure the log like
RSS:
 Queues: none|0|1|...
 Function: default| Toeplitz| simple_xor| symmetric_toeplitz| Unknown function
 Types:
  none
  Ipv4-tcp
  Ipv4-udp
  
For the reason the types may be many types, and if the line in testpmd log is too long.
It may cause error, so the types info is displayed per line and with one more space before.

> -----Original Message-----
> From: Yang, Qiming
> Sent: Tuesday, June 30, 2020 6:41 PM
> To: Di, ChenxuX <chenxux.di@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>
> Subject: RE: [PATCH v2 5/5] app/testpmd: support query RSS config in flow query
> 
> 
> 
> > -----Original Message-----
> > From: Di, ChenxuX <chenxux.di@intel.com>
> > Sent: Monday, June 15, 2020 10:19
> > To: dev@dpdk.org
> > Cc: Xing, Beilei <beilei.xing@intel.com>; Yang, Qiming
> > <qiming.yang@intel.com>; Di, ChenxuX <chenxux.di@intel.com>
> > Subject: [PATCH v2 5/5] app/testpmd: support query RSS config in flow
> > query
> >
> > This patch support RSS action in flow query.
> > It can display the RSS configuration of the specified rule.
> >
> > Signed-off-by: Chenxu Di <chenxux.di@intel.com>
> > ---
> >  app/test-pmd/config.c | 55
> > +++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 55 insertions(+)
> >
> > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
> > f519246c7..7e3cccf9a 100644
> > --- a/app/test-pmd/config.c
> > +++ b/app/test-pmd/config.c
> > @@ -1378,6 +1378,56 @@ port_flow_complain(struct rte_flow_error
> > *error)  return -err;  }
> >
> > +static void
> > +rss_config_display(struct rte_flow_action_rss *rss_conf) { uint8_t i;
> > +
> > +if (rss_conf == NULL) {
> > +printf("Invalid rule\n");
> > +return;
> > +}
> > +
> > +printf("RSS:\n"
> > +       " queues:");
> 
> Two lines needed? And why don't you add the space in the end of this printf?
> 
> > +if (rss_conf->queue_num == 0)
> 
> If(!rss_conf->queue_num)
> 
> > +printf(" none");
> > +for (i = 0; i < rss_conf->queue_num; i++) printf(" %d",
> > +rss_conf->queue[i]);
> > +
> > +printf("\n function:");
> > +switch (rss_conf->func) {
> > +case RTE_ETH_HASH_FUNCTION_DEFAULT:
> > +printf(" default\n");
> 
> No needed space
> 
> > +break;
> > +case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
> > +printf(" toeplitz\n");
> 
> Same
> 
> > +break;
> > +case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
> > +printf(" simple_xor\n");
> ...
> 
> > +break;
> > +case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:
> > +printf(" symmetric_toeplitz\n");
> ..
> 
> > +break;
> > +default:
> > +printf(" Unknown function\n");
> ...
> 
> > +return;
> > +}
> > +
> > +printf(" types:\n");
> 
> Same...
> 
> > +if (rss_conf->types == 0) {
> > +printf("  none\n");
> 
> Same...
> 
> > +return;
> > +}
> > +for (i = 0; rss_type_table[i].str; i++) { if ((rss_conf->types &
> > +    rss_type_table[i].rss_type) ==
> > +    rss_type_table[i].rss_type &&
> > +    rss_type_table[i].rss_type != 0)
> > +printf("  %s\n", rss_type_table[i].str);
> 
> All the same..
> 
> > +}
> > +}
> > +
> >  /** Validate flow rule. */
> >  int
> >  port_flow_validate(portid_t port_id,
> > @@ -1564,6 +1614,7 @@ port_flow_query(portid_t port_id, uint32_t rule,
> > const char *name;  union {  struct rte_flow_query_count count;
> > +struct rte_flow_action_rss rss_conf;
> >  } query;
> >  int ret;
> >
> > @@ -1585,6 +1636,7 @@ port_flow_query(portid_t port_id, uint32_t rule,
> > return port_flow_complain(&error);  switch (action->type) {  case
> > RTE_FLOW_ACTION_TYPE_COUNT:
> > +case RTE_FLOW_ACTION_TYPE_RSS:
> >  break;
> >  default:
> >  printf("Cannot query action type %d (%s)\n", @@ -1609,6
> > +1661,9 @@ port_flow_query(portid_t port_id, uint32_t rule,
> >         query.count.hits,
> >         query.count.bytes);
> >  break;
> > +case RTE_FLOW_ACTION_TYPE_RSS:
> > +rss_config_display(&query.rss_conf);
> > +break;
> >  default:
> >  printf("Cannot display result for action type %d (%s)\n",
> >         action->type, name);
> > --
> > 2.17.1
> 


  reply index

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11  6:01 [dpdk-dev] [PATCH 0/5] re-implement legacy filter functions by private API Chenxu Di
2020-06-11  6:01 ` [dpdk-dev] [PATCH 1/5] net/i40e: add private APIs Chenxu Di
2020-06-11  6:01 ` [dpdk-dev] [PATCH 2/5] net/ixgbe: " Chenxu Di
2020-06-11  6:01 ` [dpdk-dev] [PATCH 3/5] app/testpmd: re-implement commands by using private API Chenxu Di
2020-06-16 20:12   ` Kevin Traynor
2020-06-17 10:12     ` Di, ChenxuX
2020-06-30  6:20       ` Jeff Guo
2020-06-11  6:01 ` [dpdk-dev] [PATCH 4/5] net/i40e: enable flow query RSS Chenxu Di
2020-06-11  6:01 ` [dpdk-dev] [PATCH 5/5] app/testpmd: support query RSS config in flow query Chenxu Di
2020-06-15  2:18 ` [dpdk-dev] [PATCH v2 0/5] re-implement legacy filter functions by private API Chenxu Di
2020-06-15  2:18   ` [dpdk-dev] [PATCH v2 1/5] net/i40e: add private APIs Chenxu Di
2020-06-30  4:22     ` Jeff Guo
2020-06-30 10:24     ` Yang, Qiming
2020-07-01  1:30       ` Di, ChenxuX
2020-06-15  2:18   ` [dpdk-dev] [PATCH v2 2/5] net/ixgbe: " Chenxu Di
2020-06-30  5:25     ` Jeff Guo
2020-06-30 10:25     ` Yang, Qiming
2020-06-15  2:18   ` [dpdk-dev] [PATCH v2 3/5] app/testpmd: re-implement commands by using private API Chenxu Di
2020-06-30 10:34     ` Yang, Qiming
2020-06-15  2:18   ` [dpdk-dev] [PATCH v2 4/5] net/i40e: enable flow query RSS Chenxu Di
2020-06-30  6:48     ` Jeff Guo
2020-06-30 10:27     ` Yang, Qiming
2020-07-01  1:15       ` Di, ChenxuX
2020-06-15  2:18   ` [dpdk-dev] [PATCH v2 5/5] app/testpmd: support query RSS config in flow query Chenxu Di
2020-06-30  6:37     ` Jeff Guo
2020-06-30 10:40     ` Yang, Qiming
2020-07-01  1:25       ` Di, ChenxuX [this message]
2020-07-01  8:24 ` [dpdk-dev] [PATCH v3 0/5] re-implement legacy filter functions by private API Chenxu Di
2020-07-01  8:24   ` [dpdk-dev] [PATCH v3 1/5] net/i40e: add private APIs Chenxu Di
2020-07-03  5:44     ` Jeff Guo
2020-07-01  8:24   ` [dpdk-dev] [PATCH v3 2/5] net/ixgbe: " Chenxu Di
2020-07-03  5:44     ` Jeff Guo
2020-07-01  8:24   ` [dpdk-dev] [PATCH v3 3/5] app/testpmd: re-implement commands by using private API Chenxu Di
2020-07-03  5:54     ` Jeff Guo
2020-07-06  9:10     ` Yang, Qiming
2020-07-01  8:24   ` [dpdk-dev] [PATCH v3 4/5] net/i40e: enable flow query RSS Chenxu Di
2020-07-03  5:57     ` Jeff Guo
2020-07-01  8:24   ` [dpdk-dev] [PATCH v3 5/5] app/testpmd: support query RSS config in flow query Chenxu Di
2020-07-08  1:18 ` [dpdk-dev] [PATCH v4 0/5] re-implement legacy filter functions by private API Chenxu Di
2020-07-08  1:18   ` [dpdk-dev] [PATCH v4 1/5] net/i40e: add private APIs Chenxu Di
2020-07-08  1:18   ` [dpdk-dev] [PATCH v4 2/5] net/ixgbe: " Chenxu Di
2020-07-08  1:18   ` [dpdk-dev] [PATCH v4 3/5] app/testpmd: re-implement commands by using private API Chenxu Di
2020-07-08  3:31     ` Yang, Qiming
2020-07-08  1:18   ` [dpdk-dev] [PATCH v4 4/5] net/i40e: enable flow query RSS Chenxu Di
2020-07-08  1:18   ` [dpdk-dev] [PATCH v4 5/5] app/testpmd: support query RSS config in flow query Chenxu Di
2020-07-08  3:32     ` Yang, Qiming
2020-07-08  9:05   ` [dpdk-dev] [PATCH v4 0/5] re-implement legacy filter functions by private API Zhang, Qi Z

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=70714889ee724c6a95371d2811226530@intel.com \
    --to=chenxux.di@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=qiming.yang@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

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git