From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by dpdk.org (Postfix) with ESMTP id 4607F592F for ; Fri, 22 Aug 2014 20:05:53 +0200 (CEST) Received: by mail-lb0-f179.google.com with SMTP id v6so9729715lbi.38 for ; Fri, 22 Aug 2014 11:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=rO7iDW4QY4u8U6J1RUpqFxyLrf9U79cF64ITEAJjOBo=; b=0LYk61I0JSyKY6V+EQ6NdXcEivolasTp4l9JyCHUfTmuy7wZc8PDyuVaF+vhougwTp PfbLSbDDHzLQu3+ESviBeD/ghwotpUhmeVqolDW8cPM5G51oSblYMX0oU4j2xWnefU4s jsbNsid6ZVht9gZphjfuR9gWgjJ/k8JKz1WDJEq67Cf0NhKcQELyJJLeyFWUo5m+I5PK 6b7uw90Lelmj4H+tXh1rf/f9hMRXOyzQdTUK0V1w2gJo4AQVzLPoP12xZsVhbY0x2Fiv +A6HGUQIUi5GQCZ+Giol6B/xyvYnKG0BPiGZy5lV/8Z6Ff1c+gMaeQfKU1jUcl0UmwqL ydUw== MIME-Version: 1.0 X-Received: by 10.112.138.102 with SMTP id qp6mr5722039lbb.60.1408730975313; Fri, 22 Aug 2014 11:09:35 -0700 (PDT) Received: by 10.152.47.9 with HTTP; Fri, 22 Aug 2014 11:09:35 -0700 (PDT) In-Reply-To: References: <20140725103627.4ca989b7@haswell.linuxnetplumber.net> <9317787.qKVt3oyQbN@xps13> Date: Fri, 22 Aug 2014 14:09:35 -0400 Message-ID: From: Robert Sanford To: Thomas Monjalon , "dev@dpdk.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 1/2] igb_uio: fix compability on old kernel X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Aug 2014 18:05:53 -0000 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.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 -- 1.7.1 On Fri, Aug 22, 2014 at 1:29 PM, Sanford, Robert 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 >