DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: dev@dpdk.org, Hemant Agrawal <hemant.agrawal@nxp.com>,
	Jerin Jacob <Jerin.Jacob@cavium.com>,
	Thomas Monjalon <thomas.monjalon@6wind.com>
Subject: Re: [dpdk-dev] [PATCH] pmdinfogen: Fix pmdinfogen to select proper endianess on cross-compile
Date: Mon, 21 Nov 2016 10:11:33 +0000	[thread overview]
Message-ID: <20161121101133.GC16124@bricha3-MOBL3.ger.corp.intel.com> (raw)
In-Reply-To: <1479494872-9302-1-git-send-email-nhorman@tuxdriver.com>

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 <nhorman@tuxdriver.com>
> CC: Hemant Agrawal <hemant.agrawal@nxp.com>
> CC: Jerin Jacob <Jerin.Jacob@cavium.com>
> CC: Bruce Richardson <bruce.richardson@intel.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
>  buildtools/pmdinfogen/pmdinfogen.h | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)

Compiles fine on FreeBSD with clang.

Tested-by: Bruce Richardson <bruce.richardson@intel.com>

  reply	other threads:[~2016-11-21 10:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 18:47 Neil Horman
2016-11-21 10:11 ` Bruce Richardson [this message]
2016-12-01 15:17   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161121101133.GC16124@bricha3-MOBL3.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=Jerin.Jacob@cavium.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=nhorman@tuxdriver.com \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).