From 04033ad1a5b3e1cefe5e977d02f64986e84d5f78 Mon Sep 17 00:00:00 2001 From: Vincent Li Date: Tue, 21 Oct 2025 01:44:14 +0000 Subject: [PATCH] xdp-tools: rebase on upstream 1.5.7 and add tc classifier commit ced17feca631f6963a2439f41ef09a7db048f316 (HEAD -> main) Author: Vincent Li Date: Mon Oct 20 21:28:17 2025 -0700 tc-basic-classifier: fix tcp port Endianess bug by AI AI generated class_filter program stored the tcp port in network order, but in bpf program the tcp port is converted to host order, and result in tcp port lookup failure, unable to get the correct classid, fail to do rate classification. Signed-off-by: Vincent Li commit a18fe4be0374ab1efb21c1228a5c5790ded7636e Author: Vincent Li Date: Mon Oct 20 19:15:34 2025 -0700 tc-basic-classifier: classify port and IP from bpf map add port and IP rate classification based on bpf map so user could add or remove port/IP rate classification dynamically at run time since TC class works on egress direction, so port rate classification works on red0 egress, and IP rate classification works on green0 egress port rate classification: class_filter -a -b ./class_filter.bpf.o -i red0 -v class_filter -i red0 --add-port 8080:10:80mbit class_filter -i red0 --add-port 8081:20:40mbit class_filter -i red0 --delete-port 8080 class_filter -i red0 --list-ports IP rate classification: class_filter -a -b ./class_filter.bpf.o -i green0 -v class_filter -i red0 --add-ip 192.168.1.0/24:40:30mbit class_filter -i red0 --delete-ip 192.168.1.0/24 class_filter -i red0 --list-ips Signed-off-by: Vincent Li commit 12280ef22ae49f75eda047144ed3e9dc0f73e04a Author: Vincent Li Date: Fri Oct 17 19:45:07 2025 -0700 tc-basic-classifier: add user space program the bpf skel header is generated only if USER_TARGETS is added in Makefile, so add a dummy user space program. Signed-off-by: Vincent Li commit fe5cc1814af4c995f61ec08708110deef7a65c45 Author: Vincent Li Date: Fri Oct 17 19:28:45 2025 -0700 xdp-tools: rebase on upstream xdp-tools main branch Signed-off-by: Vincent Li commit 7dee7fd954c06a3c58bedbb5561b9ee65c3f749f Author: Vincent Li Date: Fri Oct 17 18:39:59 2025 -0700 tc-basic-classifier: rename the class filter Signed-off-by: Vincent Li Signed-off-by: Vincent Li --- config/rootfiles/common/xdp-tools | 2 ++ html/cgi-bin/logs.cgi/ipblocklists.dat | 0 html/cgi-bin/logs.cgi/showrequestfromblocklist.dat | 0 lfs/xdp-tools | 4 ++-- 4 files changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 html/cgi-bin/logs.cgi/ipblocklists.dat mode change 100644 => 100755 html/cgi-bin/logs.cgi/showrequestfromblocklist.dat diff --git a/config/rootfiles/common/xdp-tools b/config/rootfiles/common/xdp-tools index b942a0fbb..adb87186b 100644 --- a/config/rootfiles/common/xdp-tools +++ b/config/rootfiles/common/xdp-tools @@ -8,6 +8,7 @@ usr/lib/bpf/xdp_sni.bpf.o usr/lib/bpf/xdp_geoip.bpf.o usr/lib/bpf/xdp_udpddos.bpf.o usr/lib/bpf/dnsdist_xdp.bpf.o +usr/lib/bpf/class_filter.bpf.o usr/sbin/xdp-udp usr/sbin/xdp_dns etc/rc.d/rc3.d/S102xdpdns @@ -46,5 +47,6 @@ usr/sbin/xdp-trafficgen usr/sbin/xdp_synproxy usr/sbin/xdp-udp usr/sbin/xdpdump +usr/sbin/class_filter usr/share/xdp-tools/xdp_drop.o usr/share/xdp-tools/xdp_pass.o diff --git a/html/cgi-bin/logs.cgi/ipblocklists.dat b/html/cgi-bin/logs.cgi/ipblocklists.dat old mode 100644 new mode 100755 diff --git a/html/cgi-bin/logs.cgi/showrequestfromblocklist.dat b/html/cgi-bin/logs.cgi/showrequestfromblocklist.dat old mode 100644 new mode 100755 diff --git a/lfs/xdp-tools b/lfs/xdp-tools index 40ad9825f..026f9260f 100644 --- a/lfs/xdp-tools +++ b/lfs/xdp-tools @@ -25,7 +25,7 @@ include Config -VER = 1.5.5 +VER = 1.5.7 THISAPP = xdp-tools-$(VER) DL_FILE = $(THISAPP).tar.gz @@ -41,7 +41,7 @@ objects = $(DL_FILE) $(DL_FILE) = $(DL_FROM)/$(DL_FILE) -$(DL_FILE)_BLAKE2 = 5b7772e2ffe2044073c6bc32b5ee44196145a0e13e61ea21e92a693ac45559f07995e71000d466623ce7bc57d46574c99324b7220eddc76d6ed3437aa2cdced9 +$(DL_FILE)_BLAKE2 = 3acd4997caf77c6a30ed484428f89aeed77f5a7484f8d4a0de6f45aa0ffcada8b19e78b9937ac97f38e6adf0f9782f5b4c19746a7be50a1be20792d4ab707ee8 install : $(TARGET)