From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 51B2C2BA8 for ; Thu, 8 Dec 2016 16:10:57 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP; 08 Dec 2016 07:10:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,320,1477983600"; d="scan'208";a="1096455692" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by fmsmga002.fm.intel.com with ESMTP; 08 Dec 2016 07:10:53 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.43]) by IRSMSX151.ger.corp.intel.com ([169.254.4.16]) with mapi id 14.03.0248.002; Thu, 8 Dec 2016 15:10:52 +0000 From: "Ananyev, Konstantin" To: Neil Horman , =?iso-8859-1?Q?N=E9lio_Laranjeiro?= CC: "dev@dpdk.org" , "Richardson, Bruce" , "Wiles, Keith" , =?iso-8859-1?Q?Morten_Br=F8rup?= , "Lu, Wenzhuo" , Olivier Matz Thread-Topic: [PATCH] net: introduce big and little endian types Thread-Index: AQHSUTW3FYGgilYI2ka3ChI+0C1wvaD+JyCAgAAA3OA= Date: Thu, 8 Dec 2016 15:10:51 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772583F0E5804@irsmsx105.ger.corp.intel.com> References: <20161208093005.GD21794@autoinstall.dev.6wind.com> <20161208150721.GB4657@hmsreliant.think-freely.org> In-Reply-To: <20161208150721.GB4657@hmsreliant.think-freely.org> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net: introduce big and little endian types 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, 08 Dec 2016 15:10:57 -0000 > -----Original Message----- > From: Neil Horman [mailto:nhorman@tuxdriver.com] > Sent: Thursday, December 8, 2016 3:07 PM > To: N=E9lio Laranjeiro > Cc: dev@dpdk.org; Ananyev, Konstantin ; Ric= hardson, Bruce ; Wiles, > Keith ; Morten Br=F8rup = ; Lu, Wenzhuo ; Olivier Matz > > Subject: Re: [PATCH] net: introduce big and little endian types >=20 > On Thu, Dec 08, 2016 at 10:30:05AM +0100, N=E9lio Laranjeiro wrote: > > Hi all, > > > > Following previous discussions, I would like to gather requirements for > > v2, currently we have: > > > > 1. Introduction of new typedefs. > > 2. Modification of network headers. > > 3. Modification of rte_*_to_*() functions. > > > > Point 1. seems not to be an issue, everyone seems to agree on the fact > > having those types could help to document some parts of the code. > > > No objection here >=20 > > Point 2. does not cause any ABI change as it is only a documentation > > commit, not sure if anyone disagrees about this. > > > I have an objection here, and I think it was stated by others previously.= While > its fine to offer endian encoded types so that developers can use them > expediently, I don't like the idea of coding them into network headers > specifically. I assert that because network headers represent multiple v= iews of > network data (both network byte order if the data is taken off the wire a= nd cpu > byte order if its translated. To implement such a network header change > efficiently what you would need is something like the following: >=20 > struct rte_ip_network_hdr { > rte_le_u32 dst; > rte_le_u32 src; > ... > }; >=20 > struct rte_ip_cpu_hdr { > rte_cpu_u32 dst; > rte_cpu_u32 src; > ... > }; >=20 > where rte_cpu_* is defined to a big endian or little endian type based on= the > cpu being targeted. >=20 > Then of course you need to define translation macros to do all the approp= riate > conversions convieniently (or you need to do specific translations on the > network byte order as needed, which may lead to lots of repeated conversi= ons). > Regardless, this seems to be unscalable. Endian types are the sort of thi= ng that > you should only use sparingly, not by default. +1 >=20 > > Point 3. documentation commit most people are uncomfortable with. > > I propose to drop it from v2. > > > > Any objection to this plan? > > > > -- > > N=E9lio Laranjeiro > > 6WIND > >