From 7d503412b859525850c4767485227df951d2fb2c Mon Sep 17 00:00:00 2001 From: suyuan <175338101@qq.com> Date: Thu, 28 Mar 2024 12:39:25 +0800 Subject: [PATCH] fix --- .../openmptcprouter/css/wanstatus.css | 3 +- .../files/etc/hotplug.d/net/10-usb | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100755 openmptcprouter/files/etc/hotplug.d/net/10-usb diff --git a/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/css/wanstatus.css b/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/css/wanstatus.css index bcff39c50..b4a8d7a02 100644 --- a/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/css/wanstatus.css +++ b/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/css/wanstatus.css @@ -1,6 +1,6 @@ .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */ - max-width: 1044px; + max-width: 1500px; } #interface_field { padding: 12px 20px 20px 20px; @@ -33,6 +33,7 @@ /* Mwan3 ligthed CSS */ #interface_field { padding: 0px; + max-width: 1200px; } #interface_field td { padding: 0px; diff --git a/openmptcprouter/files/etc/hotplug.d/net/10-usb b/openmptcprouter/files/etc/hotplug.d/net/10-usb new file mode 100755 index 000000000..e5de621ba --- /dev/null +++ b/openmptcprouter/files/etc/hotplug.d/net/10-usb @@ -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 \ No newline at end of file