From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-we0-f170.google.com (mail-we0-f170.google.com
 [74.125.82.170]) by dpdk.org (Postfix) with ESMTP id 41527106B
 for <dev@dpdk.org>; Mon, 23 Mar 2015 15:04:37 +0100 (CET)
Received: by wetk59 with SMTP id k59so138743942wet.3
 for <dev@dpdk.org>; Mon, 23 Mar 2015 07:04:37 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:organization
 :user-agent:in-reply-to:references:mime-version
 :content-transfer-encoding:content-type;
 bh=MYamlhIn0pt2CKsv7RWDbH0NIP1A+JUaU7WQ0zDzAWI=;
 b=Xc9gZ4cyBGhzDKNQocjHuSNuMZTXzuH5yYklHMWNa+1sma8jXunKj3AEHoRzR+b/CV
 8ln8stnXO3uQjFn8TAdBrYqpT2mT2NdLIo+fIY/SgqMGF7/5HwI/J91QZUeb8gfI9mN9
 sXpiYzkgCbeCg3XZlVUuRdNZ+NqngLG1Wy810GVsblfb0sv5050oKvfi/nP0gsgttAzr
 i34qAr8o9WPphikwx0aRet2+SwBRqpsecGPgcx1uLNHsJ1IKop24bb3Kg0EjJGXBem6W
 c9OT6reix5ypPDwcnwFMBX+vS4PGviCrHTZ/vEiwNcsjB98+8dp5niBRlLJvXSrm5nao
 2c/g==
X-Gm-Message-State: ALoCoQkNaEGZHvsMbFaD5IsouEv43xVkcyG7SC/xOK/r0vNgX2Sd6htIEivKqQyDJS96mX131E9n
X-Received: by 10.194.61.244 with SMTP id t20mr178157165wjr.83.1427119476924; 
 Mon, 23 Mar 2015 07:04:36 -0700 (PDT)
Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136])
 by mx.google.com with ESMTPSA id u16sm1569845wjr.5.2015.03.23.07.04.35
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 23 Mar 2015 07:04:36 -0700 (PDT)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: xuelin.shi@freescale.com
Date: Mon, 23 Mar 2015 15:03:55 +0100
Message-ID: <1898378.inXpMq60NG@xps13>
Organization: 6WIND
User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; )
In-Reply-To: <20150309140237.GB5848@bricha3-MOBL3>
References: <1425450852-24837-1-git-send-email-xuelin.shi@freescale.com>
 <20150309140237.GB5848@bricha3-MOBL3>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] librte_lpm: define tbl entry reversely for
	big endian
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 23 Mar 2015 14:04:37 -0000

2015-03-09 14:02, Bruce Richardson:
> On Wed, Mar 04, 2015 at 02:34:12PM +0800, xuelin.shi@freescale.com wrote:
> > From: Xuelin Shi <xuelin.shi@freescale.com>
> > 
> > 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 <xuelin.shi@freescale.com>
> 
> 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 <rte_byteorder.h>" 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
>