From 7e7b1ee878bb8084fb98bf537fb6d951c479ee18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Mon, 25 Sep 2017 17:53:01 +0200 Subject: [PATCH] plugin_net: Allow disabling dynamic tuning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The net plugin can now be given the boolean 'dynamic' option, which is used to determine, whether dynamic tuning should be enabled. Signed-off-by: Ondřej Lysoněk --- tuned/plugins/plugin_net.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tuned/plugins/plugin_net.py b/tuned/plugins/plugin_net.py index c597000..d37ef3c 100644 --- a/tuned/plugins/plugin_net.py +++ b/tuned/plugins/plugin_net.py @@ -38,11 +38,16 @@ class NetTuningPlugin(base.Plugin): def _instance_init(self, instance): instance._has_static_tuning = True - instance._has_dynamic_tuning = True - - instance._load_monitor = self._monitors_repository.create("net", instance.devices) - instance._idle = {} - instance._stats = {} + if self._option_bool(instance.options["dynamic"]): + instance._has_dynamic_tuning = True + instance._load_monitor = self._monitors_repository.create("net", instance.devices) + instance._idle = {} + instance._stats = {} + else: + instance._has_dynamic_tuning = False + instance._load_monitor = None + instance._idle = None + instance._stats = None def _instance_cleanup(self, instance): if instance._load_monitor is not None: @@ -120,6 +125,7 @@ class NetTuningPlugin(base.Plugin): @classmethod def _get_config_options(cls): return { + "dynamic": True, "wake_on_lan": None, "nf_conntrack_hashsize": None, "features": None,