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 909071ADD2 for ; Fri, 8 Sep 2017 19:05:20 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Sep 2017 10:04:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,362,1500966000"; d="scan'208";a="1216405953" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.57]) ([10.237.220.57]) by fmsmga002.fm.intel.com with ESMTP; 08 Sep 2017 10:02:39 -0700 To: Kirill Rybalchenko , dev@dpdk.org Cc: andrey.chilikin@intel.com, beilei.xing@intel.com, jingjing.wu@intel.com References: <1503569908-104074-1-git-send-email-kirill.rybalchenko@intel.com> <1504278166-32769-1-git-send-email-kirill.rybalchenko@intel.com> <1504278166-32769-4-git-send-email-kirill.rybalchenko@intel.com> From: Ferruh Yigit Message-ID: <95b2b15d-527f-b2eb-0f32-035dee1a7ed5@intel.com> Date: Fri, 8 Sep 2017 18:02:37 +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: <1504278166-32769-4-git-send-email-kirill.rybalchenko@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 3/4] app/testpmd: add new commands to manipulate with pctype mapping 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: Fri, 08 Sep 2017 17:05:21 -0000 On 9/1/2017 4:02 PM, Kirill Rybalchenko wrote: > Add new commands to manipulate with dynamic flow type to > pctype mapping table in i40e PMD. > Commands allow to print table, modify it and reset to default value. > > Signed-off-by: Kirill Rybalchenko > --- > app/test-pmd/cmdline.c | 311 +++++++++++++++++++++++++++- > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 21 ++ > 2 files changed, 322 insertions(+), 10 deletions(-) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index 0144191..f7d0733 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -637,6 +637,16 @@ 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" > > + "pctype mapping reset (port_id)\n" > + " Reset flow type to pctype mapping on a port\n\n" > + > + "pctype mapping get (port_id)\n" > + " Get flow ptype to pctype mapping on a port\n\n" > + > + "pctype mapping update (port_id) (pctype_id_0[,pctype_id_1]*)" > + " (flow_type_id)\n" > + " Update a flow type to pctype mapping item on a port\n\n" This is another root level command for PMD specific feature, can this be under "port" or "set" command? > + > , list_pkt_forwarding_modes() > ); > } > @@ -681,7 +691,8 @@ static void cmd_help_long_parsed(void *parsed_result, > " Set crc-strip/scatter/rx-checksum/hardware-vlan/drop_en" > " for ports.\n\n" > > - "port config all rss (all|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none)\n" > + "port config all rss (all|ip|tcp|udp|sctp|ether|port|vxlan|" > + "geneve|nvgre|none|)\n" Why not use existing defined hash functions but use custom one, is there a missing one in ethdev? > " Set the RSS mode.\n\n" > > "port config port-id rss reta (hash,queue)[,(hash,queue)]\n" > @@ -878,8 +889,8 @@ static void cmd_help_long_parsed(void *parsed_result, > "set_hash_input_set (port_id) (ipv4|ipv4-frag|" > "ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|" > "ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|" > - "l2_payload) (ovlan|ivlan|src-ipv4|dst-ipv4|src-ipv6|" > - "dst-ipv6|ipv4-tos|ipv4-proto|ipv6-tc|" > + "l2_payload|) (ovlan|ivlan|src-ipv4|dst-ipv4|" > + "src-ipv6|dst-ipv6|ipv4-tos|ipv4-proto|ipv6-tc|" > "ipv6-next-header|udp-src-port|udp-dst-port|" > "tcp-src-port|tcp-dst-port|sctp-src-port|" > "sctp-dst-port|sctp-veri-tag|udp-key|gre-key|fld-1st|" > @@ -1716,6 +1727,8 @@ cmd_config_rss_parsed(void *parsed_result, > rss_conf.rss_hf = ETH_RSS_NVGRE; > else if (!strcmp(res->value, "none")) > rss_conf.rss_hf = 0; > + else if (isdigit(res->value[0]) && atoi(res->value) > 0 && atoi(res->value) < 64) > + rss_conf.rss_hf = 1ULL << atoi(res->value); > else { > printf("Unknown parameter\n"); > return; > @@ -1739,14 +1752,13 @@ cmdline_parse_token_string_t cmd_config_rss_all = > cmdline_parse_token_string_t cmd_config_rss_name = > TOKEN_STRING_INITIALIZER(struct cmd_config_rss, name, "rss"); > cmdline_parse_token_string_t cmd_config_rss_value = > - TOKEN_STRING_INITIALIZER(struct cmd_config_rss, value, > - "all#ip#tcp#udp#sctp#ether#port#vxlan#geneve#nvgre#none"); > + TOKEN_STRING_INITIALIZER(struct cmd_config_rss, value, NULL); I guess this will prevent auto completion. <...> > +/* pctype mapping get */ > + > +#define FLOW_TYPE_MAX 64 > +#define PCTYPE_MAX 64 These should not be defined by application I believe. <...> > +static void > +cmd_pctype_mapping_update_parsed( > + void *parsed_result, > + __attribute__((unused)) struct cmdline *cl, > + __attribute__((unused)) void *data) > +{ > + struct cmd_pctype_mapping_update_result *res = parsed_result; > + int ret = -ENOTSUP; > +#ifdef RTE_LIBRTE_I40E_PMD > + struct rte_pmd_i40e_flow_type_mapping mapping; > +#endif > + unsigned int nb_item, i; > + unsigned int pctype_list[PCTYPE_MAX]; > + > + if (port_id_is_invalid(res->port_id, ENABLED_WARN)) > + return; > + > + nb_item = parse_item_list(res->pctype_list, "pctypes", PCTYPE_MAX, > + pctype_list, 1); How user knows which values to fill the pctype_list? More importantly, if this is an API call instead of user defined values, how application should know which values to use? I am trying to say pctype values defined in i40e driver somehow needs to public to be used. <...> > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -1310,6 +1310,27 @@ Reset ptype mapping table:: > > testpmd> ptype mapping reset (port_id) > > +pctype mapping > +~~~~~~~~~~~~~ WARNING: .../testpmd_app_ug/testpmd_funcs.rst:1314: (WARNING/2) Title underline too short. pctype mapping ~~~~~~~~~~~~~ <...>