diff --git a/target/linux/realtek/base-files/etc/hotplug.d/net/21-rtd129x-packet-steering b/target/linux/realtek/base-files/etc/hotplug.d/net/21-rtd129x-packet-steering new file mode 100644 index 0000000000..3be50a646f --- /dev/null +++ b/target/linux/realtek/base-files/etc/hotplug.d/net/21-rtd129x-packet-steering @@ -0,0 +1,30 @@ +#!/bin/sh +[ "$ACTION" = add ] || [ "$ACTION" = remove -a "$DEVTYPE" = ppp ] || exit + +NPROCS="$(grep -c "^processor.*:" /proc/cpuinfo)" +[ "$NPROCS" -eq 4 ] || exit + +grep -Fq rtd-1296 /proc/device-tree/compatible || exit + +cd /sys/class/net || exit + +[ -e eth0 -a -e eth1 ] || exit + +exec 512>/var/lock/smp_tune.lock +flock 512 || exit 1 + +PROTO=`uci get network.wan.proto` +logger -t 'rtd129x-packet-steering' "current proto $PROTO" +if echo " none static dhcp dhcpv6 " | grep -Fq " $PROTO "; then + [ "`cat eth0/queues/rx-0/rps_cpus`" = "0" ] && exit + echo 0 > eth1/queues/rx-0/rps_cpus + echo 0 > eth1/queues/tx-0/xps_cpus + echo 0 > eth0/queues/rx-0/rps_cpus + echo 0 > eth0/queues/tx-0/xps_cpus +else + [ "`cat eth0/queues/rx-0/rps_cpus`" = "a" ] && exit + echo a > eth1/queues/rx-0/rps_cpus + echo 5 > eth1/queues/tx-0/xps_cpus + echo a > eth0/queues/rx-0/rps_cpus + echo 5 > eth0/queues/tx-0/xps_cpus +fi