ntop / PF_RING

High-speed packet processing framework
http://www.ntop.org
GNU Lesser General Public License v2.1
2.7k stars 350 forks source link

ixgbe module compilation error: ‘VXLAN_HEADROOM’ undeclared #886

Closed uvelokk closed 1 year ago

uvelokk commented 1 year ago

OS: Debian 11 kernel: Linux 5.10.0-25-amd64 #1 SMP Debian 5.10.191-1 (2023-08-16) PF_RING branch: 8.4.0-stable GCC: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

The manual compilation of an ixgbe module ends with an error:

In file included from /usr/src/linux-headers-5.10.0-25-common/include/linux/export.h:43,
                 from /usr/src/linux-headers-5.10.0-25-common/include/linux/linkage.h:7,
                 from /usr/src/linux-headers-5.10.0-25-common/include/linux/kernel.h:8,
                 from /usr/src/linux-headers-5.10.0-25-common/include/linux/list.h:9,
                 from /usr/src/linux-headers-5.10.0-25-common/include/linux/module.h:12,
                 from /usr/src/PF_RING/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src/ixgbe_main.c:8:
/usr/src/PF_RING/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src/ixgbe_main.c: In function ‘ixgbe_atr’:
/usr/src/PF_RING/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src/ixgbe_main.c:10399:9: error: ‘VXLAN_HEADROOM’ undeclared (first use in this function); did you mean ‘VXLAN_HF_RCO’?
10399 |         VXLAN_HEADROOM))
      |         ^~~~~~~~~~~~~~
/usr/src/linux-headers-5.10.0-25-common/include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
   78 | # define unlikely(x) __builtin_expect(!!(x), 0)
      |                                          ^
/usr/src/PF_RING/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src/ixgbe_main.c:10399:9: note: each undeclared identifier is reported only once for each function it appears in
10399 |         VXLAN_HEADROOM))
      |         ^~~~~~~~~~~~~~
/usr/src/linux-headers-5.10.0-25-common/include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
   78 | # define unlikely(x) __builtin_expect(!!(x), 0)
      |                                          ^
make[6]: *** [/usr/src/linux-headers-5.10.0-25-common/scripts/Makefile.build:291: /usr/src/PF_RING/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src/ixgbe_main.o] Error 1
make[5]: *** [/usr/src/linux-headers-5.10.0-25-common/Makefile:1856: /usr/src/PF_RING/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src] Error 2
make[5]: Leaving directory '/usr/src/linux-headers-5.10.0-25-amd64'
make[4]: *** [Makefile:192: __sub-make] Error 2
make[4]: Leaving directory '/usr/src/linux-headers-5.10.0-25-common'
make[3]: *** [Makefile:98: default] Error 2
make[3]: Leaving directory '/usr/src/PF_RING/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src'
make[2]: *** [Makefile:5: all] Error 2
make[2]: Leaving directory '/usr/src/PF_RING/drivers/intel/ixgbe/ixgbe-5.5.3-zc'
make[1]: *** [Makefile:12: all] Error 2
make[1]: Leaving directory '/usr/src/PF_RING/drivers/intel'
make: *** [Makefile:3: all] Error 2

There is no compilation problems with an older kernel ('Linux 5.10.0-24-amd64 #1 SMP Debian 5.10.179-5 (2023-08-08)')

The reason for the error during PF_RING code compilation seems to arise from the change in a Linux kernel's file 'vxlan.h':

foo@bar:/tmp# diff -u /lib/modules/5.10.0-2{4,5}-amd64/source/include/net/vxlan.h 
--- /lib/modules/5.10.0-24-amd64/source/include/net/vxlan.h 2023-04-26 12:27:43.000000000 +0300
+++ /lib/modules/5.10.0-25-amd64/source/include/net/vxlan.h 2023-08-16 19:21:03.000000000 +0300
@@ -327,10 +327,15 @@
    return features;
 }

-/* IP header + UDP + VXLAN + Ethernet header */
-#define VXLAN_HEADROOM (20 + 8 + 8 + 14)
-/* IPv6 header + UDP + VXLAN + Ethernet header */
-#define VXLAN6_HEADROOM (40 + 8 + 8 + 14)
+static inline int vxlan_headroom(u32 flags)
+{
+   /* VXLAN:     IP4/6 header + UDP + VXLAN + Ethernet header */
+   /* VXLAN-GPE: IP4/6 header + UDP + VXLAN */
+   return (flags & VXLAN_F_IPV6 ? sizeof(struct ipv6hdr) :
+                      sizeof(struct iphdr)) +
+          sizeof(struct udphdr) + sizeof(struct vxlanhdr) +
+          (flags & VXLAN_F_GPE ? 0 : ETH_HLEN);
+}

 static inline struct vxlanhdr *vxlan_hdr(struct sk_buff *skb)
 {
@@ -492,12 +497,12 @@
 }

 static inline bool vxlan_fdb_nh_path_select(struct nexthop *nh,
-                       int hash,
+                       u32 hash,
                        struct vxlan_rdst *rdst)
 {
    struct fib_nh_common *nhc;

-   nhc = nexthop_path_fdb_result(nh, hash);
+   nhc = nexthop_path_fdb_result(nh, hash >> 1);
    if (unlikely(!nhc))
        return false;

(Reference to the same change in the Linux kernel source code: https://github.com/torvalds/linux/commit/94d166c5318c6edd1e079df8552233443e909c33)

Thank You Uve

cardigliano commented 1 year ago

@uvelokk please note we just released latest 8.6 stable, which is supposed to compile on this kernel. I suggest to check it. Thank you.

uvelokk commented 1 year ago

@cardigliano Already tried to compile the v8.6.0 code. The result is still negative:

make -C /lib/modules/5.10.0-25-amd64/build M=/usr/src/PF_RING_860/kernel EXTRA_CFLAGS='-I/usr/src/PF_RING_860/kernel -DGIT_REV="\"8.6.0-stable:7ca3da72aa86556598fddf69157fe65b604a5bb0\"" -no-pie -fno-pie -Wno-implicit-fallthrough' modules
make[5]: Entering directory '/usr/src/linux-headers-5.10.0-25-amd64'
make[5]: Leaving directory '/usr/src/linux-headers-5.10.0-25-amd64'
make[4]: Leaving directory '/usr/src/PF_RING_860/kernel'
cp /usr/src/PF_RING_860/kernel/Module.symvers .
make[4]: Entering directory '/usr/src/linux-headers-5.10.0-25-common'
make[5]: Entering directory '/usr/src/linux-headers-5.10.0-25-amd64'
  CC [M]  /usr/src/PF_RING_860/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src/ixgbe_main.o
In file included from /usr/src/linux-headers-5.10.0-25-common/include/linux/export.h:43,
                 from /usr/src/linux-headers-5.10.0-25-common/include/linux/linkage.h:7,
                 from /usr/src/linux-headers-5.10.0-25-common/include/linux/kernel.h:8,
                 from /usr/src/linux-headers-5.10.0-25-common/include/linux/list.h:9,
                 from /usr/src/linux-headers-5.10.0-25-common/include/linux/module.h:12,
                 from /usr/src/PF_RING_860/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src/ixgbe_main.c:8:
/usr/src/PF_RING_860/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src/ixgbe_main.c: In function ‘ixgbe_atr’:
/usr/src/PF_RING_860/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src/ixgbe_main.c:10399:9: error: ‘VXLAN_HEADROOM’ undeclared (first use in this function); did you mean ‘VXLAN_HF_RCO’?
10399 |         VXLAN_HEADROOM))
      |         ^~~~~~~~~~~~~~
/usr/src/linux-headers-5.10.0-25-common/include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
   78 | # define unlikely(x) __builtin_expect(!!(x), 0)
      |                                          ^
/usr/src/PF_RING_860/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src/ixgbe_main.c:10399:9: note: each undeclared identifier is reported only once for each function it appears in
10399 |         VXLAN_HEADROOM))
      |         ^~~~~~~~~~~~~~
/usr/src/linux-headers-5.10.0-25-common/include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
   78 | # define unlikely(x) __builtin_expect(!!(x), 0)
      |                                          ^
make[6]: *** [/usr/src/linux-headers-5.10.0-25-common/scripts/Makefile.build:291: /usr/src/PF_RING_860/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src/ixgbe_main.o] Error 1
make[5]: *** [/usr/src/linux-headers-5.10.0-25-common/Makefile:1856: /usr/src/PF_RING_860/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src] Error 2
make[5]: Leaving directory '/usr/src/linux-headers-5.10.0-25-amd64'
make[4]: *** [Makefile:192: __sub-make] Error 2
make[4]: Leaving directory '/usr/src/linux-headers-5.10.0-25-common'
make[3]: *** [Makefile:98: default] Error 2
make[3]: Leaving directory '/usr/src/PF_RING_860/drivers/intel/ixgbe/ixgbe-5.5.3-zc/src'
make[2]: *** [Makefile:5: all] Error 2
make[2]: Leaving directory '/usr/src/PF_RING_860/drivers/intel/ixgbe/ixgbe-5.5.3-zc'
make[1]: *** [Makefile:12: all] Error 2
make[1]: Leaving directory '/usr/src/PF_RING_860/drivers/intel'
make: *** [Makefile:3: all] Error 2
cardigliano commented 1 year ago

New ixgbe zc driver v.5.19.6 pushed in 187bcbf079db5424441a19f1fbe89a98a97d9114 . Packages will be available soon