1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

ifupdown2 ethtool add-on module should not get unnecessary running configs for performance reasons

Ticket: CM-6630
Reviewed By: roopa
Testing Done: unit tested

We still run ethtool on most interfaces even if we don't have defaults to use.
The last bug I fixed (CM-6557) should have also fixed that (even if it was specific to
ifquery).

We now check if there is a configured attribute and if there is a default
value. If we do not have both, we continue without calling ethtool to get the running value.
This commit is contained in:
Sam Tannous
2015-07-09 13:40:00 -04:00
parent 0f6dc7e67a
commit 9fe90c103e

View File

@ -56,6 +56,10 @@ class ethtool(moduleBase,utilsBase):
ifname=ifaceobj.name,
attr='link-%s'%attr)
if not default_val and not config_val:
# there is no point in checking the running config
# if we have no default and the user did not have settings
continue
# check running values
running_val = self.get_running_attr(attr, ifaceobj)
if config_val and config_val == running_val: