diff mbox

[dpdk-dev] igb_uio: fix build with backported kernel

Message ID 1466006262-30228-1-git-send-email-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show

Commit Message

Ferruh Yigit June 15, 2016, 3:57 p.m. UTC
Following compile error observed with CentOS 6.8, which uses kernel
kernel-devel-2.6.32-642.el6.x86_64:

CC eal_thread.o
.../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.c:
In function 'igbuio_msix_mask_irq':
.../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.c:157:
error: 'PCI_MSIX_ENTRY_CTRL_MASKBIT' undeclared (first use in this
function)

Reported-by: Thiago <thiagocmartinsc@gmail.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_eal/linuxapp/igb_uio/compat.h | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Ferruh Yigit June 15, 2016, 3:59 p.m. UTC | #1
On 6/15/2016 4:57 PM, Ferruh Yigit wrote:
> Following compile error observed with CentOS 6.8, which uses kernel
> kernel-devel-2.6.32-642.el6.x86_64:
> 
> CC eal_thread.o
> .../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.c:
> In function 'igbuio_msix_mask_irq':
> .../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.c:157:
> error: 'PCI_MSIX_ENTRY_CTRL_MASKBIT' undeclared (first use in this
> function)
> 
> Reported-by: Thiago <thiagocmartinsc@gmail.com>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Hi Thiago,

Can you please test this patch?

Thanks,
ferruh
Martinx - ジェームズ June 16, 2016, 3:45 p.m. UTC | #2
On 15 June 2016 at 11:59, Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 6/15/2016 4:57 PM, Ferruh Yigit wrote:
> > Following compile error observed with CentOS 6.8, which uses kernel
> > kernel-devel-2.6.32-642.el6.x86_64:
> >
> > CC eal_thread.o
> > .../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.c:
> > In function 'igbuio_msix_mask_irq':
> > .../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.c:157:
> > error: 'PCI_MSIX_ENTRY_CTRL_MASKBIT' undeclared (first use in this
> > function)
> >
> > Reported-by: Thiago <thiagocmartinsc@gmail.com>
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>
> Hi Thiago,
>
> Can you please test this patch?
>
> Thanks,
> ferruh
>
>
Hi Ferruh,

That patch applied and worked (kind of):

---
[root@centos6-1 dpdk-16.04]# patch -p1 < ../dpdk-centos6.patch
patching file lib/librte_eal/linuxapp/igb_uio/compat.h
Hunk #1 succeeded at 24 with fuzz 2.
---

 It passed that broken step, however, it is failing in a different part of
build process now, as follows:

---
[root@centos6-1 ~]# time rpmbuild --ba /root/rpmbuild/SPECS/dpdk.spec
.......
.......
  LD librte_eal.so.2
  INSTALL-LIB librte_eal.so.2
== Build lib/librte_eal/linuxapp/kni
  LD
 /root/rpmbuild/BUILD/dpdk-16.04/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/built-in.o
  CC [M]
 /root/rpmbuild/BUILD/dpdk-16.04/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_main.o
  CC [M]
 /root/rpmbuild/BUILD/dpdk-16.04/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_api.o
In file included from
/root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_osdep.h:41,
                 from
/root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_type.h:31,
                 from
/root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_api.h:31,
                 from
/root/rpmbuild/BUILD/dpdk-16.04/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_api.c:28:
/root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h:
In function '__kc_vlan_get_protocol':
/root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h:2836:
error: implicit declaration of function 'vlan_tx_tag_present'
make[8]: ***
[/root/rpmbuild/BUILD/dpdk-16.04/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_api.o]
Error 1
make[8]: *** Waiting for unfinished jobs....
In file included from
/root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_osdep.h:41,
                 from
/root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_type.h:31,
                 from
/root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_dcb.h:32,
                 from
/root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe.h:52,
                 from
/root/rpmbuild/BUILD/dpdk-16.04/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_main.c:56:
/root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h:
In function '__kc_vlan_get_protocol':
/root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h:2836:
error: implicit declaration of function 'vlan_tx_tag_present'
make[8]: ***
[/root/rpmbuild/BUILD/dpdk-16.04/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_main.o]
Error 1
make[7]: ***
[_module_/root/rpmbuild/BUILD/dpdk-16.04/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni]
Error 2
make[6]: *** [sub-make] Error 2
make[5]: *** [rte_kni.ko] Error 2
make[4]: *** [kni] Error 2
make[3]: *** [linuxapp] Error 2
make[2]: *** [librte_eal] Error 2
make[1]: *** [lib] Error 2
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.Naoj9c (%build)
---

Might be a totally different problem now, I don't know...   :-)

Best,
Thiago
Ferruh Yigit June 17, 2016, 9:15 a.m. UTC | #3
On 6/16/2016 4:45 PM, Martinx - ジェームズ wrote:
> On 15 June 2016 at 11:59, Ferruh Yigit <ferruh.yigit@intel.com
> <mailto:ferruh.yigit@intel.com>> wrote:
> 
>     On 6/15/2016 4:57 PM, Ferruh Yigit wrote:
>     > Following compile error observed with CentOS 6.8, which uses kernel
>     > kernel-devel-2.6.32-642.el6.x86_64:
>     >
>     > CC eal_thread.o
>     > .../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.c:
>     > In function 'igbuio_msix_mask_irq':
>     > .../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.c:157:
>     > error: 'PCI_MSIX_ENTRY_CTRL_MASKBIT' undeclared (first use in this
>     > function)
>     >
>     > Reported-by: Thiago <thiagocmartinsc@gmail.com <mailto:thiagocmartinsc@gmail.com>>
>     > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com <mailto:ferruh.yigit@intel.com>>
> 
>     Hi Thiago,
> 
>     Can you please test this patch?
> 
>     Thanks,
>     ferruh
> 
> 
> Hi Ferruh,
> 
> That patch applied and worked (kind of):
> 
> ---
> [root@centos6-1 dpdk-16.04]# patch -p1 < ../dpdk-centos6.patch 
> patching file lib/librte_eal/linuxapp/igb_uio/compat.h
> Hunk #1 succeeded at 24 with fuzz 2.
> ---
> 
>  It passed that broken step, however, it is failing in a different part
> of build process now, as follows:
> 
> ---
> [root@centos6-1 ~]# time rpmbuild --ba /root/rpmbuild/SPECS/dpdk.spec 
> .......
> .......
>   LD librte_eal.so.2
>   INSTALL-LIB librte_eal.so.2
> == Build lib/librte_eal/linuxapp/kni
>   LD    
>  /root/rpmbuild/BUILD/dpdk-16.04/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/built-in.o
>   CC [M]
>  /root/rpmbuild/BUILD/dpdk-16.04/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_main.o
>   CC [M]
>  /root/rpmbuild/BUILD/dpdk-16.04/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_api.o
> In file included from
> /root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_osdep.h:41,
>                  from
> /root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_type.h:31,
>                  from
> /root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_api.h:31,
>                  from
> /root/rpmbuild/BUILD/dpdk-16.04/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_api.c:28:
> /root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h:
> In function '__kc_vlan_get_protocol':
> /root/rpmbuild/BUILD/dpdk-16.04/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h:2836:
> error: implicit declaration of function 'vlan_tx_tag_present'

Because skb_vlan_tag_present renamed in Linux 3.19 (commit: df8a39d) and
this commit backported in this kernel.
This error can be also fixed, but another compile error pops up.

This is hard to keep up, because kernel version is old (2.6.32) but
backported latest commits. We are not able to rely on kernel version
checks or define checks.

If you don't need KNI you can either:
1- Disable it from configuration file
2- Compile kernel modules against newer kernel version using
RTE_KERNELDIR, like: "make RTE_KERNELDIR=/tmp/latest_linux_version"

As far as I can see you are using spec file to compile, is this spec
file distributed with DPDK? If so, perhaps you can share your updates to
spec file?


> 
> Might be a totally different problem now, I don't know...   :-)
> 
> Best,
> Thiago
Thomas Monjalon June 21, 2016, 2:12 p.m. UTC | #4
2016-06-15 16:57, Ferruh Yigit:
> Following compile error observed with CentOS 6.8, which uses kernel
> kernel-devel-2.6.32-642.el6.x86_64:
> 
> CC eal_thread.o
> .../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.c:
> In function 'igbuio_msix_mask_irq':
> .../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.c:157:
> error: 'PCI_MSIX_ENTRY_CTRL_MASKBIT' undeclared (first use in this
> function)
> 
> Reported-by: Thiago <thiagocmartinsc@gmail.com>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied, thanks
diff mbox

Patch

diff --git a/lib/librte_eal/linuxapp/igb_uio/compat.h b/lib/librte_eal/linuxapp/igb_uio/compat.h
index c1d45a6..0d781e4 100644
--- a/lib/librte_eal/linuxapp/igb_uio/compat.h
+++ b/lib/librte_eal/linuxapp/igb_uio/compat.h
@@ -24,6 +24,15 @@ 
 #define   PCI_MSIX_ENTRY_CTRL_MASKBIT   1
 #endif
 
+/*
+ * for kernels < 2.6.38 and backported patch that moves MSI-X entry definition
+ * to pci_regs.h Those kernels has PCI_MSIX_ENTRY_SIZE defined but not
+ * PCI_MSIX_ENTRY_CTRL_MASKBIT
+ */
+#ifndef PCI_MSIX_ENTRY_CTRL_MASKBIT
+#define PCI_MSIX_ENTRY_CTRL_MASKBIT    1
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) && \
 	(!(defined(RHEL_RELEASE_CODE) && \
 	 RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(5, 9)))