From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id EFE632661 for ; Wed, 11 Oct 2017 04:15:58 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Oct 2017 19:15:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,359,1503385200"; d="scan'208";a="137268388" Received: from unknown (HELO [10.241.225.83]) ([10.241.225.83]) by orsmga004.jf.intel.com with ESMTP; 10 Oct 2017 19:15:57 -0700 To: "Zhao1, Wei" , "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: <336d69e6-afae-01a8-08f1-326360e15c93@intel.com> Date: Wed, 11 Oct 2017 03:15:57 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: 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: Wed, 11 Oct 2017 02:15:59 -0000 On 10/10/2017 4:01 AM, Zhao1, Wei wrote: > Hi,Ferruh > >> -----Original Message----- >> From: Zhao1, Wei >> Sent: Tuesday, October 10, 2017 10:56 AM >> To: Yigit, Ferruh ; dev@dpdk.org >> Subject: RE: [dpdk-dev] [PATCH v7 2/2] app/testpmd: add API for >> configuration of queue region >> >> Hi, >> >>> -----Original Message----- >>> From: Yigit, Ferruh >>> Sent: Wednesday, October 4, 2017 2:04 AM >>> To: Zhao1, Wei ; dev@dpdk.org >>> Subject: Re: [dpdk-dev] [PATCH v7 2/2] app/testpmd: add API for >>> configuration of queue region >>> >>> 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)" ? >> >> Ok. >> >>> >>>> , 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? >> >> Do you mean to add the check code : >> >> if (port_id_is_invalid(res->port_id, ENABLED_WARN)) >> return; >> >> maybe all CLI parser function NEED it. > > Sorry, maybe it should be this mode. > > int ret = -ENOTSUP; > > if (port_id_is_invalid(res->port_id, ENABLED_WARN)) > return ret; Yep, this one. For the case I40E config not enabled, and when called for devices other than i40e, function should return -ENOTSUP;