mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	fix
This commit is contained in:
		
							parent
							
								
									e79c99b008
								
							
						
					
					
						commit
						7d503412b8
					
				
					 2 changed files with 36 additions and 1 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…
	
	Add table
		Add a link
		
	
		Reference in a new issue