From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id EAD74568A for ; Fri, 17 Jul 2015 09:25:50 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 17 Jul 2015 00:25:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,494,1432623600"; d="scan'208";a="764364665" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 17 Jul 2015 00:25:49 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t6H7PlvA003319; Fri, 17 Jul 2015 15:25:47 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t6H7Phlb007883; Fri, 17 Jul 2015 15:25:45 +0800 Received: (from zhetao@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t6H7Ph6k007879; Fri, 17 Jul 2015 15:25:43 +0800 From: Zhe Tao To: dev@dpdk.org Date: Fri, 17 Jul 2015 15:25:40 +0800 Message-Id: <1437117940-7849-1-git-send-email-zhe.tao@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1437104817-13578-1-git-send-email-zhe.tao@intel.com> References: <1437104817-13578-1-git-send-email-zhe.tao@intel.com> Subject: [dpdk-dev] [PATCH v3] i40e: Fix the endian issue for the i40e read&write registers functions 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: Fri, 17 Jul 2015 07:25:51 -0000 Signed-off-by: Zhe Tao --- PATCH v3: Edit the subject make it more clear PATCH v2: Edit the comments make it more clear PATCH v1: Add the endian conversion for registers operations. drivers/net/i40e/base/i40e_osdep.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/base/i40e_osdep.h b/drivers/net/i40e/base/i40e_osdep.h index 3ce8057..70d2721 100644 --- a/drivers/net/i40e/base/i40e_osdep.h +++ b/drivers/net/i40e/base/i40e_osdep.h @@ -122,10 +122,10 @@ do { \ ((volatile uint32_t *)((char *)(a)->hw_addr + (reg))) static inline uint32_t i40e_read_addr(volatile void *addr) { - return I40E_PCI_REG(addr); + return rte_le_to_cpu_32(I40E_PCI_REG(addr)); } #define I40E_PCI_REG_WRITE(reg, value) \ - do {I40E_PCI_REG((reg)) = (value);} while(0) + do { I40E_PCI_REG((reg)) = rte_cpu_to_le_32(value); } while (0) #define I40E_WRITE_FLUSH(a) I40E_READ_REG(a, I40E_GLGEN_STAT) #define I40EVF_WRITE_FLUSH(a) I40E_READ_REG(a, I40E_VFGEN_RSTAT) -- 1.9.3