From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guillaume Gaudonville Subject: Re: [PATCH 1/2] igb_uio: fix compability on old kernel Date: Mon, 01 Sep 2014 17:07:04 +0200 Message-ID: <54048B98.708@6wind.com> References: <20140725103627.4ca989b7@haswell.linuxnetplumber.net> <9317787.qKVt3oyQbN@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit To: Robert Sanford , Thomas Monjalon , "dev-VfR2kkLFssw@public.gmane.org" Return-path: In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" On 08/22/2014 08:09 PM, Robert Sanford wrote: > 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". Testing on HAVE_PCI_SET_MWI seems not correct. It is defined since linux 2.6.12. There is no define associated with the commit that adds pci_intx_mask_supported and pci_check_and_mask_intx. So I think we'll have to check the distribution, something like: -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) && \ + (!(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(6,5))) What do you think? -- Best regards, Guillaume > > 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.h > b/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