From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] pmdinfogen: Fix pmdinfogen to select proper endianess on cross-compile Date: Thu, 01 Dec 2016 16:17:44 +0100 Message-ID: <2826296.pI5ECjk531@xps13> References: <1479494872-9302-1-git-send-email-nhorman@tuxdriver.com> <20161121101133.GC16124@bricha3-MOBL3.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Bruce Richardson , dev@dpdk.org, Hemant Agrawal , Jerin Jacob , stable@dpdk.org To: Neil Horman Return-path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 4C82658EC for ; Thu, 1 Dec 2016 16:17:46 +0100 (CET) Received: by mail-wm0-f41.google.com with SMTP id g23so302611110wme.1 for ; Thu, 01 Dec 2016 07:17:46 -0800 (PST) In-Reply-To: <20161121101133.GC16124@bricha3-MOBL3.ger.corp.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-11-21 10:11, Bruce Richardson: > On Fri, Nov 18, 2016 at 01:47:52PM -0500, Neil Horman wrote: > > pmdinfogen has a bug in which, during build, it pulls in rte_byteorder.h to > > obtain the rte macros for byteswapping between the cpu byte order and big or > > little endian. Unfortunately, pmdinfogen is a tool that is only meant to be run > > during the build of dpdk components, and so, it runs on the host. In cross > > compile environments however, the rte_byteorder.h is configured using a target > > cpu, who's endianess may differ from that of the host, leading to improper > > swapping. > > > > The fix is to use host system defined byte swapping routines rather than the > > dpdk provided routines. Note that we are using non posix compliant routines, as > > the posix compliant api only addresses 16 and 32 bit swaps, and we also need 64 > > bit swaps. Those macros exist (via endian.h), but BSD and Linux put that header > > in different locations so some ifdeffery is required. > > > > Tested successfully by myself on Linux and BSD systems. > > > > Signed-off-by: Neil Horman > > CC: Hemant Agrawal > > CC: Jerin Jacob > > CC: Bruce Richardson > > CC: Thomas Monjalon > > --- > > buildtools/pmdinfogen/pmdinfogen.h | 10 +++++++--- > > 1 file changed, 7 insertions(+), 3 deletions(-) > > Compiles fine on FreeBSD with clang. > > Tested-by: Bruce Richardson Fixed "endianness" typo, headline, added Fixes:, CC: stable@dpdk.org and removed a trailing whitespace, then applied, thanks