From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 9C3905A06 for ; Wed, 25 Mar 2015 07:37:23 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 24 Mar 2015 23:37:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,463,1422950400"; d="scan'208";a="685247180" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by fmsmga001.fm.intel.com with ESMTP; 24 Mar 2015 23:37:22 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 25 Mar 2015 14:34:42 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.149]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.108]) with mapi id 14.03.0224.002; Wed, 25 Mar 2015 14:34:32 +0800 From: "Zhang, Helin" To: "xuelin.shi@freescale.com" , "thomas.monjalon@6wind.com" Thread-Topic: [dpdk-dev] [PATCH] e1000: fix e1000 PCI access endian issue. Thread-Index: AQHQRmwXfyXVRORIIU6GqjFZeHYNYJ0s/oYw Date: Wed, 25 Mar 2015 06:34:31 +0000 Message-ID: References: <1423704412-29143-1-git-send-email-xuelin.shi@freescale.com> In-Reply-To: <1423704412-29143-1-git-send-email-xuelin.shi@freescale.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] e1000: fix e1000 PCI access endian issue. 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: Wed, 25 Mar 2015 06:37:24 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of > xuelin.shi@freescale.com > Sent: Thursday, February 12, 2015 9:27 AM > To: thomas.monjalon@6wind.com > Cc: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] e1000: fix e1000 PCI access endian issue. >=20 > From: Xuelin Shi >=20 > e1000 is little endian, but cpu maybe not. > add necessary conversions. >=20 > rte_cpu_to_le_32(...) for PCI write > rte_le_to_cpu_32(...) for PCI read. >=20 > Signed-off-by: Xuelin Shi Acked-by: Helin Zhang > --- > lib/librte_pmd_e1000/e1000/e1000_osdep.h | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/librte_pmd_e1000/e1000/e1000_osdep.h > b/lib/librte_pmd_e1000/e1000/e1000_osdep.h > index 438641e..d04ec73 100644 > --- a/lib/librte_pmd_e1000/e1000/e1000_osdep.h > +++ b/lib/librte_pmd_e1000/e1000/e1000_osdep.h > @@ -43,6 +43,7 @@ > #include > #include > #include > +#include >=20 > #include "../e1000_logs.h" >=20 > @@ -96,7 +97,7 @@ typedef int bool; > #define E1000_PCI_REG(reg) (*((volatile uint32_t *)(reg))) >=20 > #define E1000_PCI_REG_WRITE(reg, value) do { \ > - E1000_PCI_REG((reg)) =3D (value); \ > + E1000_PCI_REG((reg)) =3D (rte_cpu_to_le_32(value)); \ > } while (0) >=20 > #define E1000_PCI_REG_ADDR(hw, reg) \ > @@ -107,7 +108,7 @@ typedef int bool; >=20 > static inline uint32_t e1000_read_addr(volatile void* addr) { > - return E1000_PCI_REG(addr); > + return rte_le_to_cpu_32(E1000_PCI_REG(addr)); > } >=20 > /* Necessary defines */ > -- > 1.9.1