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 E9D8CA0350; Tue, 30 Jun 2020 08:38:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 04C711BE90; Tue, 30 Jun 2020 08:38:01 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id D1F9D1B952 for ; Tue, 30 Jun 2020 08:37:58 +0200 (CEST) IronPort-SDR: HT9bPKyfx5zeelK2DQVEIfSS6Xc2jcl1Be+CwB5DVt2V1DRrowZFObTfSi7UCGn1n4ZksDhPZ2 ONvANmLKXPJA== X-IronPort-AV: E=McAfee;i="6000,8403,9666"; a="133607078" X-IronPort-AV: E=Sophos;i="5.75,296,1589266800"; d="scan'208";a="133607078" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 23:37:57 -0700 IronPort-SDR: 62llbZTOP8yWEVaoHLD7vv729tnSIIkFMrMLzZB9UDfGRHEso4DvFaEES0iR9w4QxNu91/6pks IUxkTXCZ0/HA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,296,1589266800"; d="scan'208";a="281121651" Received: from jguo15x-mobl.ccr.corp.intel.com (HELO [10.67.68.180]) ([10.67.68.180]) by orsmga006.jf.intel.com with ESMTP; 29 Jun 2020 23:37:56 -0700 To: Chenxu Di , dev@dpdk.org Cc: beilei.xing@intel.com, Yang Qiming References: <20200611060142.75465-1-chenxux.di@intel.com> <20200615021858.13985-1-chenxux.di@intel.com> <20200615021858.13985-6-chenxux.di@intel.com> From: Jeff Guo Message-ID: <8f50c09c-7b91-0ef7-a73f-174ef54c4cd2@intel.com> Date: Tue, 30 Jun 2020 14:37:55 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200615021858.13985-6-chenxux.di@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US 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, chenxu On 6/15/2020 10:18 AM, Chenxu Di wrote: > This patch support RSS action in flow query. > It can display the RSS configuration of the specified rule. Could you add some example command here for better know the usage and the details. > 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 == NULL) { > + printf("Invalid rule\n"); > + return; > + } > + > + printf("RSS:\n" > + " queues:"); > + if (rss_conf->queue_num == 0) > + 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"); > + break; > + case RTE_ETH_HASH_FUNCTION_TOEPLITZ: > + printf(" toeplitz\n"); > + 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"); > + if (rss_conf->types == 0) { > + printf(" none\n"); > + 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); > + } > +} > + > /** 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);