From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DA999A0523; Wed, 1 Jul 2020 03:26:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2C6361BEA8; Wed, 1 Jul 2020 03:26:12 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 284CA1BEA7 for ; Wed, 1 Jul 2020 03:26:09 +0200 (CEST) IronPort-SDR: vARLFkQ5ZkeDWpSjgcGjSkPvyzXngvgtQfgmgpVImBkqN1maut+IYR/RloP7XFSdLbF1ZiM6q5 zV08OVRjra4Q== X-IronPort-AV: E=McAfee;i="6000,8403,9668"; a="126530113" X-IronPort-AV: E=Sophos;i="5.75,298,1589266800"; d="scan'208";a="126530113" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2020 18:26:01 -0700 IronPort-SDR: QezKfogHsrXEIk+GOWstGqT1ekGPKW23eVss6bjLbHwYC+i9wYwbhUL08NB5eyVodrbcRxAad3 SS9TzfzWhX+A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,298,1589266800"; d="scan'208";a="481125160" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga006.fm.intel.com with ESMTP; 30 Jun 2020 18:26:01 -0700 Received: from shsmsx604.ccr.corp.intel.com (10.109.6.214) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 30 Jun 2020 18:26:00 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX604.ccr.corp.intel.com (10.109.6.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 1 Jul 2020 09:25:58 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Wed, 1 Jul 2020 09:25:58 +0800 From: "Di, ChenxuX" To: "Yang, Qiming" , "dev@dpdk.org" CC: "Xing, Beilei" Thread-Topic: [PATCH v2 5/5] app/testpmd: support query RSS config in flow query Thread-Index: AQHWQr4WwFitqjxv1UWva3GEnmklmKjwiiqAgAF6+GA= Date: Wed, 1 Jul 2020 01:25:58 +0000 Message-ID: <70714889ee724c6a95371d2811226530@intel.com> References: <20200611060142.75465-1-chenxux.di@intel.com> <20200615021858.13985-1-chenxux.di@intel.com> <20200615021858.13985-6-chenxux.di@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 5/5] app/testpmd: support query RSS config in flow query X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, For the current code about flow query count=20 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 t= o make sure the log like RSS: Queues: none|0|1|... Function: default| Toeplitz| simple_xor| symmetric_toeplitz| Unknown funct= ion Types: none Ipv4-tcp Ipv4-udp =20 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 mo= re space before. > -----Original Message----- > From: Yang, Qiming > Sent: Tuesday, June 30, 2020 6:41 PM > To: Di, ChenxuX ; dev@dpdk.org > Cc: Xing, Beilei > Subject: RE: [PATCH v2 5/5] app/testpmd: support query RSS config in flow= query >=20 >=20 >=20 > > -----Original Message----- > > From: Di, ChenxuX > > Sent: Monday, June 15, 2020 10:19 > > To: dev@dpdk.org > > Cc: Xing, Beilei ; Yang, Qiming > > ; Di, ChenxuX > > 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 > > --- > > 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 =3D=3D NULL) { > > +printf("Invalid rule\n"); > > +return; > > +} > > + > > +printf("RSS:\n" > > + " queues:"); >=20 > Two lines needed? And why don't you add the space in the end of this prin= tf? >=20 > > +if (rss_conf->queue_num =3D=3D 0) >=20 > If(!rss_conf->queue_num) >=20 > > +printf(" none"); > > +for (i =3D 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"); >=20 > No needed space >=20 > > +break; > > +case RTE_ETH_HASH_FUNCTION_TOEPLITZ: > > +printf(" toeplitz\n"); >=20 > Same >=20 > > +break; > > +case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR: > > +printf(" simple_xor\n"); > ... >=20 > > +break; > > +case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ: > > +printf(" symmetric_toeplitz\n"); > .. >=20 > > +break; > > +default: > > +printf(" Unknown function\n"); > ... >=20 > > +return; > > +} > > + > > +printf(" types:\n"); >=20 > Same... >=20 > > +if (rss_conf->types =3D=3D 0) { > > +printf(" none\n"); >=20 > Same... >=20 > > +return; > > +} > > +for (i =3D 0; rss_type_table[i].str; i++) { if ((rss_conf->types & > > + rss_type_table[i].rss_type) =3D=3D > > + rss_type_table[i].rss_type && > > + rss_type_table[i].rss_type !=3D 0) > > +printf(" %s\n", rss_type_table[i].str); >=20 > All the same.. >=20 > > +} > > +} > > + > > /** 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 >=20