1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

fix netift

This commit is contained in:
suyuan168 2022-04-06 20:55:49 +08:00
parent b76bbb581c
commit 5930a09dfc
38 changed files with 1918 additions and 68 deletions

View file

@ -14,7 +14,7 @@ find_irq_cpu() {
[ -n "$match" ] && {
set -- $match
shift
for cur in $(seq 1 $NPROCS); do
for cur in `seq 1 $NPROCS`; do
[ "$1" -gt 0 ] && {
cpu=$(($cur - 1))
break
@ -34,8 +34,8 @@ set_hex_val() {
echo "$val" > "$file"
}
packet_steering="$(uci get "network.@globals[0].packet_steering")"
[ "$packet_steering" != 1 ] && exit 0
default_ps="$(uci get "network.@globals[0].default_ps")"
[ -z "$default_ps" -o "$default_ps" == 0 ] && exit 0
exec 512>/var/lock/smp_tune.lock
flock 512 || exit 1
@ -52,16 +52,16 @@ for dev in /sys/class/net/*; do
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"
for q in ${dev}/queues/rx-*; do
set_hex_val "$q/rps_cpus" "$(($PROC_MASK & ~$irq_cpu_mask))"
done
# ignore dsa slave ports for RPS
subsys="$(readlink "${dev}/device/subsystem")"
subsys="$(basename "$subsys")"
[ "$subsys" = "mdio_bus" ] && continue
ntxq="$(ls -d ${dev}/queues/tx-* | wc -l)"
for q in ${dev}/queues/rx-*; do
set_hex_val "$q/rps_cpus" "$PROC_MASK"
idx=$(($irq_cpu + 1))
for q in ${dev}/queues/tx-*; do
set_hex_val "$q/xps_cpus" "$((1 << $idx))"
let "idx = idx + 1"
[ "$idx" -ge "$NPROCS" ] && idx=0
done
done

View file

@ -17,6 +17,7 @@ start_service() {
procd_open_instance
procd_set_param command /sbin/netifd
#procd_set_param limits core="unlimited"
procd_set_param respawn
procd_set_param watch network.interface
[ -e /proc/sys/kernel/core_pattern ] && {
@ -40,6 +41,11 @@ stop_service() {
sleep 1
}
service_running() {
ubus -t 30 wait_for network.interface
/sbin/wifi reload_legacy
}
validate_atm_bridge_section()
{
uci_validate_section network "atm-bridge" "${1}" \

View file

@ -1,23 +0,0 @@
. /lib/functions.sh
migrate_release() {
local config="$1"
local proto
local release
config_get proto "$config" proto
config_get release "$config" release
[ "$proto" = "dhcp" ] && [ -n "$release" ] && {
norelease="$((!$release))"
uci_set network "$config" norelease "$norelease"
uci_remove network "$config" release
}
}
config_load network
config_foreach migrate_release interface
uci commit network
exit 0

View file

@ -1 +0,0 @@
# This script is sourced by udhcpc's dhcp.script at every DHCP event.