+
     Gii  c                   s    ^ RI t ^RIHt ^RI5 ^ RIt^ RIHt ^ RIH	t	 ^ RI
t
^ RIt^ RIt]P                  P                  4       tRt ! R R]P"                  4      tR# )	    N)hotplug)Z*)ethcard)commandsZpumbagsdc                   s>  a a ] tR t^t oRtV 3R ltV 3R ltR tR tR t	R t
V 3R ltV 3R	 ltV 3R
 ltR tR tR tR tR tV 3R ltR tV 3R ltR tR t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       tR tR tR t R t!R t"R t#R  t$]R! 4       t%]&! R"R#R$7      R% 4       t'](! R"4      RGR& l4       t)]&! R'4      R( 4       t*](! R'4      R) 4       t+. 3R* lt,RHR+ lt-]&! R,R#R$7      R- 4       t.R. t/](! R,4      RGR/ l4       t0]&! R0R#R$7      R1 4       t1](! R04      RGR2 l4       t2R3 t3R4 t4R5 t5R6 t6R7 t7R8 t8R9 t9RHR: lt:R; t;]<! R<R#R$7      R= 4       t=]<! R>R#R$7      R? 4       t>]<! R@R#R$7      RA 4       t?]<! RBR#R$7      RC 4       t@]<! RDR#R$7      RE 4       tARFtBVtCV ;tD# )INetTuningPlugina  
Configures network driver, hardware and Netfilter settings.
Dynamic change of the interface speed according to the interface
utilization is also supported. The dynamic tuning is controlled by
the [option]`dynamic` and the global [option]`dynamic_tuning`
option in `tuned-main.conf`.

`wake_on_lan`:::
The [option]`wake_on_lan` option sets wake-on-lan to the specified
value as when using the `ethtool` utility.
+
.Set Wake-on-LAN for device eth0 on MagicPacket(TM)
====
----
[net]
devices=eth0
wake_on_lan=g
----
====

`coalesce`:::
The [option]`coalesce` option allows changing coalescing settings
for the specified network devices. The syntax is:
+
[subs="quotes"]
----
coalesce=__param1__ __value1__ __param2__ __value2__ ... __paramN__ __valueN__
----
+
Note that not all the coalescing parameters are supported by all
network cards. For the list of coalescing parameters of your network
device, use `ethtool -c device`.
+
.Setting coalescing parameters rx/tx-usecs for all network devices
====
----
[net]
coalesce=rx-usecs 3 tx-usecs 16
----
====

`features`:::
The [option]`features` option allows changing 
the offload parameters and other features for the specified
network devices. To query the features of your network device,
use `ethtool -k device`. The syntax of the option is the same as
the [option]`coalesce` option.
+
.Turn off TX checksumming, generic segmentation and receive offload 
====
----
[net]
features=tx off gso off gro off
----
====

`pause`:::
The [option]`pause` option allows changing the pause parameters for
the specified network devices. To query the pause parameters of your
network device, use `ethtool -a device`. The syntax of the option
is the same as the [option]`coalesce` option.
+
.Disable autonegotiation
====
----
[net]
pause=autoneg off
----
====

`ring`:::
The [option]`ring` option allows changing the rx/tx ring parameters
for the specified network devices. To query the ring parameters of your
network device, use `ethtool -g device`. The syntax of the option
is the same as the [option]`coalesce` option.
+
.Change the number of ring entries for the Rx/Tx rings to 1024/512 respectively
=====
-----
[net]
ring=rx 1024 tx 512
-----
=====

`channels`:::
The [option]`channels` option allows changing the numbers of channels
for the specified network device. A channel is an IRQ and the set
of queues that can trigger that IRQ. To query the channels parameters of your
network device, use `ethtool -l device`. The syntax of the option
is the same as the [option]`coalesce` option.
+
.Set the number of multi-purpose channels to 16
=====
-----
[net]
channels=combined 16
-----
=====
+
A network device either supports rx/tx or combined queue
mode. The [option]`channels` option automatically adjusts the
parameters based on the mode supported by the device as long as a
valid configuration is requested.

`nf_conntrack_hashsize`:::
The [option]`nf_conntrack_hashsize` option sets the size of the hash
table which stores lists of conntrack entries by writing to
`/sys/module/nf_conntrack/parameters/hashsize`.
+
.Adjust the size of the conntrack hash table
====
----
[net]
nf_conntrack_hashsize=131072
----
====

`txqueuelen`:::
The [option]`txqueuelen` option allows changing txqueuelen (the length
of the transmit queue). It uses `ip` utility that is in package iproute
recommended for TuneD, so the package needs to be installed for its correct
functionality. To query the txqueuelen parameters of your network device
use `ip link show` and the current value is shown after the qlen column.
+
.Adjust the length of the transmit queue
====
----
[net]
txqueuelen=5000
----
====

`mtu`:::
The [option]`mtu` option allows changing MTU (Maximum Transmission Unit).
It uses `ip` utility that is in package iproute recommended for TuneD, so
the package needs to be installed for its correct functionality. To query
the MTU parameters of your network device use `ip link show` and the
current value is shown after the MTU column.
+
.Adjust the size of the MTU
====
----
[net]
mtu=9000
----
====
c                sD  < \         \        V `
  ! V/ VB  R V n        ^V n        \        4       V n        / V n        RV n        \        P                  ! R4      V n        \        \        P                  R4      '       d   V P                  V n        R# V P"                  V n        R# )g?Tz(?!.*/virtual/.*)
propertiesN)superr   __init___load_smallest_level_stepsr   _cmd_re_ip_link_show_use_iprecompilere_not_virtualZhasattrpyudevZDevice_get_device_property_1_get_device_property_get_device_property_2)selfargsZkwargs	__class__s   &*,=/usr/lib/python3.14/site-packages/tuned/plugins/plugin_net.pyr   ZNetTuningPlugin.__init__   s~    '88$$j$)$$,

#67$V]]L))#::4#::4    c                s  < \         \        V `  4        R V n        \	        4       V n        \	        4       V n        V P                  P                  R4       FA  pV P                  V4      '       g   K  V P
                  P                  VP                  4       KC  	  \        P                  R\        V P
                  4      ,          4       R# )Tnetzdevices: %sN)r   r   _init_devices_devices_supportedset_free_devices_assigned_devices_hardware_inventoryZget_devices_device_is_supportedZaddZsys_namelogdebugstr)r   devicer      & r   r   ZNetTuningPlugin._init_devices   s    ,. $u$5$((44U;f
''6??+ < ))MC 2 2334r   c                sb    V Uu. uF  q P                   P                  R V4      NK   	  up# u upi )r   )r   
get_device)r   devicesx   && r   _get_device_objectsZ#NetTuningPlugin._get_device_objects   s+    AH	IA
"
"
-
-eQ
7	II	Is   $,c                sL    V P                   P                  VP                  4      # N)r   matchZdevice_path)r   r$      &&r   r    Z$NetTuningPlugin._device_is_supported   s    				"	"6#5#5	66r   c                sT    V P                   P                  V R V P                  4       R# r   N)r   Z	subscribe_hardware_events_callbackr      &r   _hardware_events_initZ%NetTuningPlugin._hardware_events_init   s     $$T5$2P2PQr   c                s<    V P                   P                  V 4       R # r+   )r   Zunsubscriber0   r1   r   _hardware_events_cleanupZ(NetTuningPlugin._hardware_events_cleanup   s    &&t,r   c                s`   < V P                  V4      '       d   \        \        V `  W4       R # R # r+   )r    r   r   r/   )r   Zeventr$   r      &&&r   r/   Z)NetTuningPlugin._hardware_events_callback   s(    	v&&$9%H 'r   c                   < VP                   e   VP                   P                  V4       \        \        V `  W4       R # r+   )_load_monitorZ
add_devicer   r   _added_device_apply_tuningr   instancedevice_namer   r4   r   r7   Z*NetTuningPlugin._added_device_apply_tuning   s2    '$$[19(Pr   c                r5   r+   )r6   Zremove_devicer   r   _removed_device_unapply_tuningr8   r4   r   r;   Z.NetTuningPlugin._removed_device_unapply_tuning   s2    '''4=hTr   c                s8    VP                   P                  V4      # r+   )r   get)r   
pyudev_devprop   &&&r   r   Z&NetTuningPlugin._get_device_property_1   s    				"	"4	((r   c                sR     VP                  V4      pV#   \         d    R p T# i ; ir+   )Z__getitem__ZKeyError)r   r=   r>   Zp   &&& r   r   Z&NetTuningPlugin._get_device_property_2   s9    d#1 
( 
 1	
(s    &&c           
     s   V P                   P                  R V4      pV'       d   V P                  VR4      pV'       d   \        V P                  P                  4       4       F[  w  rEVP                  P                  V4      pV'       g   K*  \        P                  RV: RV: RV: R24       WP                  V&    R# 	  R# R# R# )r   IFINDEXzRename device, ifindex: 'z', original name 'z', new name ''N)r   r&   r   listZ
_instancesitems_ifmap_origr<   r!   r"   
_ifnamemap)r   r:   diZinstance_namer9   Zdevice_name_olds   &&     r   _move_deviceZNetTuningPlugin._move_device   s    
))%=!  I.1#'(=(=(?#@++//2_	ii	?K) *-8/* $A  r   c                s   a V3R  lpV# )c                 sR   < SP                   P                  V 4      pV'       d   V# T # r+   )rF   r<   )r$   rG   r9   r%   r   _get_curr_deviceZBNetTuningPlugin._get_curr_device_wrapper.<locals>._get_curr_device   s&    v&1!fr    )r   r9   rJ   s   &f r   _get_curr_device_wrapperZ(NetTuningPlugin._get_curr_device_wrapper   s     
r   c                s    R Vn         RVn        RVn        RVn        / Vn        V P                  V4      Vn        V P                  VP                  R,          4      Vn	        R# )TNdynamic)
Z_has_static_tuningr6   _idle_statsrF   rL   rJ   Z_option_boolZoptionsZ_has_dynamic_tuningr   r9   r-   r   _instance_initZNetTuningPlugin._instance_init   sY     $(((.(/(";;HE(!%!2!283C3CI3N!O(r   c                s  < \         \        V `  V4       / Vn        VP                  pV FS  pV P
                  P                  R V4      pV'       g   K)  V P                  VR4      pV'       g   KE  W1P                  V&   KU  	  R# )r   rA   N)r   r   assign_free_devicesrE   assigned_devicesr   r&   r   )r   r9   r'   r$   rG   rH   r   s   &&    r   rR   Z#NetTuningPlugin.assign_free_devices  sq    28<(%%'f**5&91a!!!Y/Aq%! r   c                s~    VP                   e/   V P                  P                  VP                   4       R Vn         R # R # r+   )r6   _monitors_repositoryZdeleterP   r-   r   _instance_cleanupZ!NetTuningPlugin._instance_cleanup  s5    '##H$:$:; 8 (r   c                s   < \         \        V `  V4       / Vn        / Vn        V P
                  P                  R VP                  4      Vn        VP                  P                  VP                  4       R# r.   )r   r   _instance_init_dynamicrN   rO   rT   ZcreaterS   r6   Z_set_dev_maprJ   )r   r9   r   s   &&r   rV   Z&NetTuningPlugin._instance_init_dynamic  s[    5h?(.(/44;;E8C\C\](
%%h&?&?@r   c                s(    V P                  W4       R # r+   )_instance_update_dynamicr   r9   r$   r?   r   _instance_apply_dynamicZ'NetTuningPlugin._instance_apply_dynamic  s    1r   c                s   VP                   P                  V4       Uu. uF  p\        V4      NK  	  ppVf   R # W!P                  9   g   V P	                  W4       V P                  WV4       V P                  W4       VP                  V,          pVP                  V,          pVR,          ^ 8X  dm   VR,          V P                  8  dU   VR,          V P                  8  d=   ^VR&   \        P                  RV,          4       \        V4      P                  ^d4       MdVR,          ^8X  dW   VR,          ^ 8X  g   VR,          ^ 8X  d;   ^ VR&   \        P                  RV,          4       \        V4      P                  4        \        P                  RW%R,          VR,          3,          4       \        P                  RW&R,          VR,          VR,          3,          4       R # u upi )Nlevelreadwritez%s: setting 100Mbps%s: setting max speedz %s load: read %0.2f, write %0.2fz$%s idle: read %d, write %d, level %d)r6   Zget_device_loadintrO   _init_stats_and_idle_update_stats_update_idlerN   r	   r!   infor   Z	set_speedset_max_speedr"   )r   r9   r$   valueZloadZstatsZidles   &&&    r   rW   Z(NetTuningPlugin._instance_update_dynamic  s~   "*"8"8"H"H"P	Q"P#e*"P$	Q	\		??	"X.Xt,H%
//&
!%		$	']aDLD,=,==$w-SWSdSdBd4=88!F*+
6?S!G}tF|q0DMQ4F4=88#f,-
6?  ")).&-w1XXY))2f6lDQXM[_`g[h5iij- 
Rs   G$c                s    / R RbRRbRRbRRbRRbRRbRRbRRbR	RbR
RbRRbRRbRRbRRbRRbRRbRRbRRRRRRRRRRRR/C# )zadaptive-rxNzadaptive-txzcqe-mode-rxzrx-usecsz	rx-frameszrx-usecs-irqzrx-frames-irqztx-usecsz	tx-framesztx-usecs-irqztx-frames-irqzstats-block-usecszpkt-rate-lowzrx-usecs-lowzrx-frames-lowztx-usecs-lowztx-frames-lowzpkt-rate-highzrx-usecs-highzrx-frames-highztx-usecs-highztx-frames-highzsample-intervalrK   Zclsr1   r   _get_config_options_coalesceZ,NetTuningPlugin._get_config_options_coalesce6  s    
$
$
 $
 t	

 
 4
 D
 t
 
 4
 D
 
 4
 4
 D
  4!
" D#
$ DDTDTd/
 r   c                s    R RRRRR/# )autonegNrxtxrK   re   r1   r   _get_config_options_pauseZ)NetTuningPlugin._get_config_options_pauseR  s    d
 r   c                    R RRRRRRR/# )rh   Nrx-minirx-jumbori   rK   re   r1   r   _get_config_options_ringZ(NetTuningPlugin._get_config_options_ringX  s     dt
 r   c                rk   )rh   Nri   othercombinedrK   re   r1   r   _get_config_options_channelsZ,NetTuningPlugin._get_config_options_channels_  s     
Dt
 r   c                s.    R RRRRRRRRRRRRRR	RR
RRR/
# )rM   Twake_on_lanNnf_conntrack_hashsizefeaturescoalescepauseringchannels
txqueuelenmturK   re   r1   r   _get_config_optionsZ#NetTuningPlugin._get_config_optionsf  s@     d$Dtt
D	4t$
 r   c                s    V P                  \        VP                  V4      4      P                  4       4      pR ^^ .,          R^V^.,          /VP                  V&   R^ R^ R^ /VP
                  V&   R# )newmaxrZ   r[   r\   N)_calc_speedr   rJ   Zget_max_speedrO   rN   )r   r9   r$   Z	max_speedr@   r   r_   Z$NetTuningPlugin._init_stats_and_idleu  sl    wx'@'@'HIWWYZ)#Q!WeQ)Q5GI(//&$aGQ@(..r   c                s   VP                   V,          R ,          ;VP                   V,          R&   pW1P                   V,          R &   \        W44       Uu. uF  qU^ ,          V^,          ,
          NK  	  ppWaP                   V,          R&   VP                   V,          R,          p\        Wv4       Uu. uF  p\        V4      NK  	  p	pWP                   V,          R&   \        V^ ,          4      \        V	^ ,          4      ,          VP                   V,          R&   \        V^,          4      \        V	^,          4      ,          VP                   V,          R&   R# u upi u upi )r|   Zolddiffr}   r[   r\   N)rO   zipr}   Zfloat)
r   r9   r$   Znew_loadZold_loadZnew_oldr   Zold_max_loadZpairZmax_loads
   &&&&      r   r`   ZNetTuningPlugin._update_statsz  s   .6oof.Ee.LL(//&% 8#+//&%  25X1H	I1Hg!*wqz
!
!1H$	I$(//&&! (/,$'$;<$;Dc$i$;(<#+//&%  &+47^eHQK6H%H(//&&!%*47^eHQK6H%H(//&'" 
J
 =s   E0Ec                s    R Fj  pVP                   V,          V,          V P                  8  d)   VP                  V,          V;;,          ^,          uu&   KT  ^ VP                  V,          V&   Kl  	  R# )r[   N)r[   r\   )rO   r   rN   )r   r9   r$   Z	operationr@   r   ra   ZNetTuningPlugin._update_idle  sT    $ioofi(4+>+>>NN69%*%()HNN69%	 %r   c                s    W!P                   9   d~   VP                   V,          R ,          ^ 8  d]   ^ VP                   V,          R &   \        P                  RV,          4       \        VP	                  V4      4      P                  4        R# R# R# )rZ   r]   N)rN   r!   rb   r   rJ   rc   rX   r?   r   _instance_unapply_dynamicZ)NetTuningPlugin._instance_unapply_dynamic  sk    ~~(.."8"AA"E%&8>>&'"88#f,-
8$$V,-;;= #Fr   c                s4    \        RV,          ^,          4      # )g333333?g333333#A)r^   )r   Zspeedr-   r   r~   ZNetTuningPlugin._calc_speed  s    
 !E)A-	..r   c           	     s   V P                   P                  V4      p\        \        P                  ! R RV4      4      P                  4       p\        V4      pV^,          ^ 8w  d*   \        P                  RV: R\        V4      : R24       R# V^ 8X  d   \        4       # \        \        \        VR,          VR,          4      4      4      # )z (:\s*)|(\s+)|(\s*;\s*)|(\s*,\s*) zinvalid z parameter: 'rB   NNN      Nr   )Z
_variablesZexpandr#   r   subsplitlenr!   errordictrC   r   )r   rd   contextvZlvs   &&&  r   _parse_config_parametersZ(NetTuningPlugin._parse_config_parameters  s    
//
 
 
'%	"&&4c5
ABHHJ!
1v"!Vq[99Wc%jAB
1W
&=	d3qvqw'(	))r   c                sx   V P                   P                  / R RbRRbRRbRRbRR	bR
RbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbR R!bR"R#R$R%/CV4      pVP                  R&4       Uu. uFH  p\        \	        V4      4      ^ 8  g   K  \
        P                  ! R'\	        V4      4      '       d   KF  VNKJ  	  pp\        V4      ^8  d   R(# \        VR),           Uu. uF#  p\
        P                  ! R*\	        V4      4      NK%  	  up Uu. uF  p\        V4      ^8X  g   K  VNK  	  up4      # u upi u upi u upi )+zAdaptive RX:zadaptive-rx:z\s+TX:z
adaptive-tx:zCQE mode RX:zcqe-mode-rx:zrx-frame-low:zrx-frames-low:zrx-frame-high:zrx-frames-high:ztx-frame-low:ztx-frames-low:ztx-frame-high:ztx-frames-high:zlarge-receive-offload:zlro:zrx-checksumming:zrx:ztx-checksumming:ztx:zscatter-gather:zsg:ztcp-segmentation-offload:ztso:zudp-fragmentation-offload:zufo:zgeneric-segmentation-offload:zgso:zgeneric-receive-offload:zgro:zrx-vlan-offload:zrxvlan:ztx-vlan-offload:ztxvlan:zntuple-filters:zntuple:zreceive-hashing:zrxhash:
z
\[fixed\]$Nr   NN:\s*)r
   multiple_re_replacer   r   r#   r   searchr   )r   rd   r   ZvlZu   &&   r   _parse_device_parametersZ(NetTuningPlugin._parse_device_parameters  s    ))
'
' )>)) >) $	)
 &) $) &) V) u) u) e) )  ) #F) v)  y!)" y#)$ iy')( )%, ;;t$a$aCFa		-Y\]^Y_@`$"aWq[
 
bfEf288GSV4fEUEQQSTqqEU	VV b
 FUs$   )D-	#D-1D-)D2	D7 D7c                s    R # )z,/sys/module/nf_conntrack/parameters/hashsizerK   r0   r1   r   _nf_conntrack_hashsize_pathZ+NetTuningPlugin._nf_conntrack_hashsize_path  s    	7r   rr   T)Z
per_devicec                sN   Vf   R # \         P                  ! RR\        V4      4      p\         P                  ! R\        ,           R,           V4      '       g   \
        P                  R4       R # V'       g0   V P                  P                  RRVP                  V4      RV.4       V# )	N0rG   z^[z]+$zIncorrect 'wake_on_lan' value.ethtoolz-sZwol)
r   r   r#   r,   
WOL_VALUESr!   warningr
   executerJ   )r   rd   r$   r9   simremoves   &&&&&&r   _set_wake_on_lanZ NetTuningPlugin._set_wake_on_lan  s~    
]
 &&sCJ
'%	%*$v-u	5	5;;/0
	99ix'@'@'H%QVWX	,r   c           	     s4   R p \         P                  ! R\        ,           R,           V P                  P	                  RVP                  V4      .4      ^,          \         P                  4      pV'       d   VP                  ^4      pV#   \         d     T# i ; i)Nz.*Wake-on:\s*([z]+).*r   )	r   r,   r   r
   r   rJ   ZSgroupZIOError)r   r$   r9   ignore_missingrd   Zm   &&&&  r   _get_wake_on_lanZ NetTuningPlugin._get_wake_on_lan  s    
%	xx"Z/'9IIy(";";F"CDEaH"$$P1GGAJE 
, 
 	,s   A0B 5B BBrs   c                s    Vf   R # \        V4      pV^ 8  dP   V'       gF   V P                  P                  V P                  4       TV'       d   \        P
                  .MRR7       V# R # )NF)Zno_error)r^   r
   Zwrite_to_filer   errnoENOENT)r   rd   r9   r   r   Zhashsizes   &&&&& r   _set_nf_conntrack_hashsizeZ*NetTuningPlugin._set_nf_conntrack_hashsize  sV    
]
Z(]
IID<<>"(e  5
?
r   c                s    V P                   P                  V P                  4       4      p\        V4      ^ 8  d   \	        V4      # R# )r    N)r
   Z	read_filer   r   r^   )r   r9   rd   r)   r   _get_nf_conntrack_hashsizeZ*NetTuningPlugin._get_nf_conntrack_hashsize   s7    
))

d>>@
A%Z!^
e*	r   c                s   V P                   '       g   R # RR.V,           pV P                  P                  V\        P                  .RR7      w  r#pV\        P                  ) 8X  d   \
        P                  R4       RV n         R # V'       d6   \
        P                  R4       \
        P                  RV: R	V: R
24       R # V# )NZipZlinkT)	no_errorsZ
return_errz0ip command not found, ignoring for other devicesFzProblem calling ip commandz(rc: z, msg: 'z'))	r   r
   r   r   r   r!   r   rb   r"   )r   r   ZrcoutZerr_msgr   r   _call_ip_linkZNetTuningPlugin._call_ip_link  s    	

$	$yy((%,,TX(Y2GELL=;;AB4<
	88()99b'23
	*r   c                s\    R .pV'       d   VP                  V4       V P                  V4      # )Zshow)Zappendr   )r   r$   r   r)   r   _ip_link_showZNetTuningPlugin._ip_link_show  s)    
$;;v			D	!!r   ry   c                B   Vf   R #  \        V4       T'       gW   T P	                  RRTP                  T4      RT.4      pTf.   \        P                  RTP                  T4      ,          4       R # T#   \         d!    \        P                  RT,          4        R # i ; i)Nz$txqueuelen value '%s' is not integerr   devry   z%Cannot set txqueuelen for device '%s'r^   Z
ValueErrorr!   r   r   rJ   r   rd   r$   r9   r   r   res   &&&&&& r   _set_txqueuelenZNetTuningPlugin._set_txqueuelen  s    
]
u: 
			UE8+D+DV+Ll\ab	c3	kKK7(:S:STZ:[[\	, 
 ;;5=>
   A3 3'BBc                s    WP                   9  d+   \        P                  ! RV,          4      V P                   V&   V P                   V,          # )z<
Return regex for int arg value from "ip link show" command
z.*\s+%s\s+(\d+))r   r   r   )r   Zargr-   r   _get_re_ip_link_showZ$NetTuningPlugin._get_re_ip_link_show-  s@     	%%% "

+=+C D4			s	##r   c                   V P                  VP                  V4      4      pVf6   V'       g,   \        P                  RVP                  V4      ,          4       R # V P	                  R4      P                  V4      pVf6   V'       g,   \        P                  RVP                  V4      ,          4       R # VP                  ^4      # )NzECannot get 'ip link show' result for txqueuelen value for device '%s'ZqlenzFCannot get txqueuelen value from 'ip link show' result for device '%s'r   rJ   r!   rb   r   r   r   r   r$   r9   r   r   r   r   r   _get_txqueuelenZNetTuningPlugin._get_txqueuelen5  s    844V<=#[
HHTv&' (
!!&)005#[
HHUv&' (
	1r   rz   c                r   )Nzmtu value '%s' is not integerr   r   rz   zCannot set mtu for device '%s'r   r   r   r   _set_mtuZNetTuningPlugin._set_mtuF  s    
]
u: 
			UE8+D+DV+LeUZ[	\3	kKK083L3LV3TTU	, 
 ;;.67
r   c                r   )Nz>Cannot get 'ip link show' result for mtu value for device '%s'rz   z?Cannot get mtu value from 'ip link show' result for device '%s'r   r   r   r   _get_mtuZNetTuningPlugin._get_mtuV  s    844V<=#[
HHMv&' (
!!%(//4#[
HHNv&' (
	1r   c           	     s   VR 8X  d   R# \        VP                  4       4      pRV P                  RV P                  RV P                  RV P
                  /p\        WA,          ! 4       P                  4       4      pVP                  V4      '       g/   \        P                  RV: R\        W5,
          4      : 24       R# R# )	rt   Tru   rv   rw   rx   zunknown z parameter(s): F)
r   keysrf   rj   rn   rq   Zissubsetr!   r   r#   )r   r   rG   ZparamsZsupported_getterZ	supporteds   &&&   r   _check_parametersZ!NetTuningPlugin._check_parametersh  s    

qvvx=&!4#D#DT++
D))114 "+-2245)		#	#99gs6;M7NOP
	r   c           	     s   V P                   P                  R RRRRR/V4      pVP                  R4      R,          pV Uu. uF,  q3R8w  g   K  \        P                  ! R	V4      '       d   K*  VNK.  	  pp\        V Uu. uF  p\        P                  ! R
V4      NK  	  up Uu. uF  p\        V4      ^8X  g   K  VNK  	  up4      # u upi u upi u upi )ZAutonegotiaterg   RXrh   TXri   r   r    z	\[fixed\]r   )r
   r   r   r   r   r   r   )r   slr(   s   &&  r   _parse_pause_parametersZ'NetTuningPlugin._parse_pause_parametersw  s    
ii##i$$! ggdmB!B!QBwqryyq'Aqq!!B	;A288GQ/;K;Qs1v{qq;K	LL C;Ks#   CC+C< C
!C8Cc           
        \         P                  ! R V\         P                  R7      pV^,          pV P                  P	                  RRRRRRRR	/V4      pVP                  R
4      pV Uu. uF  qDR8w  g   K  VNK  	  ppV Uu. uF  p\         P                  ! RV4      NK  	  up Uu. uF  p\        V4      ^8X  g   K  VNK  	  pp\        V4      # u upi u upi u upi )^Current hardware settings:$Zflagsr   rh   zRX Minirl   zRX Jumborm   r   ri   r   r   r   r   r   Z	MULTILINEr
   r   r   r   r   r   Zar   r(   r   r   _parse_ring_parametersZ&NetTuningPlugin._parse_ring_parameters  s    hh.F!d!
ii##	4y
$ 	!
 ggdm!!QBwqq!!123A288GQ'3C3Qs1v{qq3!C	a.  3C   *C7C C(C?Cc           
     r   )r   r   r   rh   r   ri   ZOtherro   ZCombinedrp   r   r   r   r   r   r   r   _parse_channels_parametersZ*NetTuningPlugin._parse_channels_parameters  s    hh.F!d!
ii##	4$W
 	 !
 ggdm!!QBwqq!!123A288GQ'3C3Qs1v{qq3!C	a.  3Cr   c           	     sD   . pR V9   d%   VP                  RV^,          RV^,          .4       MH\        \        \        V^,          4      \        V^,          4      4      4      pVP                  R V.4       \	        \        \        VR,          VR,          4      4      4      # )rp   rh   ri   r   r   )Zextendr#   r}   r^   r   rC   r   )r   r   Zparams_list
dev_paramsZmod_params_listZcntr   r   _replace_channels_parametersZ,NetTuningPlugin._replace_channels_parameters  s    /;4Q{1~FG	S[^$c+a.&9:	;3:s+,	d3s+_T-BCD	EEr   c           
     s   \        VP                  4       4      p\        VP                  4       4      pVV,
          pV FD  p	\        P                  V: RV	: RVP	                  V4      : 24       VP                  V	R4       KF  	  R# )a,  Filter unsupported parameters and log warnings about it

Positional parameters:
instance -- instance calling it
context -- context of change
parameters -- parameters to change
device -- name of device on which should be parameters set
dev_params -- dictionary of currently known parameters of device
z parameter z is not supported by device N)r   r   r!   r   rJ   Zpop)
r   r9   r   Z
parametersr$   r   Zsupported_parametersZparameters_to_changeZunsupported_parametersparams
   &&&&&&    r   _check_device_supportZ%NetTuningPlugin._check_device_support  sw     Z__./Z__./ 1%e;;	f% 
 >>% &r   c           
     s   R RRRRRRRRR	/pWB,          pV P                   P                  R
WQP                  V4      .4      w  rgV^ 8w  g   \        V4      ^ 8X  d   R# R V P                  RV P                  RV P
                  RV P                  RV P                  /pW,          p	V	! V4      p
VR 8X  d   V P                  W*4      '       g   R# V
# )ru   z-crt   z-krv   z-arw   z-grx   z-lr   N)	r
   r   rJ   r   r   r   r   r   r   )r   r9   r   r$   context2optoptZretrd   Zcontext2parserZparserrG   s   &&&&       r   _get_device_parametersZ&NetTuningPlugin._get_device_parameters  s    dJgtVT+#yy  )S2K2KF2S!TU*#AXUq
!>!>--T))
D''//	2.
 "&Um!
4#9#9'#E#E
	
(r   c           
     s   Ve   \        V4      ^ 8X  d   R # V P                  W24      pVe   V P                  W'4      '       g   / # V'       do   V P                  WWtV4       VR8X  dU   \	        V\        \        V4      4      ,          4      R9   d,   V P                  W P                  P                  V4      V4      pV'       g   \        V4      ^ 8w  d   \        P                  RV: R\	        V4      : 24       RRRRRR	R
RRR/pW,          p	V P                  P                  RWP                  V4      .V P                  P                  V4      ,           ^P.R7       V# )Nrx   zsetting z: ru   z-Crt   z-Krv   z-Arw   z-Gz-Lr   )r   )zn/ar   )r   r   r   r   r#   ZnextZiterr   r
   	dict2listr!   r"   r   rJ   )
r   r9   r   rd   r$   r   r   rG   r   r   s
   &&&&&&&   r   _set_device_parametersZ&NetTuningPlugin._set_device_parameters  s&   
]c%jAo

##E3!Yd,,W88
9hJGJtDG}$= >, N))'993F3Fq3I:VA	Q199#a&12tZwfd *D2;		399i&?&?&GHII)+  .	
(r   c           	     s   V P                  VVR 7      pV'       Ed6   V P                  WaV4      pVe   \        V4      ^ 8X  d   R# V P                  WaW4VVR7      p	V	e   \        V	4      ^ 8X  d   R# VP	                  4        U
Uu. uF  w  rW9   g   K  W3NK  	  pp
p\        V4      pV'       d^   V P                  P                  V	4      V P                  P                  V4      8H  pV P                  WV	VVP                  V4      R7       V# V P                  P                  VRP                  V P                  P                  V4      4      4       R# V P                  P                  V4      pV P                  WaWR4       R# u upp
i ))Zcommand_namer:   NF)r   )r$   r   )Z_storage_keyr   r   r   rD   r   r
   r   Z_log_verification_resultrJ   Z_storager   Zjoinr<   )r   r   startrd   r$   verifyr9   Zstorage_keyZparams_currentZ
params_setr   Zrelevant_params_currentr   Zoriginal_values   &&&&&&&       r   _custom_parametersZ"NetTuningPlugin._custom_parameters  s   !! " + U//6J>N 3q 8++H
F  , ":
 C
Oq0 2> -un   ""9:99z*			4	56C!!'((0 " 2 J==[#((	YY01#3 4 
	 MM%%k2> x.%P	)s   
FFrt   c                *    V P                  R WW4V4      # )rt   r   r   r   rd   r$   r   r   r9      &&&&&&&r   	_featuresZNetTuningPlugin._features      		 	 U68	TTr   ru   c                r   )ru   r   r   r   r   	_coalesceZNetTuningPlugin._coalesce  r   r   rv   c                r   )rv   r   r   r   r   _pauseZNetTuningPlugin._pause  s    		 	 %	QQr   rw   c                r   )rw   r   r   r   r   _ringZNetTuningPlugin._ring  s    		 	 vx	PPr   rx   c                r   )rx   r   r   r   r   	_channelsZNetTuningPlugin._channels  r   r   )
r   r
   r   r   r   r	   r   r   r   r   )Fr+   )EZ__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r   r   r*   r    r2   r3   r/   r7   r;   r   r   rI   rL   rQ   rR   rU   rV   rY   rW   Zclassmethodrf   rj   rn   rq   r{   r_   r`   ra   r   r~   r   r   r   Zcommand_setr   Zcommand_getr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Zcommand_customr   r   r   r   r   Z__static_attributes__Z__classdictcell__Z__classcell__)r   Z__classdict__s   @@r   r   r      s    Rh;
6J7R-IQ
U)P	&!
A2k2  6  
      A
I$*>/*WB 8 8 m- . m	 	 %& ' %& ' ! " lt, - $ l   e% & e "MF0$0#J $/U 0U $/U 0U t,R -R d+Q ,Q $/U 0U Ur   r   )r   r   r   Z
decoratorsZ
tuned.logsZtunedZtuned.utils.nettoolr   Ztuned.utils.commandsr   Zosr   r   Zlogsr<   r!   r   ZPluginr   rK   r   r   <module>r      sI        ' ) 	 	 jjnn
OUgnn OUr   