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 0AF3E558C for ; Mon, 21 Nov 2016 11:11:37 +0100 (CET) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP; 21 Nov 2016 02:11:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,674,1473145200"; d="scan'208";a="33911913" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.64]) by fmsmga005.fm.intel.com with SMTP; 21 Nov 2016 02:11:34 -0800 Received: by (sSMTP sendmail emulation); Mon, 21 Nov 2016 10:11:33 +0000 Date: Mon, 21 Nov 2016 10:11:33 +0000 From: Bruce Richardson To: Neil Horman Cc: dev@dpdk.org, Hemant Agrawal , Jerin Jacob , Thomas Monjalon Message-ID: <20161121101133.GC16124@bricha3-MOBL3.ger.corp.intel.com> References: <1479494872-9302-1-git-send-email-nhorman@tuxdriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1479494872-9302-1-git-send-email-nhorman@tuxdriver.com> Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?= =?iso-8859-1?Q?opment?= Ireland Ltd. User-Agent: Mutt/1.7.1 (2016-10-04) Subject: Re: [dpdk-dev] [PATCH] pmdinfogen: Fix pmdinfogen to select proper endianess on cross-compile X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2016 10:11:38 -0000 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