From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: Scott Branden <scott.branden@broadcom.com>
Subject: [dpdk-dev] [PATCH] igb_uio: only check for pci bridge in supported by linux kernel
Date: Mon, 16 Apr 2018 13:51:10 -0700 [thread overview]
Message-ID: <20180416205110.1354-1-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <e87d3f78-388d-592d-a127-3a11da480744@intel.com>
From: Scott Branden <scott.branden@broadcom.com>
Starting from Linux v3.16 pci_is_bridge() is in linux/pci.h,
in previous versions it is in drivers/pci/pci.h which is private header.
Fix build error when calling pci_is_bridge by not calling/supporting
pci_is_bridge with kernel versions before 3.16.
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
kernel/linux/igb_uio/compat.h | 4 ++++
kernel/linux/igb_uio/igb_uio.c | 2 ++
2 files changed, 6 insertions(+)
diff --git a/kernel/linux/igb_uio/compat.h b/kernel/linux/igb_uio/compat.h
index ce456d4bb..b48c4cc91 100644
--- a/kernel/linux/igb_uio/compat.h
+++ b/kernel/linux/igb_uio/compat.h
@@ -132,3 +132,7 @@ static bool pci_check_and_mask_intx(struct pci_dev *pdev)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
#define HAVE_PCI_MSI_MASK_IRQ 1
#endif
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+#define HAVE_PCI_IS_BRIDGE_API 1
+#endif
diff --git a/kernel/linux/igb_uio/igb_uio.c b/kernel/linux/igb_uio/igb_uio.c
index cbc5ab63a..cd9b7e721 100644
--- a/kernel/linux/igb_uio/igb_uio.c
+++ b/kernel/linux/igb_uio/igb_uio.c
@@ -473,10 +473,12 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
void *map_addr;
int err;
+#ifdef HAVE_PCI_IS_BRIDGE_API
if (pci_is_bridge(dev)) {
dev_warn(&dev->dev, "Ignoring PCI bridge device\n");
return -ENODEV;
}
+#endif
udev = kzalloc(sizeof(struct rte_uio_pci_dev), GFP_KERNEL);
if (!udev)
--
2.15.1 (Apple Git-101)
next prev parent reply other threads:[~2018-04-16 20:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-29 16:37 [dpdk-dev] [PATCH v3] igb_uio: bind error if pcie bridge Ajit Khaparde
2018-03-30 10:34 ` Ferruh Yigit
2018-04-11 21:36 ` Thomas Monjalon
2018-04-16 15:35 ` Ferruh Yigit
2018-04-16 20:51 ` Ajit Khaparde [this message]
2018-04-17 9:35 ` [dpdk-dev] [PATCH] igb_uio: only check for pci bridge in supported by linux kernel Ferruh Yigit
2018-04-17 12:58 ` Iremonger, Bernard
2018-04-17 13:33 ` Ferruh Yigit
2018-04-17 13:49 ` Iremonger, Bernard
2018-04-17 17:52 ` [dpdk-dev] [PATCH v2] igb_uio: only check for pci bridge if " Ajit Khaparde
2018-04-17 18:07 ` Ferruh Yigit
2018-04-20 9:08 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180416205110.1354-1-ajit.khaparde@broadcom.com \
--to=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=scott.branden@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).