From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id E86BB69F7 for ; Fri, 17 Mar 2017 10:51:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1489744294; x=1521280294; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=FesfAt98czCxMLuyx0XQjHHR1j09Fd82OZMYA6BJ/as=; b=NrSH+ZANVBVot3McLGdNh0V8Nh9gugbg4AnewPq5XKUGkd4AU5QNMrnn kBFZOunmejBOgOv2dzm5EQluA/+F+w==; Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Mar 2017 02:51:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,176,1486454400"; d="scan'208";a="1109495819" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 17 Mar 2017 02:51:32 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 17 Mar 2017 02:51:32 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 17 Mar 2017 02:51:32 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002; Fri, 17 Mar 2017 17:51:30 +0800 From: "Zhang, Qi Z" To: "Yigit, Ferruh" , "Wu, Jingjing" , "Zhang, Helin" CC: "dev@dpdk.org" , "De Lara Guarch, Pablo" Thread-Topic: [dpdk-dev] [PATCH v2 3/3] app/testpmd: add CL for ptype mapping configure Thread-Index: AQHSmyJaGvjZIKmh4Eej2yMsrW4B96GXJ+iAgAGm9JA= Date: Fri, 17 Mar 2017 09:51:29 +0000 Message-ID: <039ED4275CED7440929022BC67E70611530677E0@SHSMSX103.ccr.corp.intel.com> References: <20170227045612.48030-1-qi.z.zhang@intel.com> <20170312120845.31666-1-qi.z.zhang@intel.com> <20170312120845.31666-4-qi.z.zhang@intel.com> <18f75650-47bd-e82f-dcc6-c0d4f7000b2a@intel.com> In-Reply-To: <18f75650-47bd-e82f-dcc6-c0d4f7000b2a@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTM1NDEyYjEtNDZhOC00MTc1LWE2OTgtNDJlOWNjMmYyMzI3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkoxVW5yNlg2OGphR204SmRZSjBXazcyZnk4enMrdHFodmtjSlkwTmxjUm89In0= x-ctpclassification: CTP_IC 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 v2 3/3] app/testpmd: add CL for ptype mapping configure 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, 17 Mar 2017 09:51:34 -0000 Hi Ferruh: > -----Original Message----- > From: Yigit, Ferruh > Sent: Friday, March 17, 2017 12:27 AM > To: Zhang, Qi Z ; Wu, Jingjing > ; Zhang, Helin > Cc: dev@dpdk.org; De Lara Guarch, Pablo > Subject: Re: [dpdk-dev] [PATCH v2 3/3] app/testpmd: add CL for ptype > mapping configure >=20 > On 3/12/2017 12:08 PM, Qi Zhang wrote: > > Add below command line to configure ptype mapping. > > ptype mapping get . > > ptype mapping replace . > > ptype mapping reset . > > ptype mapping update . > > > > Signed-off-by: Qi Zhang > > --- > > app/test-pmd/cmdline.c | 372 > > +++++++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 372 insertions(+) > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > > 43fc636..85f07ba 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > @@ -575,6 +575,18 @@ static void cmd_help_long_parsed(void > *parsed_result, > > "E-tag set filter del e-tag-id (value) port (port_id)\n" > > " Delete an E-tag forwarding filter on a port\n\n" > > > > + "ptype mapping get (port_id) (valid_only)\n" > > + " Get ptype mapping on a port\n\n" > > + > > + "ptype mapping replace (port_id) (target) (mask) (pky_type)\n" > > + " Replace target with the pkt_type in ptype mapping\n\n" > > + > > + "ptype mapping reset (port_id)\n" > > + " Reset ptype mapping on a port\n\n" > > + > > + "ptype mapping update (port_id) (hw_ptype) (sw_ptype)\n" > > + " Update a ptype mapping item on a port\n\n" > > + >=20 > This adds new root level "ptype" command, I think it would be nice to get= an > Ack from testpmd maintainers for this. >=20 > testpmd now supports many commands, and I don't know if it is only me, bu= t > I am having hard time to find some commands. Perhaps commands can be > grouped better. Yes, I saw so many command in "config" category , maybe we can split these = commands into more specific functions. >=20 > > , list_pkt_forwarding_modes() > > ); > > } > > @@ -12395,6 +12407,362 @@ cmdline_parse_inst_t cmd_set_vf_vlan_tag > =3D { > > }, > > }; >=20 > <...> >=20 > > +static void > > +cmd_ptype_mapping_get_parsed( > > + void *parsed_result, > > + __attribute__((unused)) struct cmdline *cl, > > + __attribute__((unused)) void *data) > > +{ > > + struct cmd_ptype_mapping_get_result *res =3D parsed_result; #ifdef > > +RTE_LIBRTE_I40E_PMD > > + int ret =3D -ENOTSUP; > > + int max_ptype_num =3D 256; > > + struct rte_pmd_i40e_ptype_mapping mapping[max_ptype_num]; > > + uint16_t count; > > + int i; > > +#endif >=20 > This will cause a build error if I40E driver not enabled. Only wrapping t= he API > with #ifdef should be enough. Will fix it, thanks. >=20 > > + > > + if (port_id_is_invalid(res->port_id, ENABLED_WARN)) > > + return; > > + > > +#ifdef RTE_LIBRTE_I40E_PMD > > + ret =3D rte_pmd_i40e_ptype_mapping_get(res->port_id, > > + mapping, > > + max_ptype_num, > > + &count, > > + res->valid_only); > > +#endif > > + > > + switch (ret) { > > + case 0: > > + break; > > + case -ENODEV: > > + printf("invalid port_id %d\n", res->port_id); > > + break; > > + case -ENOTSUP: > > + printf("function not implemented\n"); > > + break; > > + default: > > + printf("programming error: (%s)\n", strerror(-ret)); > > + } > > + > > +#ifdef RTE_LIBRTE_I40E_PMD > > + if (!ret) { > > + for (i =3D 0; i < count; i++) > > + printf("%3d\t0x%08x\n", > > + mapping[i].hw_ptype, mapping[i].sw_ptype); > > + } > > +#endif > > +} > > + >=20 > <...>