mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-14 19:41:51 +00:00
Should speedup USB
This commit is contained in:
parent
40bcdb46a8
commit
9f4251b59b
1 changed files with 34 additions and 0 deletions
34
openmptcprouter/files/etc/hotplug.d/net/10-usb
Executable file
34
openmptcprouter/files/etc/hotplug.d/net/10-usb
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/sh
|
||||
# Come from https://github.com/ofmodemsandmen/RooterSource/blob/main/package/rooter/ext-rooter-basic/files/etc/hotplug.d/net/10-usb
|
||||
|
||||
log() {
|
||||
logger -t "NET" "$@"
|
||||
}
|
||||
|
||||
NP=$(grep -c ^processor /proc/cpuinfo )
|
||||
if [ "$NP" -gt 1 ]; then
|
||||
log "hotplug (iface): action='$ACTION' interface='$INTERFACE'"
|
||||
if [ "$ACTION" = "add" ]; then
|
||||
IFACE=$(ls /sys/class/net)
|
||||
for i in ${IFACE}; do
|
||||
ethtool -K $i gro on 2>/dev/null
|
||||
if [[ -e /sys/class/net/$i/queues/rx-0/rps_cpus ]]; then
|
||||
echo f > /sys/class/net/$i/queues/rx-0/rps_cpus
|
||||
fi
|
||||
done
|
||||
|
||||
INTERRUPT=$(ls /proc/irq/ | sed '/default/d')
|
||||
USB3_NUMBER=$(grep xhci /proc/interrupts | awk -F: '{print $1}' | sed 's/^ //')
|
||||
|
||||
for i in ${INTERRUPT}; do
|
||||
if [[ $i = ${USB3_NUMBER} ]]; then
|
||||
echo f > /proc/irq/$i/smp_affinity 2>/dev/null
|
||||
else
|
||||
echo e > /proc/irq/$i/smp_affinity 2>/dev/null
|
||||
fi
|
||||
done
|
||||
|
||||
#inter=$(grep . /sys/class/net/$INTERFACE/queues/?x-0/?ps_cpus)
|
||||
#log "$inter"
|
||||
fi
|
||||
fi
|
Loading…
Reference in a new issue