From 0d6e2d783d164503e75e57b7358dc3c5c09e0bf1 Mon Sep 17 00:00:00 2001 From: Shu Shen Date: Thu, 11 Dec 2014 11:33:23 -0800 Subject: [PATCH] igb_uio: fix build with kernel 3.18 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 Acked-by: Jincheng Miao --- 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 9454382620..c1d45a661d 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 47ff2f3f90..ba1364b7c0 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); +#ifdef HAVE_PTE_MASK_PAGE_IOMAP vma->vm_page_prot.pgprot |= _PAGE_IOMAP; +#endif return remap_pfn_range(vma, vma->vm_start, -- 2.20.1