From 27caa1dcef32a5daffac1f221d04a9b43afc5f11 Mon Sep 17 00:00:00 2001 From: JiaY-shi Date: Thu, 17 Aug 2023 22:14:58 +0800 Subject: [PATCH] qualcommax: ipq60xx: refactor packet steering init --- .../usr/libexec/platform/packet-steering.sh | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 target/linux/qualcommax/ipq60xx/base-files/usr/libexec/platform/packet-steering.sh diff --git a/target/linux/qualcommax/ipq60xx/base-files/usr/libexec/platform/packet-steering.sh b/target/linux/qualcommax/ipq60xx/base-files/usr/libexec/platform/packet-steering.sh new file mode 100755 index 00000000000000..77e49c1cfadeb3 --- /dev/null +++ b/target/linux/qualcommax/ipq60xx/base-files/usr/libexec/platform/packet-steering.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +packet_steering="$(uci -q get network.@globals[0].packet_steering)" +flow_offloading="$(uci -q get firewall.@defaults[0].flow_offloading)" +flow_offloading_hw="$(uci -q get firewall.@defaults[0].flow_offloading_hw)" + +[ "$packet_steering" = 1 ] && { + if [ ${flow_offloading_hw:-0} -gt 0 ]; then + # HW offloading + # Not implemented + : + elif [ ${flow_offloading:-0} -gt 0 ]; then + # SW offloading + : + else + # Default + # LAN + for q in $(ls /sys/class/net/lan*/queues/rx-*/rps_cpus); do echo f > $q; done + for q in $(ls /sys/class/net/lan*/queues/tx-*/xps_cpus); do echo f > $q; done + for q in $(ls /sys/class/net/lan*/queues/rx-*/rps_flow_cnt); do echo 4096 > $q; done + # WAN + for q in $(ls /sys/class/net/wan/queues/rx-*/rps_cpus); do echo f > $q; done + for q in $(ls /sys/class/net/wan/queues/tx-*/xps_cpus); do echo f > $q; done + for q in $(ls /sys/class/net/wan/queues/rx-*/rps_flow_cnt); do echo 4096 > $q; done + + echo 32768 > /proc/sys/net/core/rps_sock_flow_entries + fi +} + +# Enable threaded network backlog processing +echo 1 > /proc/sys/net/core/backlog_threaded