From: Stephen Hemminger Date: Wed, 27 Dec 2017 18:25:40 +0000 (-0800) Subject: bus/pci: do not use kernel version to determine MSIX defines X-Git-Tag: spdx-start~771 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a12f226789156ed1f2f5639567408379fe2e6a46;p=dpdk.git bus/pci: do not use kernel version to determine MSIX defines In real life, kernel version is only weakly corolated with presence or absence of defines in header files. Instead, check directly if the needed value is defined. Signed-off-by: Stephen Hemminger --- diff --git a/drivers/bus/pci/linux/pci_init.h b/drivers/bus/pci/linux/pci_init.h index e8947db57a..c2e603a374 100644 --- a/drivers/bus/pci/linux/pci_init.h +++ b/drivers/bus/pci/linux/pci_init.h @@ -5,8 +5,6 @@ #ifndef EAL_PCI_INIT_H_ #define EAL_PCI_INIT_H_ -#include - #include /** IO resource type: */ @@ -47,14 +45,22 @@ int pci_uio_ioport_unmap(struct rte_pci_ioport *p); #ifdef VFIO_PRESENT -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) -#define RTE_PCI_MSIX_TABLE_BIR 0x7 -#define RTE_PCI_MSIX_TABLE_OFFSET 0xfffffff8 -#define RTE_PCI_MSIX_FLAGS_QSIZE 0x07ff -#else +#ifdef PCI_MSIX_TABLE_BIR #define RTE_PCI_MSIX_TABLE_BIR PCI_MSIX_TABLE_BIR +#else +#define RTE_PCI_MSIX_TABLE_BIR 0x7 +#endif + +#ifdef PCI_MSIX_TABLE_OFFSET #define RTE_PCI_MSIX_TABLE_OFFSET PCI_MSIX_TABLE_OFFSET +#else +#define RTE_PCI_MSIX_TABLE_OFFSET 0xfffffff8 +#endif + +#ifdef PCI_MSIX_FLAGS_QSIZE #define RTE_PCI_MSIX_FLAGS_QSIZE PCI_MSIX_FLAGS_QSIZE +#else +#define RTE_PCI_MSIX_FLAGS_QSIZE 0x07ff #endif /* access config space */