diff --git a/libs/libpfring/Makefile b/libs/libpfring/Makefile index 969d27f5a8..eeb20f0c9f 100644 --- a/libs/libpfring/Makefile +++ b/libs/libpfring/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=libpfring PKG_VERSION:=8.6.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=$(PKG_VERSION) diff --git a/libs/libpfring/patches/002-Fix-missing-prototypes.patch b/libs/libpfring/patches/002-Fix-missing-prototypes.patch new file mode 100644 index 0000000000..b71d51636f --- /dev/null +++ b/libs/libpfring/patches/002-Fix-missing-prototypes.patch @@ -0,0 +1,77 @@ +From 3b76a8ae22874b76759da9e188082138a9a03d41 Mon Sep 17 00:00:00 2001 +From: Alfredo Cardigliano +Date: Tue, 30 Apr 2024 09:30:24 +0000 +Subject: [PATCH] Fix missing prototypes + +--- + kernel/pf_ring.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 59 insertions(+) + +--- a/kernel/pf_ring.c ++++ b/kernel/pf_ring.c +@@ -443,6 +443,65 @@ MODULE_PARM_DESC(transparent_mode, + + /* ********************************** */ + ++u_int32_t get_num_rx_queues(struct net_device *dev); ++u_int32_t lock_rss_queues(struct net_device *dev); ++pf_ring_net *netns_lookup(struct net *net); ++pf_ring_net *netns_add(struct net *net); ++pf_ring_device *pf_ring_device_ifindex_lookup(struct net *net, int ifindex); ++pf_ring_device *pf_ring_device_name_lookup(struct net *net /* namespace */, char *name); ++int check_perfect_rules(struct sk_buff *skb, ++ struct pf_ring_socket *pfr, ++ struct pfring_pkthdr *hdr, ++ int *fwd_pkt, ++ int displ, ++ sw_filtering_hash_bucket **p_hash_bucket); ++int check_wildcard_rules(struct sk_buff *skb, ++ struct pf_ring_socket *pfr, ++ struct pfring_pkthdr *hdr, ++ int *fwd_pkt, ++ int displ); ++int bpf_filter_skb(struct sk_buff *skb, ++ struct pf_ring_socket *pfr, ++ int displ); ++int sample_packet(struct pf_ring_socket *pfr); ++u_int32_t default_rehash_rss_func(struct sk_buff *skb, struct pfring_pkthdr *hdr); ++void set_ring_num_channels(struct pf_ring_socket *pfr, u_int32_t num_rx_channels); ++void register_device_handler(void); ++void unregister_device_handler(void); ++void reserve_memory(unsigned long base, unsigned long mem_len); ++void unreserve_memory(unsigned long base, unsigned long mem_len); ++unsigned int ring_poll(struct file *file, ++ struct socket *sock, poll_table *wait); ++ring_cluster_element *cluster_lookup(u_int32_t cluster_id); ++int get_first_available_cluster_queue(ring_cluster_element *el); ++struct pf_ring_socket *get_first_cluster_consumer(ring_cluster_element *el); ++int add_sock_to_cluster_list(ring_cluster_element *el, struct sock *sk, u_int16_t consumer_id); ++int remove_from_cluster_list(struct ring_cluster *cluster_ptr, struct sock *sock); ++int setSocketStats(struct pf_ring_socket *pfr); ++void pf_ring_zc_dev_register(zc_dev_callbacks *callbacks, ++ zc_dev_ring_info *rx_info, ++ zc_dev_ring_info *tx_info, ++ void *rx_descr_packet_memory, ++ void *tx_descr_packet_memory, ++ void *phys_card_memory, ++ u_int32_t phys_card_memory_len, ++ u_int32_t channel_id, ++ struct net_device *dev, ++ struct device *hwdev, ++ zc_dev_model device_model, ++ u_char *device_address, ++ wait_queue_head_t *packet_waitqueue, ++ u_int8_t *interrupt_received, ++ void *rx_adapter, ++ void *tx_adapter); ++void pf_ring_zc_dev_unregister(struct net_device *dev, u_int32_t channel_id); ++void remove_device_from_proc(pf_ring_net *netns, pf_ring_device *dev_ptr); ++void remove_device_from_ring_list(struct net_device *dev); ++void add_device_to_proc(pf_ring_net *netns, pf_ring_device *dev_ptr); ++int add_device_to_ring_list(struct net_device *dev, int32_t dev_index); ++ ++/* ********************************** */ ++ + #define MIN_QUEUED_PKTS 64 + #define MAX_QUEUE_LOOPS 64 + diff --git a/libs/libpfring/patches/003-kernel-pf_ring-fix-old-style-declaration-compilation.patch b/libs/libpfring/patches/003-kernel-pf_ring-fix-old-style-declaration-compilation.patch new file mode 100644 index 0000000000..c22ad4679a --- /dev/null +++ b/libs/libpfring/patches/003-kernel-pf_ring-fix-old-style-declaration-compilation.patch @@ -0,0 +1,33 @@ +From f6d56c4a0cceffa0a3def7e32a0f7c470e86d652 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Mon, 18 Aug 2025 17:12:50 +0200 +Subject: [PATCH] kernel: pf_ring: fix old-style-declaration compilation + warning + +New kernel linux from 6.12 enabled new compilation Warning and this +cause errors if -Werror is enabled. + +There is currently one line that triggers the following warning: + +pf_ring.c:284:1: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration] + 284 | const static ip_addr ip_zero = { IN6ADDR_ANY_INIT }; + | ^~~~~ + +Implement the trivial fix to mute the warning. + +Signed-off-by: Christian Marangi +--- + kernel/pf_ring.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kernel/pf_ring.c ++++ b/kernel/pf_ring.c +@@ -269,7 +269,7 @@ static inline void printk_addr(u_int8_t + + /* ************************************************* */ + +-const static ip_addr ip_zero = { IN6ADDR_ANY_INIT }; ++static const ip_addr ip_zero = { IN6ADDR_ANY_INIT }; + + static u_int8_t pfring_enabled = 1; + diff --git a/libs/libpfring/patches/010-gcc14.patch b/libs/libpfring/patches/010-gcc14.patch index c17dc85aa8..0baee841eb 100644 --- a/libs/libpfring/patches/010-gcc14.patch +++ b/libs/libpfring/patches/010-gcc14.patch @@ -1,6 +1,6 @@ --- a/kernel/pf_ring.c +++ b/kernel/pf_ring.c -@@ -4713,8 +4713,8 @@ void reserve_memory(unsigned long base, +@@ -4772,8 +4772,8 @@ void reserve_memory(unsigned long base, { struct page *page, *page_end; @@ -11,7 +11,7 @@ SetPageReserved(page); } -@@ -4722,8 +4722,8 @@ void unreserve_memory(unsigned long base +@@ -4781,8 +4781,8 @@ void unreserve_memory(unsigned long base { struct page *page, *page_end; diff --git a/libs/libpfring/patches/100-fix-compilation-warning.patch b/libs/libpfring/patches/100-fix-compilation-warning.patch index 85393a2efb..6ce8ee6e13 100644 --- a/libs/libpfring/patches/100-fix-compilation-warning.patch +++ b/libs/libpfring/patches/100-fix-compilation-warning.patch @@ -1,6 +1,6 @@ --- a/kernel/pf_ring.c +++ b/kernel/pf_ring.c -@@ -3903,7 +3903,7 @@ static int hash_pkt_cluster(ring_cluster +@@ -3962,7 +3962,7 @@ static int hash_pkt_cluster(ring_cluster break; } /* else, fall through, because it's like 2-tuple for non-TCP packets */ diff --git a/libs/libpfring/patches/101-kernel-pf_ring-better-define-sa_data-size.patch b/libs/libpfring/patches/101-kernel-pf_ring-better-define-sa_data-size.patch index 3045818fcf..b2644d0c8e 100644 --- a/libs/libpfring/patches/101-kernel-pf_ring-better-define-sa_data-size.patch +++ b/libs/libpfring/patches/101-kernel-pf_ring-better-define-sa_data-size.patch @@ -42,7 +42,7 @@ Signed-off-by: Christian Marangi /* ************************************************* */ #if(LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) -@@ -1032,7 +1044,7 @@ pf_ring_device *pf_ring_device_name_look +@@ -1091,7 +1103,7 @@ pf_ring_device *pf_ring_device_name_look so the total interface name length is 13 chars (plus \0 trailer). The check below is to trap this case. */ @@ -51,7 +51,7 @@ Signed-off-by: Christian Marangi && device_net_eq(dev_ptr, net)) return dev_ptr; } -@@ -5605,15 +5617,15 @@ static int ring_bind(struct socket *sock +@@ -5664,15 +5676,15 @@ static int ring_bind(struct socket *sock #ifndef RING_USE_SOCKADDR_LL } else if (addr_len == sizeof(struct sockaddr)) { /* Deprecated */ diff --git a/libs/libpfring/patches/102-remove-sendpage.patch b/libs/libpfring/patches/102-remove-sendpage.patch index a5ca50900a..1b74607694 100644 --- a/libs/libpfring/patches/102-remove-sendpage.patch +++ b/libs/libpfring/patches/102-remove-sendpage.patch @@ -10,7 +10,7 @@ Change to remove .sendpage assignment, as that attribute seems to have gone away --- a/kernel/pf_ring.c +++ b/kernel/pf_ring.c -@@ -8470,7 +8470,9 @@ static struct proto_ops ring_ops = { +@@ -8529,7 +8529,9 @@ static struct proto_ops ring_ops = { .getname = sock_no_getname, .listen = sock_no_listen, .shutdown = sock_no_shutdown,