From patchwork Thu Dec 11 19:33:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shu Shen X-Patchwork-Id: 1957 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id BFF026A87; Thu, 11 Dec 2014 20:34:16 +0100 (CET) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0148.outbound.protection.outlook.com [157.56.110.148]) by dpdk.org (Postfix) with ESMTP id 028F468BE for ; Thu, 11 Dec 2014 20:34:15 +0100 (CET) Received: from CO2PR0801MB679.namprd08.prod.outlook.com (10.141.248.12) by CO2PR0801MB0760.namprd08.prod.outlook.com (25.160.10.16) with Microsoft SMTP Server (TLS) id 15.1.31.17; Thu, 11 Dec 2014 19:34:12 +0000 Received: from radisys.com (209.82.16.66) by CO2PR0801MB679.namprd08.prod.outlook.com (10.141.248.12) with Microsoft SMTP Server (TLS) id 15.1.31.17; Thu, 11 Dec 2014 19:34:09 +0000 From: Shu Shen To: Date: Thu, 11 Dec 2014 11:33:23 -0800 Message-ID: <1418326403-27870-1-git-send-email-shu.shen@radisys.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [209.82.16.66] X-ClientProxiedBy: CO1PR06CA054.namprd06.prod.outlook.com (10.242.160.44) To CO2PR0801MB679.namprd08.prod.outlook.com (10.141.248.12) X-Microsoft-Antispam: UriScan:;UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CO2PR0801MB679; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601003); SRVR:CO2PR0801MB679; X-Forefront-PRVS: 0422860ED4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(105586002)(106356001)(19580395003)(81156004)(97736003)(46102003)(69596002)(2351001)(50226001)(19580405001)(229853001)(99396003)(120916001)(107046002)(4396001)(31966008)(21056001)(87976001)(89996001)(42186005)(47776003)(77156002)(62966003)(20776003)(64706001)(450100001)(68736005)(50986999)(50466002)(40100003)(48376002)(101416001)(92566001)(122386002)(110136001)(36756003)(33646002)(66066001)(77096005)(86362001); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR0801MB679; H:radisys.com; FPR:; SPF:None; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:; SRVR:CO2PR0801MB679; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CO2PR0801MB0760; X-OriginatorOrg: radisys.com Subject: [dpdk-dev] [PATCH] igb_uio: fix Xen compatibility with kernel 3.18 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch fixes build failing with undefined symbol _PAGE_IOMAP with kernel 3.18. The Xen-specific _PAGE_IOMAP PTE flag was removed in kernel 3.18 and could be used for other purpose in future. This patch ensures that _PAGE_IOMAP flag is only used for kernels before 3.18. Signed-off-by: Shu Shen --- lib/librte_eal/linuxapp/igb_uio/compat.h | 4 ++++ lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/lib/librte_eal/linuxapp/igb_uio/compat.h b/lib/librte_eal/linuxapp/igb_uio/compat.h index 9454382..c1d45a6 100644 --- a/lib/librte_eal/linuxapp/igb_uio/compat.h +++ b/lib/librte_eal/linuxapp/igb_uio/compat.h @@ -11,6 +11,10 @@ #define pci_cfg_access_unlock pci_unblock_user_cfg_access #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) +#define HAVE_PTE_MASK_PAGE_IOMAP +#endif + #ifndef PCI_MSIX_ENTRY_SIZE #define PCI_MSIX_ENTRY_SIZE 16 #define PCI_MSIX_ENTRY_LOWER_ADDR 0 diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c index 47ff2f3..60a2db1 100644 --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c @@ -287,7 +287,9 @@ 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); +#if defined(HAVE_PTE_MASK_PAGE_IOMAP) vma->vm_page_prot.pgprot |= _PAGE_IOMAP; +#endif return remap_pfn_range(vma, vma->vm_start,