Update 30-ext-devices-rps-setting

This commit is contained in:
padavanonly 2024-07-28 09:31:05 +08:00 committed by GitHub
parent 5fac673374
commit 6261c24206
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,10 +5,15 @@ NPROCS="$(grep -c "^processor.*:" /proc/cpuinfo)"
IFNAME_PREFIX="${INTERFACE%%[0-9]*}" IFNAME_PREFIX="${INTERFACE%%[0-9]*}"
if [ "${IFNAME_PREFIX}" = "usb" ] || [ "${IFNAME_PREFIX}" = "wwan" ]; then if [ "${IFNAME_PREFIX}" = "usb" ] || [ "${IFNAME_PREFIX}" = "wwan" ] || [ "${IFNAME_PREFIX}" = "rmnet" ] || [ "${IFNAME_PREFIX}" = "eth2" ] || [ "${IFNAME_PREFIX}" = "eth3" ] || [ "${IFNAME_PREFIX}" = "eth4" ] || [ "${IFNAME_PREFIX}" = "eth5" ]; then
if [ "$ACTION" = add ]; then if [ "$ACTION" = add ]; then
# set usb/wwan rps to cpu0 if [ "$NPROCS" -gt 2 ]; then
# set usb/wwan rps to cpu2
echo 2 > /sys/class/net/${INTERFACE}/queues/rx-0/rps_cpus
else
# set usb/wwan rps to cpu1
echo 1 > /sys/class/net/${INTERFACE}/queues/rx-0/rps_cpus echo 1 > /sys/class/net/${INTERFACE}/queues/rx-0/rps_cpus
fi
fi fi
[ -f /etc/init.d/mtk_smp ] && /etc/init.d/mtk_smp restart [ -f /etc/init.d/mtk_smp ] && /etc/init.d/mtk_smp restart
fi fi