From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D9153108A for ; Tue, 7 Mar 2017 03:37:08 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2017 18:37:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,256,1484035200"; d="scan'208,217";a="1138804761" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 06 Mar 2017 18:37:07 -0800 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 6 Mar 2017 18:37:07 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 6 Mar 2017 18:37:07 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Tue, 7 Mar 2017 10:37:03 +0800 From: "Zhang, Qi Z" To: "Yigit, Ferruh" , "Wu, Jingjing" , "Zhang, Helin" CC: "dev@dpdk.org" , "Lu, Wenzhuo" Thread-Topic: [dpdk-dev] [PATCH 2/2] net/i40e: configurable PTYPE mapping Thread-Index: AQHSkK7BxHhZ/V+MhEivI/J7XoNPV6GHdi4AgAEd4gA= Date: Tue, 7 Mar 2017 02:37:02 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153063970@SHSMSX103.ccr.corp.intel.com> References: <20170227045612.48030-1-qi.z.zhang@intel.com> <20170227045612.48030-3-qi.z.zhang@intel.com> <45a02a73-102d-129a-43da-605d8bdc271e@intel.com> In-Reply-To: <45a02a73-102d-129a-43da-605d8bdc271e@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODE4ZTc1ZDctZTVlYy00MzIxLWIwNDItNTZkZDAwZTU2ZjEzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlplZEF5OVBUTW9SVTlJRFRlaVFXcnFhODBFS2MzSWRwZWdFUDdaaWF2SjA9In0= 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 2/2] net/i40e: configurable PTYPE 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: Tue, 07 Mar 2017 02:37:09 -0000 Hi Ferruh: =09 Thanks all the good suggestion and help. =09 > -----Original Message----- > From: Yigit, Ferruh > Sent: Monday, March 6, 2017 11:32 PM > To: Zhang, Qi Z ; Wu, Jingjing > ; Zhang, Helin > Cc: dev@dpdk.org; Lu, Wenzhuo > Subject: Re: [dpdk-dev] [PATCH 2/2] net/i40e: configurable PTYPE mapping >=20 > On 2/27/2017 4:56 AM, Qi Zhang wrote: > > The patch adds 4 APIs to support configurable PTYPE mapping for i40e > > device. > > rte_pmd_i40e_update_ptype_mapping. > > rte_pmd_i40e_reset_ptype_mapping. > > rte_pmd_i40e_get_ptype_mapping. > > rte_pmd_i40e_replace_ptype_mapping. >=20 > Hi Qi, >=20 > These are added as PMD specific APIs, but not used anywhere, how did you > test them? Or how others can test it? >=20 > Does it make sense to add them into testpmd? >=20 Yes, I plan to add=20 >=20 >=20 > And related to API naming, what do you think about following syntax: > __ ? >=20 > This helps finding APIs for same object (ptype_mapping for this case): >=20 > rte_pmd_i40e_ptype_mapping_update() > rte_pmd_i40e_ptype_mapping_reset() > rte_pmd_i40e_ptype_mapping_get() > rte_pmd_i40e_ptype_mapping_replace() Agree, that's good. >=20 >=20 > And not directly related to this patch, but it is good idea to extract PM= D > specific APIs into separate file, would you mind taking that task before = this > patch? And add these new APIs to that new file? >=20 I like this idea, since we have many changes on this recently, I'd better d= iscuss with=20 other team member to decide if do the separation before merge or after the = merge. >=20 > > The mapping from hardware defined packet type to software defined > > packet type can be updated/reset/read out with these APIs. > > Also a software ptype with the most significent bit set will be > > regarded as a custom defined ptype > > (RTE_PMD_I40E_PTYPE_USER_DEFINE_MASK) so application can use it to > defined its own PTYPE naming system. > > > > Signed-off-by: Qi Zhang > > --- > > drivers/net/i40e/i40e_ethdev.c | 190 > ++++++++++++++++++++++++++++++++++++++++ > > drivers/net/i40e/i40e_rxtx.c | 1 - > > drivers/net/i40e/i40e_rxtx.h | 2 + > > drivers/net/i40e/rte_pmd_i40e.h | 81 +++++++++++++++++ >=20 > Need to update *version.map file too, for shared library build. It is har= d to > catch these issues since APIs are not used. >=20 Will fix. > <...> >=20 > > + > > +int rte_pmd_i40e_update_ptype_mapping( >=20 > DPDK coding convention suggest having return type in separate line: > int > rte_pmd_i40e_update_ptype_mapping(... >=20 > > + uint8_t port, > > + struct rte_pmd_i40e_ptype_mapping *mapping_items, > > + uint16_t count, > > + uint8_t exclusive) > > +{ > > + struct rte_eth_dev *dev; > > + struct i40e_adapter *ad; > > + int i; >=20 > For PMD specific APIs, port_id needs to be verified if it is i40e port or= not. > There is already is_device_supported() function in i40e for this. Thanks >=20 > CC'ed Wenzhuo, he already did this a few times, and may help. >=20 > <...> >=20 > > +/** > > + * Update hardware defined ptype to software defined packet type > > + * mapping table. > > + * > > + * @param port > > + * pointer to port identifier of the device. > > + * @param mapping_items > > + * the base address of the mapping items array. > > + * @param count > > + * number of mapping items. > > + * @param exclusive > > + * the flag indicate different ptype mapping update method. > > + * -(0) only overwrite refferred PTYPE mapping, >=20 > referred >=20 > > + * keep other PTYPEs mapping unchanged. > > + * -(!0) overwrite referred PTYPE mapping, > > + * set other PTYPEs maps to PTYPE_UNKNOWN. > > + */ > > +int rte_pmd_i40e_update_ptype_mapping( > > + uint8_t port, > > + struct rte_pmd_i40e_ptype_mapping *mapping_items, > > + uint16_t count, > > + uint8_t exclusive); > > + > > +/** > > + * Reset hardware defined ptype to software defined ptype > > + * mapping table to default. > > + * > > + * @param port > > + * pointer to port identifiier of the device >=20 > s/identifiier/identifier >=20 > <...> >=20 > > +/** > > + * Replace a specific or a group of software defined ptypes > > + * with a new one > > + * > > + * @param port > > + * pointer to port identifier of the device > > + * @param target > > + * the packet type to be replaced > > + * @param mask > > + * -(0) target represent a specific software defined ptype. > > + * -(!0) target is a mask to represent a group of software defined > ptypes. > > + * @param pkt_type > > + * the new packet type to overwrite > > + */ > > +int rte_pmd_i40e_replace_pkt_type(uint8_t port, > > + uint32_t target, > > + uint8_t mask, > > + uint32_t pkt_type); >=20 > API names does not match with one in commit log, and "pkt_type" usage is > not consistent with other APIs. Will fix. >=20 > > + > > #endif /* _PMD_I40E_H_ */ > >