From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f65.google.com (mail-pl0-f65.google.com [209.85.160.65]) by dpdk.org (Postfix) with ESMTP id 2F86E1B249 for ; Wed, 27 Dec 2017 19:25:45 +0100 (CET) Received: by mail-pl0-f65.google.com with SMTP id o2so19789045plk.12 for ; Wed, 27 Dec 2017 10:25:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=8Qrgr2v+m9s9/DJRjrCH+ceqaz0RQC/lFaNF8bxwjQc=; b=IPFmPpct6qZOV/yrgZ+vPtMbOkMP8taYGZe3kKT3Tnb5qyor3Xb3sxRJGe/nYOwAc7 3vvJZeqfiOUkLA7VA1J/PqfNy8K9nx/K+/lLQImuy+BTrjo6wYOBbofxK7doJoJveLiK OpOVlQvzqK05DuRdIm8m5zyJMGe3ZdJvYm1/G6EoCsEe/1kmvF7XnBvSf4dHkQFWjGff VuVBiSszsiB2V6mGIzcfOsD523ZniUKHTJYUBeW5o5izqFSfBjk3SO3XA81ROPrQcmJb TaV21EsUraHI0q9sO+6/QzFSRrXQ89l6tnekmep+VQZPHGU4YEYY7m4dSGUzMrhyafA/ SXHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8Qrgr2v+m9s9/DJRjrCH+ceqaz0RQC/lFaNF8bxwjQc=; b=NVIkCj1VvzOIPmq0mNAB+iXCacv6nEAB5s4nGej2fbbodR7QVWkD9OaTyV/8wNiHBN gPkl6YVTt5EL0BGalX4CLmOkgSHifZy0SkAMnhbUmPR7BycCXW94Nat9Zwh2TF/HqyGZ GOvxli5Fb0tmXY+I2ugwugNdsn21I+Hzj/VKzdvUsJa4/PUFsSm1C3pvmHxSVnPrUcem 1jxt/hYu0h5cpG5PgUNaVVA9CzeJu9JefVxH7Nv7nN+o7OBab/IUzJ8soMJkoGwPuWqK z+1AP/PGt7LVGy87cn36y5Q1CHVD71HUW/8MWG3j8Im+Pwd0gCbolv6XC/LQLvI48A9a O21w== X-Gm-Message-State: AKGB3mJQGK2jTSnYJ2Am6bwFqOFKb0jm8xBJEUgH+UFyATfRdNPoDO3B ld7GY0UV1W4vJ8NJHAybZ7DwZzip92k= X-Google-Smtp-Source: ACJfBotDweVrOFphjxeqp18dzdMpNYQFv5ivlUSEb/8Apejag112XuxdRlRAw4qDju+7yl1JNH/GQw== X-Received: by 10.84.241.137 with SMTP id b9mr29119594pll.441.1514399143971; Wed, 27 Dec 2017 10:25:43 -0800 (PST) Received: from xeon-e3.lan (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id c123sm20631510pga.8.2017.12.27.10.25.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Dec 2017 10:25:43 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Wed, 27 Dec 2017 10:25:40 -0800 Message-Id: <20171227182540.12505-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH] pci: don't use kernel version to determine MSIX defines X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2017 18:25:45 -0000 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 --- drivers/bus/pci/linux/pci_init.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/bus/pci/linux/pci_init.h b/drivers/bus/pci/linux/pci_init.h index f342c47deef6..1ddfc6bc7692 100644 --- a/drivers/bus/pci/linux/pci_init.h +++ b/drivers/bus/pci/linux/pci_init.h @@ -34,8 +34,6 @@ #ifndef EAL_PCI_INIT_H_ #define EAL_PCI_INIT_H_ -#include - #include /** IO resource type: */ @@ -76,14 +74,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 */ -- 2.11.0