From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <jijiangl@shecgisg004.sh.intel.com>
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id 852A65ACD
 for <dev@dpdk.org>; Fri, 23 Jan 2015 06:35:58 +0100 (CET)
Received: from orsmga002.jf.intel.com ([10.7.209.21])
 by orsmga103.jf.intel.com with ESMTP; 22 Jan 2015 21:31:51 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.09,453,1418112000"; d="scan'208";a="674595595"
Received: from shvmail01.sh.intel.com ([10.239.29.42])
 by orsmga002.jf.intel.com with ESMTP; 22 Jan 2015 21:35:55 -0800
Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com
 [10.239.29.89])
 by shvmail01.sh.intel.com with ESMTP id t0N5ZqI8003731;
 Fri, 23 Jan 2015 13:35:52 +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
 t0N5ZoW7022016; Fri, 23 Jan 2015 13:35:52 +0800
Received: (from jijiangl@localhost)
 by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t0N5ZnG5022012;
 Fri, 23 Jan 2015 13:35:49 +0800
From: Jijiang Liu <jijiang.liu@intel.com>
To: dev@dpdk.org
Date: Fri, 23 Jan 2015 13:35:40 +0800
Message-Id: <1421991340-21960-4-git-send-email-jijiang.liu@intel.com>
X-Mailer: git-send-email 1.7.12.2
In-Reply-To: <1421991340-21960-1-git-send-email-jijiang.liu@intel.com>
References: <1421991340-21960-1-git-send-email-jijiang.liu@intel.com>
Subject: [dpdk-dev] [PATCH 3/3] lib/eal:igb_uio driver change
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: Fri, 23 Jan 2015 05:35:58 -0000

Replace the CONFIG_XEN_DOM0 with the CONFIG_XEN and RTE_LIBRTE_XEN_DOM0 in the driver in order to mmap IO memory correctly.

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
index ba1364b..7f643be 100644
--- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
+++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
@@ -32,7 +32,7 @@
 #include <linux/msi.h>
 #include <linux/version.h>
 
-#ifdef CONFIG_XEN_DOM0
+#ifdef CONFIG_XEN
 #include <xen/xen.h>
 #endif
 #include <rte_pci_dev_features.h>
@@ -279,7 +279,7 @@ igbuio_pci_irqhandler(int irq, struct uio_info *info)
 	return IRQ_HANDLED;
 }
 
-#ifdef CONFIG_XEN_DOM0
+#ifdef RTE_LIBRTE_XEN_DOM0 
 static int
 igbuio_dom0_mmap_phys(struct uio_info *info, struct vm_area_struct *vma)
 {
@@ -287,9 +287,7 @@ igbuio_dom0_mmap_phys(struct uio_info *info, struct vm_area_struct *vma)
 
 	idx = (int)vma->vm_pgoff;
 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-#ifdef HAVE_PTE_MASK_PAGE_IOMAP
 	vma->vm_page_prot.pgprot |= _PAGE_IOMAP;
-#endif
 
 	return remap_pfn_range(vma,
 			vma->vm_start,
@@ -487,7 +485,7 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	udev->info.version = "0.1";
 	udev->info.handler = igbuio_pci_irqhandler;
 	udev->info.irqcontrol = igbuio_pci_irqcontrol;
-#ifdef CONFIG_XEN_DOM0
+#ifdef RTE_LIBRTE_XEN_DOM0
 	/* check if the driver run on Xen Dom0 */
 	if (xen_initial_domain())
 		udev->info.mmap = igbuio_dom0_pci_mmap;
-- 
1.7.7.6