ntop / PF_RING

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

pf_ring dkms (8.1.0-7556) does not compile for the 5.18.x kernel #817

Closed rwhalb closed 2 years ago

rwhalb commented 2 years ago

[root@nst36 pfring-8.1.0]# make make -C /lib/modules/5.18.5-200.fc36.x86_64/build M=/usr/src/pfring-8.1.0 EXTRA_CFLAGS='-I/usr/src/pfring-8.1.0 -DGIT_REV="\"dev:cabd2381e3bb623b5b22e670e9612b622fa94d49\"" -no-pie -fno-pie -Wno-implicit-fallthrough' modules make[1]: Entering directory '/usr/src/kernels/5.18.5-200.fc36.x86_64' CC [M] /usr/src/pfring-8.1.0/pf_ring.o In file included from ./include/linux/byteorder/little_endian.h:5, from ./arch/x86/include/uapi/asm/byteorder.h:5, from ./arch/x86/include/asm/orc_types.h:43, from ./arch/x86/include/asm/unwind_hints.h:6, from ./arch/x86/include/asm/nospec-branch.h:13, from ./arch/x86/include/asm/paravirt_types.h:40, from ./arch/x86/include/asm/ptrace.h:97, from ./arch/x86/include/asm/math_emu.h:5, from ./arch/x86/include/asm/processor.h:13, from ./arch/x86/include/asm/timex.h:5, from ./include/linux/timex.h:67, from ./include/linux/time32.h:13, from ./include/linux/time.h:60, from ./include/linux/stat.h:19, from ./include/linux/module.h:13, from /usr/src/pfring-8.1.0/pf_ring.c:79: /usr/src/pfring-8.1.0/pf_ring.c: In function ‘allocate_extra_dma_memory’: /usr/src/pfring-8.1.0/pf_ring.c:4818:7: error: implicit declaration of function ‘pci_map_single’; did you mean ‘dma_map_single’? [-Werror=implicit-function-declaration] 4818 | pci_map_single(to_pci_dev(dma_memory->hwdev), slot, | ^~~~~~ ./include/uapi/linux/byteorder/little_endian.h:32:51: note: in definition of macro ‘cpu_to_le64’ 32 | #define cpu_to_le64(x) ((force le64)(u64)(x)) | ^ /usr/src/pfring-8.1.0/pf_ring.c:4817:31: note: in expansion of macro ‘cpu_to_le64’ 4817 | dma_memory->dma_addr[i] = cpu_to_le64( | ^~~ /usr/src/pfring-8.1.0/pf_ring.c:4820:22: error: ‘PCI_DMA_BIDIRECTIONAL’ undeclared (first use in this function); did you mean ‘DMA_BIDIRECTIONAL’? 4820 | PCI_DMA_BIDIRECTIONAL)); | ^~~~~ ./include/uapi/linux/byteorder/little_endian.h:32:51: note: in definition of macro ‘cpu_to_le64’ 32 | #define cpu_to_le64(x) ((force le64)(u64)(x)) | ^ /usr/src/pfring-8.1.0/pf_ring.c:4817:31: note: in expansion of macro ‘cpu_to_le64’ 4817 | dma_memory->dma_addr[i] = cpu_to_le64( | ^~~ /usr/src/pfring-8.1.0/pf_ring.c:4820:22: note: each undeclared identifier is reported only once for each function it appears in 4820 | PCI_DMA_BIDIRECTIONAL)); | ^~~~~ ./include/uapi/linux/byteorder/little_endian.h:32:51: note: in definition of macro ‘cpu_to_le64’ 32 | #define cpu_to_le64(x) ((force le64)(__u64)(x)) | ^ /usr/src/pfring-8.1.0/pf_ring.c:4817:31: note: in expansion of macro ‘cpu_to_le64’ 4817 | dma_memory->dma_addr[i] = cpu_to_le64( | ^~~ In file included from ./include/linux/skbuff.h:31, from /usr/src/pfring-8.1.0/pf_ring.c:83: /usr/src/pfring-8.1.0/pf_ring.c: In function ‘free_extra_dma_memory’: /usr/src/pfring-8.1.0/pf_ring.c:4843:26: error: ‘PCI_DMA_BIDIRECTIONAL’ undeclared (first use in this function); did you mean ‘DMA_BIDIRECTIONAL’? 4843 | PCI_DMA_BIDIRECTIONAL); | ^~~~~ ./include/linux/dma-mapping.h:407:70: note: in definition of macro ‘dma_unmap_single’ 407 | #define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, 0) | ^ /usr/src/pfring-8.1.0/pf_ring.c: In function ‘pf_ring_inject_packet_to_stack’: /usr/src/pfring-8.1.0/pf_ring.c:5833:9: error: implicit declaration of function ‘netif_rx_ni’; did you mean ‘netif_rx’? [-Werror=implicit-function-declaratio] 5833 | err = netif_rx_ni(skb); | ^~~ | netif_rx /usr/src/pfring-8.1.0/pf_ring.c: In function ‘ring_getsockopt’: /usr/src/pfring-8.1.0/pf_ring.c:7888:26: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 7888 | char *dev_addr = pfr->ring_dev->dev->dev_addr; | ^~~ cc1: some warnings being treated as errors make[2]: [scripts/Makefile.build:288: /usr/src/pfring-8.1.0/pf_ring.o] Error 1 make[1]: [Makefile:1838: /usr/src/pfring-8.1.0] Error 2 make[1]: Leaving directory '/usr/src/kernels/5.18.5-200.fc36.x86_64' make: *** [Makefile:67: all] Error 2

cardigliano commented 2 years ago

@rwhalb it seems you are running an unsupported kernel, we will fix this asap

RayFoulk commented 2 years ago

I ran into this same problem(s) running 5.18.19, and worked up this patch based on clues found here:

https://bugs.gentoo.org/847154

https://www.mail-archive.com/arch-commits@lists.archlinux.org/msg321191.html

Fair warning: This is completely untested. YMMV. 0001-patch-for-kernel-5.18.X.patch.gz

cardigliano commented 2 years ago

@RayFoulk could you send this as a PR please?