From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id A0B247D19 for ; Thu, 4 Jan 2018 07:52:04 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jan 2018 22:52:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,506,1508828400"; d="scan'208";a="17360976" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 03 Jan 2018 22:52:02 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 3 Jan 2018 22:52:01 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.189]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Thu, 4 Jan 2018 14:52:00 +0800 From: "Lu, Wenzhuo" To: "Xing, Beilei" , "Wu, Jingjing" , "Zhang, Qi Z" CC: "dev@dpdk.org" , "Chilikin, Andrey" Thread-Topic: [PATCH v6 2/2] app/testpmd: add configuration for input set Thread-Index: AQHTb/ljtXfvW5LoRUaZFj0/W5BrEqNjbPjQ Date: Thu, 4 Jan 2018 06:51:59 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B709791@shsmsx102.ccr.corp.intel.com> References: <1512636184-20971-1-git-send-email-beilei.xing@intel.com> <1512719514-138425-1-git-send-email-beilei.xing@intel.com> <1512719514-138425-3-git-send-email-beilei.xing@intel.com> In-Reply-To: <1512719514-138425-3-git-send-email-beilei.xing@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 v6 2/2] app/testpmd: add configuration for input set 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: Thu, 04 Jan 2018 06:52:05 -0000 Hi Beilei > -----Original Message----- > From: Xing, Beilei > Sent: Friday, December 8, 2017 3:52 PM > To: Wu, Jingjing ; Lu, Wenzhuo > ; Zhang, Qi Z > Cc: dev@dpdk.org; Chilikin, Andrey > Subject: [PATCH v6 2/2] app/testpmd: add configuration for input set >=20 > This patch adds command to configure input set for RSS/flow director/flow > director flexible payload. >=20 > Signed-off-by: Beilei Xing > --- > app/test-pmd/cmdline.c | 237 > +++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 237 insertions(+) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > f71d963..79fdd0b 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c >=20 > @@ -14652,6 +14661,232 @@ cmdline_parse_inst_t cmd_ddp_get_list =3D { > }, > }; >=20 > +/* Configure input set */ > +struct cmd_cfg_input_set_result { > + cmdline_fixed_string_t port; > + cmdline_fixed_string_t cfg; > + portid_t port_id; > + cmdline_fixed_string_t pctype; > + uint8_t pctype_id; > + cmdline_fixed_string_t inset_type; > + cmdline_fixed_string_t opt; > + cmdline_fixed_string_t field; > + uint8_t field_idx; > +}; > + > +static void > +cmd_cfg_input_set_parsed( > + void *parsed_result, > + __attribute__((unused)) struct cmdline *cl, > + __attribute__((unused)) void *data) > +{ > + struct cmd_cfg_input_set_result *res =3D parsed_result; #ifdef > +RTE_LIBRTE_I40E_PMD > + enum rte_pmd_i40e_inset_type inset_type =3D INSET_NONE; > + struct rte_pmd_i40e_inset inset; > + int ret; > +#endif > + > + if (res->port_id > nb_ports) { > + printf("Invalid port, range is [0, %d]\n", nb_ports - 1); > + return; > + } > + > + if (!all_ports_stopped()) { > + printf("Please stop all ports first\n"); > + return; > + } > + > +#ifdef RTE_LIBRTE_I40E_PMD I don't think it's good to comment all the code below. Because if you run = this CLI on a NIC which is not i40e, the CLI will fail silently. Please ref= erence the existing code about how to use this macro. > + if (!strcmp(res->inset_type, "hash_inset")) > + inset_type =3D INSET_HASH; > + else if (!strcmp(res->inset_type, "fdir_inset")) > + inset_type =3D INSET_FDIR; > + else if (!strcmp(res->inset_type, "fdir_flx_inset")) > + inset_type =3D INSET_FDIR_FLX; > + ret =3D rte_pmd_i40e_inset_get(res->port_id, res->pctype_id, > + &inset, inset_type); > + if (ret) { > + printf("Failed to get input set.\n"); > + return; > + } > + > + if (!strcmp(res->opt, "get")) { > + ret =3D rte_pmd_i40e_inset_field_get(inset.inset, > + res->field_idx); > + if (ret) > + printf("Field index %d is enabled.\n", res->field_idx); > + else > + printf("Field index %d is disabled.\n", res->field_idx); > + return; > + } else if (!strcmp(res->opt, "set")) > + ret =3D rte_pmd_i40e_inset_field_set(&inset.inset, > + res->field_idx); > + else if (!strcmp(res->opt, "clear")) > + ret =3D rte_pmd_i40e_inset_field_clear(&inset.inset, > + res->field_idx); > + if (ret) { > + printf("Failed to configure input set field.\n"); > + return; > + } > + > + ret =3D rte_pmd_i40e_inset_set(res->port_id, res->pctype_id, > + &inset, inset_type); > + if (ret) { > + printf("Failed to set input set.\n"); > + return; > + } > + > +#endif Another thing, please update the testpmd_funcs.rst for the new CLIs. > -- > 2.5.5