From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id D18E32BA8 for ; Tue, 6 Dec 2016 12:23:45 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP; 06 Dec 2016 03:23:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,309,1477983600"; d="scan'208";a="39279434" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga005.jf.intel.com with ESMTP; 06 Dec 2016 03:23:43 -0800 Received: from irsmsx111.ger.corp.intel.com (10.108.20.4) by IRSMSX108.ger.corp.intel.com (163.33.3.3) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 6 Dec 2016 11:23:43 +0000 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.43]) by irsmsx111.ger.corp.intel.com ([169.254.2.55]) with mapi id 14.03.0248.002; Tue, 6 Dec 2016 11:23:42 +0000 From: "Ananyev, Konstantin" To: =?iso-8859-1?Q?N=E9lio_Laranjeiro?= CC: "dev@dpdk.org" , Olivier Matz , "Lu, Wenzhuo" , Adrien Mazarguil Thread-Topic: [dpdk-dev] [PATCH] net: introduce big and little endian types Thread-Index: AQHSOpqjJZEmwRN0kU6+9TJvUFcv9KD4oKeAgADKCYCAAX/vkA== Date: Tue, 6 Dec 2016 11:23:42 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772583F0E4632@irsmsx105.ger.corp.intel.com> References: <2601191342CEEE43887BDE71AB9772583F0E3F68@irsmsx105.ger.corp.intel.com> <20161205120603.GL21794@autoinstall.dev.6wind.com> In-Reply-To: <20161205120603.GL21794@autoinstall.dev.6wind.com> 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: Tue, 06 Dec 2016 11:23:46 -0000 Hi Neilo, Hi Neilo, > > > > > > This commit introduces new rte_{le,be}{16,32,64}_t types and updates > > > rte_{le,be,cpu}_to_{le,be,cpu}_*() and network header structures > > > accordingly. > > > > > > Specific big/little endian types avoid uncertainty and conversion mis= takes. > > > > > > No ABI change since these are simply typedefs to the original types. > > > > It seems like quite a lot of changes... > > Could you probably explain what will be the benefit in return? > > Konstantin >=20 > Hi Konstantin, >=20 > The benefit is to provide documented byte ordering for data types > software is manipulating to determine when network to CPU (or CPU to > network) conversion must be performed. Ok, but is it really worth it? User can still make a mistake and forget to call ntoh()/hton() at some part= icular place. >>From other side most people do know that network protocols headers are usua= lly in BE format.=20 I would understand the effort, if we'll have some sort of tool that would d= o some sort of static code analysis based on these special types or so. Again, does it mean that we should go and change uint32_t to rte_le_32 insi= de all Intel PMDs (and might be in some others too) to be consistent? Konstantin >=20 > Regards, >=20 > -- > N=E9lio Laranjeiro > 6WIND