HEX
Server: Apache
System: Linux nc-ph-4101.simplemoneygoals.com 5.14.0-503.21.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jan 12 09:45:05 EST 2025 x86_64
User: dailygoldindex (1004)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/tuned/plugins/__pycache__/plugin_net.cpython-39.pyc
a

,�g�i�@sxddlZddlmZddlTddlZddlmZddlm	Z	ddl
Z
ddlZddlZej
��ZdZGdd	�d	ej�ZdS)
�N�)�hotplug)�*)�ethcard)�commandsZpumbagsdcs�eZdZdZ�fdd�Z�fdd�Zdd�Zdd	�Zd
d�Zdd
�Z	�fdd�Z
�fdd�Z�fdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Z�fdd�Zd d!�Z�fd"d#�Zd$d%�Zd&d'�Zed(d)��Zed*d+��Zed,d-��Zed.d/��Zed0d1��Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z d:d;�Z!d<d=�Z"d>d?�Z#ed@dA��Z$e%dBdCdD�dEdF��Z&e'dB�d�dHdI��Z(e%dJ�dKdL��Z)e'dJ�dMdN��Z*gfdOdP�Z+d�dRdS�Z,e%dTdCdD�dUdV��Z-dWdX�Z.e'dT�d�dYdZ��Z/e%d[dCdD�d\d]��Z0e'd[�d�d^d_��Z1d`da�Z2dbdc�Z3ddde�Z4dfdg�Z5dhdi�Z6djdk�Z7dldm�Z8d�dndo�Z9dpdq�Z:e;drdCdD�dsdt��Z<e;dudCdD�dvdw��Z=e;dxdCdD�dydz��Z>e;d{dCdD�d|d}��Z?e;d~dCdD�dd���Z@�ZAS)��NetTuningPluginaO
	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
	----
	====
	csdtt|�j|i|��d|_d|_t�|_i|_d|_t	�
d�|_tt
jd�rX|j|_n|j|_dS)Ng�������?�Tz(?!.*/virtual/.*)�
properties)�superr�__init__�_load_smallest�_level_stepsr�_cmd�_re_ip_link_show�_use_ip�re�compile�re_not_virtual�hasattr�pyudevZDevice�_get_device_property_1�_get_device_property�_get_device_property_2)�self�args�kwargs��	__class__��</usr/lib/python3.9/site-packages/tuned/plugins/plugin_net.pyr�s
zNetTuningPlugin.__init__csftt|���d|_t�|_t�|_|j�d�D]}|�	|�r0|j�
|j�q0t�
dt|j��dS)NT�netzdevices: %s)r
r�
_init_devicesZ_devices_supported�setZ
_free_devicesZ_assigned_devices�_hardware_inventoryZget_devices�_device_is_supported�addZsys_name�log�debug�str�r�devicerrrr!�s
zNetTuningPlugin._init_devicescs�fdd�|D�S)Ncsg|]}�j�d|��qS)r )r#�
get_device��.0�x�rrr�
<listcomp>��z7NetTuningPlugin._get_device_objects.<locals>.<listcomp>r)r�devicesrr/r�_get_device_objects�sz#NetTuningPlugin._get_device_objectscCs|j�|j�S�N)r�matchZdevice_pathr)rrrr$�sz$NetTuningPlugin._device_is_supportedcCs|j�|d|j�dS�Nr )r#Z	subscribe�_hardware_events_callbackr/rrr�_hardware_events_init�sz%NetTuningPlugin._hardware_events_initcCs|j�|�dSr4)r#Zunsubscriber/rrr�_hardware_events_cleanup�sz(NetTuningPlugin._hardware_events_cleanupcs |�|�rtt|��||�dSr4)r$r
rr7)rZeventr*rrrr7�s
z)NetTuningPlugin._hardware_events_callbackcs,|jdur|j�|�tt|��||�dSr4)�
_load_monitorZ
add_devicer
r�_added_device_apply_tuning�r�instance�device_namerrrr;�s
z*NetTuningPlugin._added_device_apply_tuningcs,|jdur|j�|�tt|��||�dSr4)r:Z
remove_devicer
r�_removed_device_unapply_tuningr<rrrr?�s
z.NetTuningPlugin._removed_device_unapply_tuningcCs|j�|�Sr4)r	�get)r�
pyudev_dev�proprrrr�sz&NetTuningPlugin._get_device_property_1cCs*z|�|�}Wnty$d}Yn0|Sr4)�__getitem__�KeyError)rrArB�prrrr�s

z&NetTuningPlugin._get_device_property_2cCsp|j�d|�}|rl|�|d�}|rlt|j���D]:\}}|j�|�}|r0t�	d|||f�||j
|<qlq0dS)Nr �IFINDEXz?Rename device, ifindex: '%s', original name '%s', new name '%s')r#r+r�listZ
_instances�items�_ifmap_origr@r&r'�
_ifnamemap)rr>�d�iZ
instance_namer=Zdevice_name_oldrrr�_move_device�s�
zNetTuningPlugin._move_devicecs�fdd�}|S)Ncs�j�|�}|r|S|Sr4)rJr@)r*rK�r=rr�_get_curr_device�szBNetTuningPlugin._get_curr_device_wrapper.<locals>._get_curr_devicer)rr=rOrrNr�_get_curr_device_wrapper�sz(NetTuningPlugin._get_curr_device_wrappercCs@d|_d|_d|_d|_i|_|�|�|_|�|jd�|_	dS)NT�dynamic)
Z_has_static_tuningr:�_idle�_statsrJrPrOZ_option_bool�optionsZ_has_dynamic_tuning�rr=rrr�_instance_init�szNetTuningPlugin._instance_initcsVtt|��|�i|_|j}|D]0}|j�d|�}|r |�|d�}|r ||j|<q dS)Nr rF)r
r�assign_free_devicesrI�assigned_devicesr#r+r)rr=r2r*rKrLrrrrWsz#NetTuningPlugin.assign_free_devicescCs"|jdur|j�|j�d|_dSr4)r:�_monitors_repository�deleterUrrr�_instance_cleanups
z!NetTuningPlugin._instance_cleanupcs@tt|��|�i|_i|_|j�d|j�|_|j�	|j
�dSr6)r
r�_instance_init_dynamicrRrSrYZcreaterXr:Z_set_dev_maprOrUrrrr\s
z&NetTuningPlugin._instance_init_dynamiccCs|�||�dSr4)�_instance_update_dynamic�rr=r*rrr�_instance_apply_dynamicsz'NetTuningPlugin._instance_apply_dynamiccCs<dd�|j�|�D�}|dur"dS||jvr8|�||�|�|||�|�||�|j|}|j|}|ddkr�|d|jkr�|d|jkr�d|d<t�	d|�t
|��d	�nF|ddkr�|ddks�|ddkr�d|d<t�	d
|�t
|���t�
d||d|df�t�
d||d|d|df�dS)
NcSsg|]}t|��qSr��int)r-�valuerrrr0r1z<NetTuningPlugin._instance_update_dynamic.<locals>.<listcomp>�levelr�read�writerz%s: setting 100Mbps�d�%s: setting max speedz %s load: read %0.2f, write %0.2fz$%s idle: read %d, write %d, level %d)r:Zget_device_loadrS�_init_stats_and_idle�
_update_stats�_update_idlerRr
r&�inforZ	set_speed�
set_max_speedr')rr=r*�loadZstatsZidlerrrr]s&


($z(NetTuningPlugin._instance_update_dynamiccCs4dddddddddddddddddddddddd�S)N)zadaptive-rxzadaptive-txzcqe-mode-rxzrx-usecsz	rx-frameszrx-usecs-irqz
rx-frames-irqztx-usecsz	tx-framesztx-usecs-irqz
tx-frames-irqzstats-block-usecszpkt-rate-lowzrx-usecs-lowz
rx-frames-lowztx-usecs-lowz
tx-frames-lowz
pkt-rate-highz
rx-usecs-highzrx-frames-highz
tx-usecs-highztx-frames-highzsample-intervalr��clsrrr�_get_config_options_coalesce6s0�z,NetTuningPlugin._get_config_options_coalescecCsdddd�S)N)�autoneg�rx�txrrnrrr�_get_config_options_pauseRs�z)NetTuningPlugin._get_config_options_pausecCsddddd�S)N)rr�rx-mini�rx-jumborsrrnrrr�_get_config_options_ringXs
�z(NetTuningPlugin._get_config_options_ringcCsddddd�S)N)rrrs�other�combinedrrnrrr�_get_config_options_channels_s
�z,NetTuningPlugin._get_config_options_channelscCsddddddddddd�
S)NT)
rQ�wake_on_lan�nf_conntrack_hashsize�features�coalesce�pause�ring�channels�
txqueuelen�mturrnrrr�_get_config_optionsfs�z#NetTuningPlugin._get_config_optionscCsL|�t|�|�����}ddgd|dgd�|j|<dddd�|j|<dS)N�r�r)�new�max)rcrdre)�_calc_speedrrOZ
get_max_speedrSrR)rr=r*Z	max_speedrrrrhusz$NetTuningPlugin._init_stats_and_idlecCs�|j|d|j|d<}||j|d<dd�t||�D�}||j|d<|j|d}dd�t||�D�}||j|d<t|d�t|d�|j|d	<t|d
�t|d
�|j|d<dS)Nr��oldcSsg|]}|d|d�qS)rrr)r-Znew_oldrrrr0�r1z1NetTuningPlugin._update_stats.<locals>.<listcomp>�diffr�cSsg|]}t|��qSr)r�)r-Zpairrrrr0�r1rrdr�re)rS�zip�float)rr=r*Znew_loadZold_loadr�Zold_max_loadZmax_loadrrrrizs"zNetTuningPlugin._update_statscCsHdD]>}|j|||jkr4|j||d7<qd|j||<qdS)N)rdrerr)rSrrR)rr=r*Z	operationrrrrj�szNetTuningPlugin._update_idlecCsN||jvrJ|j|ddkrJd|j|d<t�d|�t|�|����dS)Nrcrrg)rRr&rkrrOrlr^rrr�_instance_unapply_dynamic�sz)NetTuningPlugin._instance_unapply_dynamiccCstd|d�S)Ng333333#A�r`)rZspeedrrrr��szNetTuningPlugin._calc_speedcCs�|j�|�}tt�dd|����}t|�}|ddkrPt�d|t|�f�dS|dkr^t	�St	t
t|ddd�|ddd����S)Nz (:\s*)|(\s+)|(\s*;\s*)|(\s*,\s*)� r�rzinvalid %s parameter: '%s'r)Z
_variables�expandr(r�sub�split�lenr&�error�dictrGr�)rrb�context�v�lvrrr�_parse_config_parameters�sz(NetTuningPlugin._parse_config_parameterscCs~|j�ddddddddd	d
ddd
ddddddd�|�}dd�|�d�D�}t|�dkrZdStdd�dd�|dd�D�D��S)Nzadaptive-rx:z
adaptive-tx:zcqe-mode-rx:zrx-frames-low:zrx-frames-high:ztx-frames-low:ztx-frames-high:zlro:zrx:ztx:zsg:ztso:zufo:zgso:zgro:zrxvlan:ztxvlan:zntuple:zrxhash:)zAdaptive RX:z\s+TX:zCQE mode RX:z
rx-frame-low:zrx-frame-high:z
tx-frame-low:ztx-frame-high:zlarge-receive-offload:zrx-checksumming:ztx-checksumming:zscatter-gather:ztcp-segmentation-offload:zudp-fragmentation-offload:zgeneric-segmentation-offload:zgeneric-receive-offload:zrx-vlan-offload:ztx-vlan-offload:zntuple-filters:zreceive-hashing:cSs0g|](}tt|��dkrt�dt|��s|�qS)rz
\[fixed\]$)r�r(r�search�r-r�rrrr0�r1z<NetTuningPlugin._parse_device_parameters.<locals>.<listcomp>�
r�cSsg|]}t|�dkr|�qS�r��r�)r-�urrrr0�r1cSsg|]}t�dt|���qS�z:\s*)rr�r(r�rrrr0�r1r)r�multiple_re_replacer�r�r�)rrbZvlrrr�_parse_device_parameters�s6��z(NetTuningPlugin._parse_device_parameterscCsdS)Nz,/sys/module/nf_conntrack/parameters/hashsizerr/rrr�_nf_conntrack_hashsize_path�sz+NetTuningPlugin._nf_conntrack_hashsize_pathr{T)Z
per_devicecCsd|durdSt�ddt|��}t�dtd|�s@t�d�dS|s`|j�dd|�	|�d|g�|S)	N�0rKz^[z]+$zIncorrect 'wake_on_lan' value.�ethtoolz-sZwol)
rr�r(r5�
WOL_VALUESr&�warningr�executerO)rrbr*r=�sim�removerrr�_set_wake_on_lan�s
z NetTuningPlugin._set_wake_on_lanFc	Cs\d}z@t�dtd|j�d|�|�g�dtj�}|rB|�d�}WntyVYn0|S)Nz.*Wake-on:\s*([z]+).*r�r)	rr5r�rr�rO�S�group�IOError)rr*r=�ignore_missingrb�mrrr�_get_wake_on_lan�s�z NetTuningPlugin._get_wake_on_lanr|cCsN|durdSt|�}|dkrF|sB|jj|��||r:tjgndd�|SdSdS)NrF)Zno_error)rarZ
write_to_filer��errno�ENOENT)rrbr=r�r�Zhashsizerrr�_set_nf_conntrack_hashsize�s�z*NetTuningPlugin._set_nf_conntrack_hashsizecCs(|j�|���}t|�dkr$t|�SdS)Nr)rZ	read_filer�r�ra)rr=rbrrr�_get_nf_conntrack_hashsizesz*NetTuningPlugin._get_nf_conntrack_hashsizecCsz|js
dSddg|}|jj|tjgdd�\}}}|tjkrRt�d�d|_dS|rvt�d�t�d||f�dS|S)	N�ip�linkT)�	no_errorsZ
return_errz0ip command not found, ignoring for other devicesFzProblem calling ip commandz(rc: %s, msg: '%s'))	rrr�r�r�r&r�rkr')rr�rc�out�err_msgrrr�
_call_ip_links

zNetTuningPlugin._call_ip_linkNcCsdg}|r|�|�|�|�S)NZshow)�appendr�)rr*rrrr�
_ip_link_shows
zNetTuningPlugin._ip_link_showr�cCs~|durdSzt|�Wn"ty:t�d|�YdS0|sz|�dd|�|�d|g�}|durzt�d|�|��dS|S)Nz$txqueuelen value '%s' is not integerr"�devr�z%Cannot set txqueuelen for device '%s'�ra�
ValueErrorr&r�r�rO�rrbr*r=r�r��resrrr�_set_txqueuelenszNetTuningPlugin._set_txqueuelencCs(||jvrt�d|�|j|<|j|S)z@
		Return regex for int arg value from "ip link show" command
		z.*\s+%s\s+(\d+))rrr)r�argrrr�_get_re_ip_link_show-s
z$NetTuningPlugin._get_re_ip_link_showcCsr|�|�|��}|dur4|s0t�d|�|��dS|�d��|�}|durh|sdt�d|�|��dS|�d�S)NzECannot get 'ip link show' result for txqueuelen value for device '%s'ZqlenzFCannot get txqueuelen value from 'ip link show' result for device '%s'r�r�rOr&rkr�r�r��rr*r=r�r�r�rrr�_get_txqueuelen5s��zNetTuningPlugin._get_txqueuelenr�cCs~|durdSzt|�Wn"ty:t�d|�YdS0|sz|�dd|�|�d|g�}|durzt�d|�|��dS|S)Nzmtu value '%s' is not integerr"r�r�zCannot set mtu for device '%s'r�r�rrr�_set_mtuFszNetTuningPlugin._set_mtucCsr|�|�|��}|dur4|s0t�d|�|��dS|�d��|�}|durh|sdt�d|�|��dS|�d�S)Nz>Cannot get 'ip link show' result for mtu value for device '%s'r�z?Cannot get mtu value from 'ip link show' result for device '%s'rr�r�rrr�_get_mtuVs��zNetTuningPlugin._get_mtucCsl|dkrdSt|���}|j|j|j|jd�}t||����}|�|�sht�d|t	||�f�dSdS)Nr}T)r~rr�r�zunknown %s parameter(s): %sF)
r"�keysrprtrwrz�issubsetr&r�r()rr�rK�paramsZsupported_getterZ	supportedrrr�_check_parametershs�
z!NetTuningPlugin._check_parameterscCsR|j�dddd�|�}|�d�dd�}dd�|D�}td	d�d
d�|D�D��S)Nrqrrrs)Z
Autonegotiate�RX�TXr�rcSs$g|]}|dkrt�d|�s|�qS)�z	\[fixed\])rr�r,rrrr0}r1z;NetTuningPlugin._parse_pause_parameters.<locals>.<listcomp>cSsg|]}t|�dkr|�qSr�r�r,rrrr0~r1cSsg|]}t�d|��qSr��rr�r,rrrr0~r1)rr�r�r�)r�s�lrrr�_parse_pause_parametersws��z'NetTuningPlugin._parse_pause_parameterscCsjtjd|tjd�}|d}|j�ddddd�|�}|�d	�}d
d�|D�}dd�d
d�|D�D�}t|�S)N�^Current hardware settings:$��flagsrrrrurvrs)r�zRX MinizRX Jumbor�r�cSsg|]}|dkr|�qS�r�rr,rrrr0�r1z:NetTuningPlugin._parse_ring_parameters.<locals>.<listcomp>cSsg|]}t|�dkr|�qSr�r�r,rrrr0�r1cSsg|]}t�d|��qSr�r�r,rrrr0�r1�rr��	MULTILINErr�r��rr��ar�rrr�_parse_ring_parameters�s��
z&NetTuningPlugin._parse_ring_parameterscCsjtjd|tjd�}|d}|j�ddddd�|�}|�d	�}d
d�|D�}dd�d
d�|D�D�}t|�S)Nr�r�rrrrsrxry)r�r�ZOtherZCombinedr�cSsg|]}|dkr|�qSr�rr,rrrr0�r1z>NetTuningPlugin._parse_channels_parameters.<locals>.<listcomp>cSsg|]}t|�dkr|�qSr�r�r,rrrr0�r1cSsg|]}t�d|��qSr�r�r,rrrr0�r1r�r�rrr�_parse_channels_parameters�s��
z*NetTuningPlugin._parse_channels_parameterscCszg}d|vr(|�d|dd|dg�n,ttt|d�t|d���}|�d|g�ttt|ddd�|ddd����S)Nryrrrrs�r�)�extendr(r�rar�rGr�)rr�Zparams_list�
dev_paramsZmod_params_listZcntrrr�_replace_channels_parameters�sz,NetTuningPlugin._replace_channels_parametersc
	CsTt|���}t|���}||}|D]*}	t�d||	|�|�f�|�|	d�q$dS)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-%s parameter %s is not supported by device %sN)r"r�r&r�rO�pop)
rr=r��
parametersr*r�Zsupported_parametersZparameters_to_changeZunsupported_parameters�paramrrr�_check_device_support�s
��z%NetTuningPlugin._check_device_supportcCs�dddddd�}||}|j�d||�|�g�\}}|dksHt|�dkrLdS|j|j|j|j|jd�}||}	|	|�}
|d	kr�|�||
�s�dS|
S)
Nz-cz-kz-az-gz-l�r~r}rr�r�r�rr~)	rr�rOr�r�r�r�r�r�)rr=r�r*�context2opt�opt�retrbZcontext2parser�parserrKrrr�_get_device_parameters�s$��z&NetTuningPlugin._get_device_parametersc
Cs�|dust|�dkrdS|�||�}|dus8|�||�s<iS|r�|�|||||�|dkr�t|tt|���dvr�|�||j�	|�|�}|s�t|�dkr�t
�d|t|�f�ddddd	d
�}||}	|jjd|	|�
|�g|j�	|�dgd
�|S)Nrr�)zn/ar�zsetting %s: %sz-Cz-Kz-Az-Gz-Lr�r��P)r�)r�r�r�r�r(�next�iterr�r�	dict2listr&r'r�rO)
rr=r�rbr*r�r�rKr�r�rrr�_set_device_parameters�s* �
��z&NetTuningPlugin._set_device_parameterscs�|j||d�}|r�|�|||�}|dus4t|�dkr8dS|j||||||d���dusbt��dkrfdS�fdd�|��D�}	t|	�}	|r�|j���|j�|	�k}
|j||
�|	|�	|�d�|
S|j
�|d�|j�|	���n|j
�
|�}|�||||d�dS)	N)Zcommand_namer>rF)r�cs g|]\}}|�vr||f�qSrr)r-r�rb�Z
params_setrrr0�s�z6NetTuningPlugin._custom_parameters.<locals>.<listcomp>)r*r�)Z_storage_keyr�r�r�rHr�rr�Z_log_verification_resultrOZ_storager"�joinr@)rr��startrbr*�verifyr=Zstorage_keyZparams_currentZrelevant_params_currentr��original_valuerr�r�_custom_parameters�sD��
�

��
�z"NetTuningPlugin._custom_parametersr}cCs|�d|||||�S)Nr}�r��rr�rbr*r�r�r=rrr�	_featuresszNetTuningPlugin._featuresr~cCs|�d|||||�S)Nr~r�r�rrr�	_coalesceszNetTuningPlugin._coalescercCs|�d|||||�S)Nrr�r�rrr�_pauseszNetTuningPlugin._pauser�cCs|�d|||||�S)Nr�r�r�rrr�_ringszNetTuningPlugin._ringr�cCs|�d|||||�S)Nr�r�r�rrr�	_channelsszNetTuningPlugin._channels)F)N)F)F)N)B�__name__�
__module__�__qualname__�__doc__rr!r3r$r8r9r7r;r?rrrMrPrVrWr[r\r_r]�classmethodrprtrwrzr�rhrirjr�r�r�r�r�Zcommand_setr�Zcommand_getr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Zcommand_customr�r�r�rr�
__classcell__rrrrrs�
	




	!












	�
%








r)r�r�rZ
decoratorsZ
tuned.logsZtunedZtuned.utils.nettoolrZtuned.utils.commandsr�osrrZlogsr@r&r�ZPluginrrrrr�<module>s