From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id AFADB2C28 for ; Mon, 25 Sep 2017 13:54:23 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 25 Sep 2017 04:54:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,436,1500966000"; d="scan'208";a="315855208" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 25 Sep 2017 04:54:22 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 25 Sep 2017 04:54:22 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 25 Sep 2017 04:54:22 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.159]) by shsmsx102.ccr.corp.intel.com ([169.254.2.175]) with mapi id 14.03.0319.002; Mon, 25 Sep 2017 19:54:19 +0800 From: "Xing, Beilei" To: "Rybalchenko, Kirill" , "dev@dpdk.org" CC: "Chilikin, Andrey" , "Wu, Jingjing" Thread-Topic: [PATCH v3 5/6] app/testpmd: add new commands to manipulate with pctype mapping Thread-Index: AQHTMh155fzJDDJkIUaPuWMlmBErg6LFfVLQ Date: Mon, 25 Sep 2017 11:54:19 +0000 Message-ID: <94479800C636CB44BD422CB454846E01320373B6@SHSMSX101.ccr.corp.intel.com> References: <1504278166-32769-1-git-send-email-kirill.rybalchenko@intel.com> <1505917983-119112-1-git-send-email-kirill.rybalchenko@intel.com> <1505917983-119112-6-git-send-email-kirill.rybalchenko@intel.com> In-Reply-To: <1505917983-119112-6-git-send-email-kirill.rybalchenko@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 5/6] 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: Mon, 25 Sep 2017 11:54:25 -0000 > -----Original Message----- > From: Rybalchenko, Kirill > Sent: Wednesday, September 20, 2017 10:33 PM > To: dev@dpdk.org > Cc: Rybalchenko, Kirill ; Chilikin, Andrey > ; Xing, Beilei ; Wu, > Jingjing > Subject: [PATCH v3 5/6] app/testpmd: add new commands to manipulate > with pctype mapping >=20 > 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. >=20 > v3: > changed command syntax from 'pctype mapping...' to 'port config pctype > mapping...' and 'show port pctype mapping' >=20 > Signed-off-by: Kirill Rybalchenko > --- > app/test-pmd/cmdline.c | 335 > +++++++++++++++++++++++++++- > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 46 ++++ > drivers/net/i40e/rte_pmd_i40e_version.map | 2 +- > 3 files changed, 372 insertions(+), 11 deletions(-) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > 4f2d731..4f68267 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > + > +/* show port pctype mapping get */ > + > +/* Common result structure for show port pctype mapping get */ struct show port pctype mapping get -> show port pctype mapping ? > +cmd_pctype_mapping_get_result { > + cmdline_fixed_string_t show; > + cmdline_fixed_string_t port; > + uint8_t port_id; > + cmdline_fixed_string_t pctype; > + cmdline_fixed_string_t mapping; > +}; > + > +/* Common CLI fields for pctype mapping get */ "get" should be removed. > +cmdline_parse_token_string_t cmd_pctype_mapping_get_show =3D > + TOKEN_STRING_INITIALIZER > + (struct cmd_pctype_mapping_get_result, > + show, "show"); > +cmdline_parse_token_string_t cmd_pctype_mapping_get_port =3D > + TOKEN_STRING_INITIALIZER > + (struct cmd_pctype_mapping_get_result, > + port, "port"); > +cmdline_parse_token_num_t cmd_pctype_mapping_get_port_id =3D > + TOKEN_NUM_INITIALIZER > + (struct cmd_pctype_mapping_get_result, > + port_id, UINT8); > +cmdline_parse_token_string_t cmd_pctype_mapping_get_pctype =3D > + TOKEN_STRING_INITIALIZER > + (struct cmd_pctype_mapping_get_result, > + pctype, "pctype"); > +cmdline_parse_token_string_t cmd_pctype_mapping_get_mapping =3D > + TOKEN_STRING_INITIALIZER > + (struct cmd_pctype_mapping_get_result, > + mapping, "mapping"); > + > +static void > +cmd_pctype_mapping_get_parsed( > + void *parsed_result, > + __attribute__((unused)) struct cmdline *cl, > + __attribute__((unused)) void *data) > +{ > + struct cmd_pctype_mapping_get_result *res =3D parsed_result; > + int ret =3D -ENOTSUP; > +#ifdef RTE_LIBRTE_I40E_PMD > + struct rte_pmd_i40e_flow_type_mapping > mapping[RTE_PMD_I40E_FLOW_TYPE_MAX]; > + int i, j; > +#endif > + > + if (port_id_is_invalid(res->port_id, ENABLED_WARN)) > + return; > + > +#ifdef RTE_LIBRTE_I40E_PMD > + ret =3D rte_pmd_i40e_flow_type_mapping_get(res->port_id, > mapping); > +#endif > + > + switch (ret) { > + case 0: > + break; > + case -ENODEV: > + printf("invalid port_id %d\n", res->port_id); > + return; > + case -ENOTSUP: > + printf("function not implemented\n"); > + return; > + default: > + printf("programming error: (%s)\n", strerror(-ret)); > + return; > + } > + > +#ifdef RTE_LIBRTE_I40E_PMD > + for (i =3D 0; i < RTE_PMD_I40E_FLOW_TYPE_MAX; i++) { > + if (mapping[i].pctype !=3D 0ULL) { > + int first_pctype =3D 1; > + first_pctype should be moved to the beginning of the function. > + printf("pctype: "); > + for (j =3D 0; j < RTE_PMD_I40E_PCTYPE_MAX; j++) { > + if (mapping[i].pctype & (1ULL << j)) { > + printf(first_pctype ? "%02d" : ",%02d", > j); > + first_pctype =3D 0; > + } > + } > + printf(" -> flowtype: %02d\n", > mapping[i].flow_type); > + } > + } > +#endif > +} > + > +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 =3D parsed_result; > + int ret =3D -ENOTSUP; > +#ifdef RTE_LIBRTE_I40E_PMD > + struct rte_pmd_i40e_flow_type_mapping mapping; #endif > + unsigned int nb_item, i; Should "i" be defined when RTE_LIBRTE_I40E_PMD is defined? otherwise=20 it will be defined but not used when RTE_LIBRTE_I40E_PMD is not defined. > + unsigned int pctype_list[RTE_PMD_I40E_PCTYPE_MAX]; > + > + if (port_id_is_invalid(res->port_id, ENABLED_WARN)) > + return; > + > + nb_item =3D parse_item_list(res->pctype_list, "pctypes", > RTE_PMD_I40E_PCTYPE_MAX, > + pctype_list, 1); > + > + > +#ifdef RTE_LIBRTE_I40E_PMD > + mapping.flow_type =3D res->flow_type; > + for (i =3D 0, mapping.pctype =3D 0ULL; i < nb_item; i++) > + mapping.pctype |=3D (1ULL << pctype_list[i]); > + ret =3D rte_pmd_i40e_flow_type_mapping_update(res->port_id, > + &mapping, > + 1, > + 0); > +#endif > + > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 2ed62f5..2911fe1 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -408,6 +408,14 @@ Reset VF statistics:: >=20 > testpmd> clear vf stats (port_id) (vf_id) >=20 > +show port pctype mapping > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Length of the wave line should be the same as length of " show port pctype= mapping "? > + > +List all items from the pctype mapping table:: > + > + testpmd> show port (port_id) pctype mapping get "get" should be removed. > + > + > Configuration Functions > ----------------------- >=20 > @@ -1310,6 +1318,27 @@ Reset ptype mapping table:: >=20 > testpmd> ptype mapping reset (port_id) port config pctype mapping reset? >=20 > +pctype mapping > +~~~~~~~~~~~~~ I think all about " pctype mapping " can be removed as you use "port config= pctype mapping", right? > + > +List all items from the pctype mapping table:: > + > + testpmd> pctype mapping get (port_id) > + > +Update hardware defined pctype to software defined flow type mapping > table:: > + > + testpmd> pctype mapping update (port_id) > + (pctype_id_0[,pctype_id_1]*) (flow_type_d) > + > +where: > + > +* ``pctype_id_x``: hardware pctype id as index of bit in bitmask value o= f the > pctype mapping table. > + > +* ``flow_type_id``: software flow type id as the index of the pctype > mapping table. > + > +Reset pctype mapping table:: > + > + testpmd> pctype mapping reset (port_id) > + > Port Functions > -------------- >=20 > @@ -1697,6 +1726,23 @@ Enable/disable the E-tag support:: >=20 > testpmd> port config (port_id|all) l2-tunnel E-tag (enable|disable) >=20 > +port config pctype mapping > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Pay attention to the length of the wave line. > + > +Reset pctype mapping table:: > + > + testpmd> port config (port_id) pctype mapping reset > + > +Update hardware defined pctype to software defined flow type mapping > table:: > + > + testpmd> port config (port_id) pctype mapping update > + (pctype_id_0[,pctype_id_1]*) (flow_type_id) > + > +where: > + > +* ``pctype_id_x``: hardware pctype id as index of bit in bitmask value o= f the > pctype mapping table. > + > +* ``flow_type_id``: software flow type id as the index of the pctype > mapping table. > + >=20 > Link Bonding Functions > ---------------------- > diff --git a/drivers/net/i40e/rte_pmd_i40e_version.map > b/drivers/net/i40e/rte_pmd_i40e_version.map > index 438ca81..9292454 100644 > --- a/drivers/net/i40e/rte_pmd_i40e_version.map > +++ b/drivers/net/i40e/rte_pmd_i40e_version.map > @@ -52,6 +52,6 @@ DPDK_17.11 { > rte_pmd_i40e_add_vf_mac_addr; > rte_pmd_i40e_flow_type_mapping_update; > rte_pmd_i40e_flow_type_mapping_get; > - rte_pmd_i40e_flow_type_mapping_get; > + rte_pmd_i40e_flow_type_mapping_reset; It should be fixed in patch 4/6. >=20 > } DPDK_17.08; > -- > 2.5.5