ethtool: add pause and offload settings support
This commit is contained in:
		
							parent
							
								
									72277e51e2
								
							
						
					
					
						commit
						e4b4d8b70a
					
				
					 1 changed files with 19 additions and 0 deletions
				
			
		|  | @ -1,6 +1,20 @@ | |||
| #!/bin/sh | ||||
| set -e | ||||
| 
 | ||||
| # gather params for a given prefix, based on executor-scripts/linux/tunnel. | ||||
| gather_params() { | ||||
| 	set | sed -E " | ||||
| 		s/^IF_${1}_([A-Z0-9_]+)=(.+)/\1\n\2/ | ||||
| 		ta | ||||
| 		d | ||||
| 		:a | ||||
| 		h | ||||
| 		y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ | ||||
| 		P | ||||
| 		g | ||||
| 	        s/.*\n//" | ||||
| } | ||||
| 
 | ||||
| case "$PHASE" in | ||||
| pre-up) | ||||
| 	settings="\ | ||||
|  | @ -32,5 +46,10 @@ up) | |||
| 
 | ||||
| 	[ -z "$link_settings" ] || $MOCK ethtool --change "$IFACE" $link_settings | ||||
| 
 | ||||
| 	pause_settings=$(gather_params IF_ETHTOOL_ETHERNET_PAUSE) | ||||
| 	[ -z "$pause_settings" ] || $MOCK ethtool --pause "$IFACE" $pause_settings | ||||
| 
 | ||||
| 	offload_settings=$(gather_params IF_ETHTOOL_OFFLOAD) | ||||
| 	[ -z "$offload_settings" ] || $MOCK ethtool --offload "$IFACE" $offload_settings | ||||
| 	;; | ||||
| esac | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue