#!/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