luigirizzo / netmap

Automatically exported from code.google.com/p/netmap
BSD 2-Clause "Simplified" License
1.86k stars 537 forks source link

Build error on kernel 5.18.1 #859

Open udosan174 opened 2 years ago

udosan174 commented 2 years ago

I'm using Arche Linux. I get an error when building on kernel 5.18.1.

** NOTE ** Now running compile tests to adapt the code to your kernel version. Please wait.


kernel directory /lib/modules/5.18.1-arch1-1/build [/usr/lib/modules/5.18.1-arch1-1/build] kernel sources /lib/modules/5.18.1-arch1-1/build [/usr/lib/modules/5.18.1-arch1-1/build] linux version 51201 [5.18.1] module file netmap.ko

subsystems null generic apps native drivers

[xxxxx@arch07 netmap]$ make make -C /lib/modules/5.18.1-arch1-1/build M=/home/xxxxx/test/netmap EXTRA_CFLAGS='-I/home/xxxxx/test/netmap -I/home/xxxxx/test/netmap/LINUX -I/home/xxxxx/test/netmap/LINUX/../sys -I/home/xxxxx/test/netmap/LINUX/../sys/dev -DCONFIG_NETMAP -Wno-unused-but-set-variable -DCONFIG_NETMAP_NULL -DCONFIG_NETMAP_GENERIC' -Wno-error=stringop-truncation modules CONFIG_NETMAP=m O_DRIVERS="" NETMAP_DRIVER_SUFFIX= make[1]: Entering directory '/usr/lib/modules/5.18.1-arch1-1/build' CC [M] /home/xxxxx/test/netmap/netmap_mem2.o CC [M] /home/xxxxx/test/netmap/netmap_mbq.o CC [M] /home/xxxxx/test/netmap/netmap_legacy.o CC [M] /home/xxxxx/test/netmap/netmap_bdg.o CC [M] /home/xxxxx/test/netmap/netmap_kloop.o CC [M] /home/xxxxx/test/netmap/netmap_generic.o In file included from /home/xxxxx/test/netmap/LINUX/../sys/dev/netmap/netmap_generic.c:101: /home/xxxxx/test/netmap/LINUX/../sys/dev/netmap/netmap_generic.c: In function ‘generic_netmap_tx_clean’: /home/xxxxx/test/netmap/LINUX/bsd_glue.h:253:56: error: passing argument 1 of ‘atomic_read’ from incompatible pointer type [-Werror=incompatible-pointer-types] 253 #define MBUF_REFCNT(m) NM_ATOMIC_READ(&((m)->users)) ^~~~~
refcount_t {aka struct refcount_struct }
/home/xxxxx/test/netmap/LINUX/bsd_glue.h:232:53: note: in definition of macro ‘NM_ATOMIC_READ’ 232 #define NM_ATOMIC_READ(p) atomic_read(p) ^ /home/xxxxx/test/netmap/LINUX/../sys/dev/netmap/netmap_generic.c:521:36: note: in expansion of macro ‘MBUF_REFCNT’ 521 } else if (MBUF_REFCNT(m) != 1) { ^~~ In file included from ./include/linux/atomic.h:82, from ./include/linux/cpumask.h:13, from ./arch/x86/include/asm/cpumask.h:5, from ./arch/x86/include/asm/msr.h:11, from ./arch/x86/include/asm/processor.h:22, from ./arch/x86/include/asm/cpufeature.h:5, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:60, from ./include/linux/uio.h:9, from ./include/linux/socket.h:8, from ./include/uapi/linux/if.h:25, from /home/xxxxx/test/netmap/LINUX/bsd_glue.h:38: ./include/linux/atomic/atomic-instrumented.h:25:29: note: expected ‘const atomic_t ’ but argument is of type ‘refcount_t ’ {aka ‘struct refcount_struct *’} 25 atomic_read(const atomic_t *v) ~~~~^ /home/xxxxx/test/netmap/LINUX/bsd_glue.h:253:56: error: passing argument 1 of ‘atomic_read’ from incompatible pointer type [-Werror=incompatible-pointer-types] 253 #define MBUF_REFCNT(m) NM_ATOMIC_READ(&((m)->users)) ^~~~~
refcount_t {aka struct refcount_struct }

/home/xxxxx/test/netmap/LINUX/bsd_glue.h:232:53: note: in definition of macro ‘NM_ATOMIC_READ’ 232 | #define NM_ATOMIC_READ(p) atomic_read(p) | ^ /home/xxxxx/test/netmap/LINUX/../sys/dev/netmap/netmap_generic.c:545:36: note: in expansion of macro ‘MBUF_REFCNT’ 545 | } else if (MBUF_REFCNT(m) != 1) { | ^~~ ./include/linux/atomic/atomic-instrumented.h:25:29: note: expected ‘const atomic_t ’ but argument is of type ‘refcount_t ’ {aka ‘struct refcount_struct ’} 25 | atomic_read(const atomic_t v) | ~~~~^ cc1: some warnings being treated as errors make[2]: [/home/xxxxx/test/netmap/Kbuild:23: /home/xxxxx/test/netmap/netmap_generic.o] Error 1 make[1]: [Makefile:1834: /home/xxxxx/test/netmap] Error 2 make[1]: Leaving directory '/usr/lib/modules/5.18.1-arch1-1/build' make: *** [netmap.mak:80: netmap.ko] Error 2

udosan174 commented 2 years ago

It appears that the NETMAP_LINUX_HAVE_REFCOUNT_T decision is incorrect. I can work around it by commenting out the #ifdef.