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 664C537AC for ; Mon, 4 Sep 2017 14:45:08 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2017 05:45:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,474,1498546800"; d="scan'208";a="147917647" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga006.fm.intel.com with ESMTP; 04 Sep 2017 05:45:06 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.167]) by IRSMSX152.ger.corp.intel.com ([169.254.6.87]) with mapi id 14.03.0319.002; Mon, 4 Sep 2017 13:44:38 +0100 From: "Iremonger, Bernard" To: "Rybalchenko, Kirill" , "dev@dpdk.org" CC: "Rybalchenko, Kirill" , "Chilikin, Andrey" , "Xing, Beilei" , "Wu, Jingjing" Thread-Topic: [dpdk-dev] [PATCH v2 2/2] app/testpmd: get information about protocols defined in ddp profile Thread-Index: AQHTIzu3sR2s2/poK0Kw3kvbNir5HaKksKVw Date: Mon, 4 Sep 2017 12:44:38 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C24E0442B3@IRSMSX108.ger.corp.intel.com> References: <4075836-102681-1-git-send-email-kirill.rybalchenko@intel.com> <1504281685-54502-1-git-send-email-kirill.rybalchenko@intel.com> <1504281685-54502-3-git-send-email-kirill.rybalchenko@intel.com> In-Reply-To: <1504281685-54502-3-git-send-email-kirill.rybalchenko@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjMwODRlMDYtNGQyNS00ODU3LThiMzctNzVjNmQ0N2MyNGYwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Im1vYUVFK3kxNFRrcUMrQUcyam5mZGo5MGNoRkZcL1NtZHN3cXdhdkN3NExNPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 2/2] app/testpmd: get information about protocols defined in ddp profile 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, 04 Sep 2017 12:45:08 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Kirill Rybalchenko > Sent: Friday, September 1, 2017 5:01 PM > To: dev@dpdk.org > Cc: Rybalchenko, Kirill ; Chilikin, Andrey > ; Xing, Beilei ; Wu, > Jingjing > Subject: [dpdk-dev] [PATCH v2 2/2] app/testpmd: get information about > protocols defined in ddp profile >=20 > Update 'ddp get info' command to display protocols defined in a profile >=20 > Signed-off-by: Kirill Rybalchenko > --- > app/test-pmd/cmdline.c | 98 > +++++++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 97 insertions(+), 1 deletion(-) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > 0144191..1402c6d 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -13423,12 +13423,18 @@ cmd_ddp_info_parsed( > uint32_t pkg_size; > int ret =3D -ENOTSUP; > #ifdef RTE_LIBRTE_I40E_PMD > - uint32_t i; > + uint32_t i, j, n; > uint8_t *buff; > uint32_t buff_size; > struct rte_pmd_i40e_profile_info info; > uint32_t dev_num; > struct rte_pmd_i40e_ddp_device_id *devs; > + uint32_t proto_num; > + struct rte_pmd_i40e_proto_info *proto; > + uint32_t pctype_num; > + struct rte_pmd_i40e_ptype_info *pctype; > + uint32_t ptype_num; > + struct rte_pmd_i40e_ptype_info *ptype; > #endif >=20 > pkg =3D open_ddp_package_file(res->filepath, &pkg_size); @@ - > 13502,6 +13508,96 @@ cmd_ddp_info_parsed( > free(devs); > } > } > + > + /* get information about protocols and packet types */ > + ret =3D rte_pmd_i40e_get_ddp_info(pkg, pkg_size, > + (uint8_t *)&proto_num, sizeof(proto_num), > + RTE_PMD_I40E_PKG_INFO_PROTOCOL_NUM); > + if (!ret && proto_num) { > + uint8_t proto_id; > + > + proto =3D (struct rte_pmd_i40e_proto_info *) > + malloc(proto_num * sizeof(struct > rte_pmd_i40e_proto_info)); > + if (proto) { > + ret =3D rte_pmd_i40e_get_ddp_info(pkg, pkg_size, > + (uint8_t *)proto, proto_num, > + > RTE_PMD_I40E_PKG_INFO_PROTOCOL_LIST); > + if (!ret) { > + printf("List of used protocols:\n"); > + for (i =3D 0; i < proto_num; i++) > + printf(" %2u: %s\n", > proto[i].proto_id, > + proto[i].name); > + printf("\n"); > + } > + ret =3D rte_pmd_i40e_get_ddp_info(pkg, pkg_size, > + (uint8_t *)&pctype_num, > sizeof(pctype_num), > + RTE_PMD_I40E_PKG_INFO_PCTYPE_NUM); > + if (!ret && pctype_num) { > + pctype =3D (struct rte_pmd_i40e_ptype_info *) > + malloc(pctype_num * > + sizeof(struct > rte_pmd_i40e_ptype_info)); > + if (pctype) { > + ret =3D > rte_pmd_i40e_get_ddp_info(pkg, pkg_size, > + (uint8_t *)pctype, > pctype_num, > + > RTE_PMD_I40E_PKG_INFO_PCTYPE_LIST); > + if (!ret) { > + printf("List of defined packet > classification types:\n"); > + for (i =3D 0; i < pctype_num; > i++) { > + printf(" %2u:", > pctype[i].ptype_id); > + for (j =3D 0; j < > RTE_PMD_I40E_PROTO_NUM; j++) { > + proto_id =3D > pctype[i].protocols[j]; > + if (proto_id !=3D > RTE_PMD_I40E_PROTO_UNUSED) { > + for (n > =3D 0; n < proto_num; n++) { > + > if (proto[n].proto_id =3D=3D proto_id) { > + > printf(" %s", proto[n].name); > + > break; > + > } > + } > + } > + } > + printf("\n"); > + } > + printf("\n"); > + } > + free(pctype); > + } > + } > + ret =3D rte_pmd_i40e_get_ddp_info(pkg, pkg_size, > + (uint8_t *)&ptype_num, sizeof(ptype_num), > + RTE_PMD_I40E_PKG_INFO_PTYPE_NUM); > + if (!ret && ptype_num) { > + ptype =3D (struct rte_pmd_i40e_ptype_info *) > + malloc(ptype_num * > + sizeof(struct > rte_pmd_i40e_ptype_info)); > + if (ptype) { > + ret =3D > rte_pmd_i40e_get_ddp_info(pkg, pkg_size, > + (uint8_t *)ptype, > ptype_num, > + > RTE_PMD_I40E_PKG_INFO_PTYPE_LIST); > + if (!ret) { > + printf("List of defined packet > types:\n"); > + for (i =3D 0; i < ptype_num; i++) > { > + printf(" %2u:", > ptype[i].ptype_id); > + for (j =3D 0; j < > RTE_PMD_I40E_PROTO_NUM; j++) { > + proto_id =3D > ptype[i].protocols[j]; > + if (proto_id !=3D > RTE_PMD_I40E_PROTO_UNUSED) { > + for (n > =3D 0; n < proto_num; n++) { > + > if (proto[n].proto_id =3D=3D proto_id) { > + > printf(" %s", proto[n].name); > + > break; > + > } > + } > + } > + } > + printf("\n"); > + } > + } > + free(ptype); > + } > + printf("\n"); > + } > + free(proto); > + } > + } > ret =3D 0; > #endif > if (ret =3D=3D -ENOTSUP) > -- > 2.5.5