From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 17B651B3CD for ; Tue, 3 Oct 2017 20:06:51 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2017 11:04:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,474,1500966000"; d="scan'208";a="906319528" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.241.224.245]) ([10.241.224.245]) by FMSMGA003.fm.intel.com with ESMTP; 03 Oct 2017 11:04:02 -0700 To: Wei Zhao , dev@dpdk.org References: <1506672718-39160-1-git-send-email-wei.zhao1@intel.com> <1506676584-41030-1-git-send-email-wei.zhao1@intel.com> <1506676584-41030-3-git-send-email-wei.zhao1@intel.com> From: Ferruh Yigit Message-ID: Date: Tue, 3 Oct 2017 19:04:01 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1506676584-41030-3-git-send-email-wei.zhao1@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v7 2/2] app/testpmd: add API for configuration of queue region 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: , X-List-Received-Date: Tue, 03 Oct 2017 18:06:52 -0000 On 9/29/2017 10:16 AM, Wei Zhao wrote: > This patch add a API configuration of queue region in rss. > It can parse the parameters of region index, queue number, > queue start index, user priority, traffic classes and so on. > According to commands from command line, it will call i40e > private API and start the process of set or flush queue region > configure. As this feature is specific for i40e, so private API > will be used. Aslo add a document for these new commands. > Queue region only support PF by now, so this document is > only for configuration of queue region on PF port. > > Signed-off-by: Wei Zhao > --- > app/test-pmd/cmdline.c | 389 ++++++++++++++++++++++++++++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 41 +++ > 2 files changed, 430 insertions(+) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index 4f2d731..da7dc24 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -637,6 +637,24 @@ static void cmd_help_long_parsed(void *parsed_result, > "ptype mapping update (port_id) (hw_ptype) (sw_ptype)\n" > " Update a ptype mapping item on a port\n\n" > > + "set port (port_id) queue-region region_id (value) " > + "queue_start_index (value) queue_num (value)\n" > + " Set a queue region on a port\n\n" > + > + "set port (port_id) queue-region region_id (value) " > + "flowtype (value)\n" > + " Set a flowtype region index on a port\n\n" > + > + "set port (port_id) queue-region UP (value) region_id (value)\n" > + " Set the mapping of User Priority to " > + "queue region on a port\n\n" > + > + "flush port (port_id) queue-region (on|off)\n" > + " flush all queue region related configuration\n\n" > + > + "get port (port_id) queue-region\n" > + " get all queue region related configuration info\n\n" > + You did same thing and created "flush" and "get" root level commands this time. For get, existing "show port #P .." can be used: "show port #P queue-region" For flush, what do you think: "set port #P queue-region flush (on|off)" ? > , list_pkt_forwarding_modes() > ); > } > @@ -8228,6 +8246,372 @@ cmdline_parse_inst_t cmd_syn_filter = { > NULL, > }, > }; > +/* *** queue region set *** */ > +struct cmd_queue_region_result { > + cmdline_fixed_string_t set; > + cmdline_fixed_string_t port; > + uint8_t port_id; > + cmdline_fixed_string_t cmd; > + cmdline_fixed_string_t region; > + uint8_t region_id; > + cmdline_fixed_string_t queue_start_index; > + uint8_t queue_id; > + cmdline_fixed_string_t queue_num; > + uint8_t queue_num_value; > +}; > + > +static void > +cmd_queue_region_parsed(void *parsed_result, > + __attribute__((unused)) struct cmdline *cl, > + __attribute__((unused)) void *data) > +{ > + struct cmd_queue_region_result *res = parsed_result; > + int ret = 0; For port_id other than i40e, this call should return "Not supported", not success. There are samples to this usage can you please check them? > +#ifdef RTE_LIBRTE_I40E_PMD > + struct rte_i40e_rss_region_conf region_conf; > + > + memset(®ion_conf, 0, sizeof(region_conf)); > + region_conf.op = RTE_PMD_I40E_QUEUE_REGION_SET; > + region_conf.region_id = res->region_id; > + region_conf.queue_num = res->queue_num_value; > + region_conf.queue_start_index = res->queue_id; > + > + ret = rte_pmd_i40e_rss_queue_region_conf(res->port_id, ®ion_conf); > +#endif > + > + if (ret < 0) > + printf("queue region config programming error: (%s)\n", > + strerror(-ret)); > +} <...>