Re: [PATCH 1/2] igb_uio: fix compability on old kernel
From: Robert Sanford <hidden>
Date: 2014-08-22 18:09:35
This is what we came up with. It works for us. In our kernel headers' linux/pci.h, pci_num_vf is enclosed within "#ifdef CONFIG_PCI_IOV/#endif"; pci_intx_mask_supported and pci_check_and_mask_intx are enclosed within "#ifdef HAVE_PCI_SET_MWI/#endif". What do you think? -- Thanks, Robert --- lib/librte_eal/linuxapp/igb_uio/compat.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_eal/linuxapp/igb_uio/compat.hb/lib/librte_eal/linuxapp/igb_uio/compat.h index 2a16540..f7404d8 100644
--- a/lib/librte_eal/linuxapp/igb_uio/compat.h
+++ b/lib/librte_eal/linuxapp/igb_uio/compat.h@@ -17,7 +17,7 @@ #define PCI_MSIX_ENTRY_CTRL_MASKBIT 1 #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) &&
!defined(CONFIG_PCI_IOV)
static int pci_num_vf(struct pci_dev *dev)
{
struct iov {@@ -38,7 +38,7 @@ static int pci_num_vf(struct pci_dev *dev) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) &&
!defined(HAVE_PCI_SET_MWI) /* Check if INTX works to control irq's. * Set's INTX_DISABLE flag and reads it back -- 1.7.1 On Fri, Aug 22, 2014 at 1:29 PM, Sanford, Robert [off-list ref] wrote:
Hi Thomas, Not that I would *like* to fix this, but I *need* to fix it. We are using CentOS 6.5, which I believe is based on RHEL. We have kernel 2.6.32-431.3.1.el6.x86_64. I realize that we need to add/change ifdefs around pci_num_vf, pci_intx_mask_supported, and pci_check_and_mask_intx in igb_uio/compat.h. Any more specific suggestions on how to (elegantly) fix it for us, but not break it for anyone else? -- Regards, Robert