From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] librte_lpm: define tbl entry reversely for big endian Date: Mon, 23 Mar 2015 15:03:55 +0100 Message-ID: <1898378.inXpMq60NG@xps13> References: <1425450852-24837-1-git-send-email-xuelin.shi@freescale.com> <20150309140237.GB5848@bricha3-MOBL3> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: xuelin.shi-KZfg59tc24xl57MIdRCFDg@public.gmane.org Return-path: In-Reply-To: <20150309140237.GB5848@bricha3-MOBL3> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 2015-03-09 14:02, Bruce Richardson: > On Wed, Mar 04, 2015 at 02:34:12PM +0800, xuelin.shi-KZfg59tc24xl57MIdRCFDg@public.gmane.org wrote: > > From: Xuelin Shi > > > > This module uses type conversion between struct and int. > > Also truncation and comparison is used with this int. > > It is not safe for different endian arch. > > > > Add ifdef for big endian struct to fix this issue. > > > > Signed-off-by: Xuelin Shi > > Get an error compiling this up (using clang on FreeBSD). > > CC rte_lpm.o > In file included from /usr/home/bruce/dpdk.org/lib/librte_lpm/rte_lpm.c:57: > /usr/home/bruce/dpdk.org/lib/librte_lpm/rte_lpm.h:99:5: fatal error: 'RTE_BYTE_ORDER' is not defined, evaluates to 0 [-Wundef] > #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN > ^ > 1 error generated. > > Adding "#include " should fix the issue. Please Xuelin, could you submit a v2? Thanks > Existing unit tests on IA (little endian) pass fine there-after, but I think for > this patch it would be good to have an ack from someone who can validate on > a big endian system, since this is what this patch is meant to enable. > > /Bruce >