From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id 858ED677B for ; Fri, 31 Oct 2014 09:44:30 +0100 (CET) Received: by mail-wg0-f53.google.com with SMTP id b13so5976263wgh.40 for ; Fri, 31 Oct 2014 01:53:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=FvVKrFaVbkoOn5SyIwkzX7I9xUTdLgCYTeAFixU2it4=; b=U+SQUEpb53KsxVto0f0NpmjywR+Bd4Je2tuBA386zhFZnHWgatTWcxBJN/+MUKU4QJ oeKOjrRikiWYQL8UnwIECEHhqwS21auqOgNGFQ1cVjMIuA0SNdNW7hSH27ScXbSajsOm Nl2XzWMyy0xXeMpI7RqvSorDHD+wf4WpFFN7u//JonW61lJdxQZlGId23rRloLsfudVp HdjL+7MPRhx91abRtpZxgVgTjLqEFz6+986ZsQCFDX/fLFmAtN/T+Q/q5cbL20/e+f9w WV51jOA5Ed661RavfS9HXHzKIY2OtsjIp0Afos1bXDBnQWT2OsYn3wW/FQXzdV/OZEN5 iTew== X-Gm-Message-State: ALoCoQlpvrQaFkVlgM8ZRDyXCAv/Bu35w/xfJjxMQobYDUTv1P7MxT+4y5B7nCUPuMQZ395gNrQM X-Received: by 10.180.99.163 with SMTP id er3mr2391214wib.18.1414745610298; Fri, 31 Oct 2014 01:53:30 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id 4sm11315906wjx.39.2014.10.31.01.53.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Oct 2014 01:53:29 -0700 (PDT) From: Thomas Monjalon To: Jincheng Miao Date: Fri, 31 Oct 2014 09:53:10 +0100 Message-ID: <5765562.Md9X049dkv@xps13> Organization: 6WIND User-Agent: KMail/4.14.2 (Linux/3.17.1-1-ARCH; KDE/4.14.2; x86_64; ; ) In-Reply-To: <5452EBDA.2090706@redhat.com> References: <1414657104-16141-1-git-send-email-jmiao@redhat.com> <5452EBDA.2090706@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] igb_uio: fix build for longterm kernel 2.6.32.63 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, 31 Oct 2014 08:44:30 -0000 Hi Jincheng, 2014-10-31 09:54, Jincheng Miao: > This patch will make RHEL6 build failed. >=20 > The root cause is that RHEL-based kernel is slightly different with=20= > upstream kernel. > It has some functions (pci_num_vf, kstrtoul, etc) which don't exist i= n=20 > upstream longterm kernel. Yes it seems that the functions are stub-defined in RHEL if CONFIG_PCI_= IOV is not defined. > For better compatibility, IMHO it is distinguishing RHEL-based kernel= =20 > and upstream one. Yes we have to handle the RedHat difference. > Using macro like: > ``` > #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) && \ > !(defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >=3D=20 > RHEL_RELEASE_VERSION(6, 3)) >=20 > static int pci_num_vf(struct pci_dev *dev) > { > ``` >=20 > But this is RHEL-specified fix. For other distros, if they have some=20= > problem, we should hack it in the same way. >=20 > Thanks and regards, > Jincheng Miao >=20 >=20 > On 10/30/2014 04:18 PM, Jincheng Miao wrote: > > There is a logical error in igb_uio/compat.h when define pci_num_vf= (). > > Only CONFIG_PCI_IOV enabled, this function could be defined. > > > > This patch fix the following error for linux-2.6.32.63: > > CC [M] /root/dpdk-source/build/build/lib/librte_eal/linuxapp/igb_u= io/igb_uio.o > > /root/dpdk-source/build/build/lib/librte_eal/linuxapp/igb_uio/igb_u= io.c: In function =E2=80=98show_max_vfs=E2=80=99: > > /root/dpdk-source/build/build/lib/librte_eal/linuxapp/igb_uio/igb_u= io.c:75: error: implicit declaration of function =E2=80=98pci_num_vf=E2= =80=99 > > > > Signed-off-by: Jincheng Miao > > --- > > lib/librte_eal/linuxapp/igb_uio/compat.h | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/lib/librte_eal/linuxapp/igb_uio/compat.h b/lib/librte_= eal/linuxapp/igb_uio/compat.h > > index 676fa1b..0af0cae 100644 > > --- a/lib/librte_eal/linuxapp/igb_uio/compat.h > > +++ b/lib/librte_eal/linuxapp/igb_uio/compat.h > > @@ -21,7 +21,7 @@ > > #endif > > =20 > > #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) && \ > > -=09!defined(CONFIG_PCI_IOV) > > +=09defined(CONFIG_PCI_IOV) > > =20 > > static int pci_num_vf(struct pci_dev *dev) > > {