Files
wlan-ap/patches/0044-netifd-update-to-latest-HEAD.patch
John Crispin 73d949cf3f 23.05: update patches
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:26 +02:00

145 lines
4.0 KiB
Diff

From 5287669135980433cbcd1064c950aeca19f6f82c Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Fri, 28 Jul 2023 16:50:08 +0200
Subject: [PATCH] netifd: update to latest HEAD
Signed-off-by: John Crispin <john@phrozen.org>
---
package/network/config/netifd/Makefile | 13 ++--
.../etc/hotplug.d/net/20-smp-packet-steering | 67 +++++++++++++++++++
.../netifd/patches/200-psk-radius.patch | 12 ++++
3 files changed, 86 insertions(+), 6 deletions(-)
create mode 100644 package/network/config/netifd/files/etc/hotplug.d/net/20-smp-packet-steering
create mode 100644 package/network/config/netifd/patches/200-psk-radius.patch
diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index 31fd0838a4..f749d72eb9 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -5,16 +5,14 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
-PKG_SOURCE_DATE:=2023-06-04
-PKG_SOURCE_VERSION:=ec9dba72124597b7224bbfe75960386dc320f4bd
-PKG_MIRROR_HASH:=baee39a3882a2b03fc83a3a6a8963c340fa8d884c7a8c9e80e7d2dddc50e24bd
+PKG_SOURCE_DATE:=2023-08-31
+PKG_SOURCE_VERSION:=1a07f1dff32b3af49e39533e33e8964b59535662
+PKG_MIRROR_HASH:=dc621dd04c3c9631002f929cf10a4620f57af8b0baf614c590bda17957fa6201
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=
-PKG_BUILD_FLAGS:=lto
-
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
@@ -32,7 +30,10 @@ endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include/libnl-tiny \
- -I$(STAGING_DIR)/usr/include
+ -I$(STAGING_DIR)/usr/include \
+ -flto
+
+TARGET_LDFLAGS += -flto -fuse-linker-plugin
CMAKE_OPTIONS += \
-DLIBNL_LIBS=-lnl-tiny \
diff --git a/package/network/config/netifd/files/etc/hotplug.d/net/20-smp-packet-steering b/package/network/config/netifd/files/etc/hotplug.d/net/20-smp-packet-steering
new file mode 100644
index 0000000000..8a86bf75f6
--- /dev/null
+++ b/package/network/config/netifd/files/etc/hotplug.d/net/20-smp-packet-steering
@@ -0,0 +1,67 @@
+#!/bin/sh
+[ "$ACTION" = add ] || exit
+
+NPROCS="$(grep -c "^processor.*:" /proc/cpuinfo)"
+[ "$NPROCS" -gt 1 ] || exit
+
+PROC_MASK="$(( (1 << $NPROCS) - 1 ))"
+
+find_irq_cpu() {
+ local dev="$1"
+ local match="$(grep -m 1 "$dev\$" /proc/interrupts)"
+ local cpu=0
+
+ [ -n "$match" ] && {
+ set -- $match
+ shift
+ for cur in $(seq 1 $NPROCS); do
+ [ "$1" -gt 0 ] && {
+ cpu=$(($cur - 1))
+ break
+ }
+ shift
+ done
+ }
+
+ echo "$cpu"
+}
+
+set_hex_val() {
+ local file="$1"
+ local val="$2"
+ val="$(printf %x "$val")"
+ [ -n "$DEBUG" ] && echo "$file = $val"
+ echo "$val" > "$file"
+}
+
+packet_steering="$(uci get "network.@globals[0].packet_steering")"
+[ "$packet_steering" != 1 ] && exit 0
+
+exec 512>/var/lock/smp_tune.lock
+flock 512 || exit 1
+
+for dev in /sys/class/net/*; do
+ [ -d "$dev" ] || continue
+
+ # ignore virtual interfaces
+ [ -n "$(ls "${dev}/" | grep '^lower_')" ] && continue
+ [ -d "${dev}/device" ] || continue
+
+ device="$(readlink "${dev}/device")"
+ device="$(basename "$device")"
+ irq_cpu="$(find_irq_cpu "$device")"
+ irq_cpu_mask="$((1 << $irq_cpu))"
+
+ for q in ${dev}/queues/tx-*; do
+ set_hex_val "$q/xps_cpus" "$PROC_MASK"
+ done
+
+ # ignore dsa slave ports for RPS
+ subsys="$(readlink "${dev}/device/subsystem")"
+ subsys="$(basename "$subsys")"
+ [ "$subsys" = "mdio_bus" ] && continue
+
+ for q in ${dev}/queues/rx-*; do
+ set_hex_val "$q/rps_cpus" "$PROC_MASK"
+ done
+done
diff --git a/package/network/config/netifd/patches/200-psk-radius.patch b/package/network/config/netifd/patches/200-psk-radius.patch
new file mode 100644
index 0000000000..cc1e7021c9
--- /dev/null
+++ b/package/network/config/netifd/patches/200-psk-radius.patch
@@ -0,0 +1,12 @@
+--- a/scripts/netifd-wireless.sh
++++ b/scripts/netifd-wireless.sh
+@@ -260,6 +260,9 @@ wireless_vif_parse_encryption() {
+ wpa3*)
+ auth_type=eap256
+ ;;
++ psk2-radius*)
++ auth_type=psk2-radius
++ ;;
+ psk3-mixed*|sae-mixed*)
+ auth_type=psk-sae
+ ;;
--
2.34.1