Ticket: CM-13737
Reviewed By: Roopa, Nikhil G
Testing Done:
Incremental commit for CM-13737
Create a policy file such as:
$ cat /var/lib/ifupdown2/policy.d/defaults_policy.json
{
"README": "This file is automatically generated. Do not edit this file.",
"ethtool": {
"defaults": {
"link-autoneg": "off",
"link-duplex": "full",
"link-speed": "1000"
},
"iface_defaults": {}
}
}
then do ifdown lo && ifup lo
without this patch or af8734d18a
you would reproduce the fail
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Ticket:CM-12695
Reviewed By:TBD
Testing Done:
Validated
a) ifup -v <interface>
b) ifdown -v <interface>
c) ifreload -a
Changes:
a) Support for link-fec attribute for link to configure
FEC configuration
Ex:
auto swp17
iface swp17
link-autoneg on
link-fec rs
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Vidya Sagar Ravipati <vidya@cumulusnetworks.com>
Ticket: CM-11517
Reviewed By: julien, nikhil, jtoppins
Testing Done: ethtool sanity test
ethtool module should really care only about
physical interfaces. so, this patch makes ethtool
module ignore all logical interfaces, ie interfaces
with link_kind set.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Ticket: CM-11718
Reviewed By: CCR-4931
Testing Done: Tested complete regression suite on hardnode in 3.0.
This patch fixes a problem in the ethtool addon module where a single iface stanza was
configured for a link-speed (1G) other then the default (10G). The link-speed config is then
removed or commented out but the link-speed is not restored to its default value (10G) because of
incorrect logic.
Ticket: None
Reviewed By: CCR-4692
Testing Done: smoke + scale tests
If called with close_fds=True the subprocess module will try to close every fd
from 3 to MAXFD before executing the specified command. This is done in Python
not even with a C-implementation which truly affecting performances.
This patch aims to better handle the file descriptor used by ifupdown2. Either
by closing them after use or by setting the close-on-exec flag for the file
descriptor, which causes the file descriptor to be automatically
(and atomically) closed when any of the exec-family functions succeed.
With the actual patch all tests are passing, I can't think of any future issue
but if any a possible future modification might be to use the parameter
'preexec_fn', which allows us to set function which will be executed in the
child process before executing the command line. We can always manually close
any remaining open file descriptors with something like:
>>> os.listdir('/proc/self/fd/')
['0', '1', '2', ‘3’, etc..]
>>> for fd in os.listdir('/proc/self/fd/')
>>> if int(fd) > 2:
>>> os.close(fd)
This patch is also totally re-organising the use of subprocesses. By removing
all subprocess code redundancy.
Ticket: CM-7840
Reviewed By: Roopa Prabhu
Testing Done: yes, with different configurations for physical & logical devices
This patch adds 'ifquery --with-defaults' to print the policy default
values for unconfigured attributes.
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
Ticket: CM-7840
Reviewed By: Roopa Prabhu
Testing Done: yes, by installing ifupdown .deb file onto dell-s3000-02
This patch adds a new argument '--with-defaults' to 'ifquery'
when 'ifquery --with-defaults' is executed, running states of all interface
attributes are compared against respective configured attributes from
/etc/network/interfaces file, if configured. Otherwise, compared against
default attributes from policy file
This patch also: (1) fixes ifquery check failure for bridge-* stp attributes.
(2) removes vrf-default-route and vrf-cgroup attributes from ifupdown2 policy
and just have the vrf-helper attribute
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
Ticket: CM-10178
Review: trivial
Testing: tested with failing testcase in the CM
This patch fixes a check in vrf map initialization code which did
not account for running vrfs correctly. This caused the case where
there were no running vrfs but stale map file to fail.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
addons,ifupdown,sbin: adding ifquery --with-defaults option
Ticket: CM-7840
Reviewed By: Roopa Prabhu
Testing Done: yes, by installing ifupdown .deb file onto dell-s3000-02
This patch adds a new argument '--with-defaults' to 'ifquery'
when 'ifquery --with-defaults' is executed, running states of all interface
attributes are compared against respective configured attributes from
/etc/network/interfaces file, if configured. Otherwise, compared against
default attributes from policy file
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
Ticket: cleanup
Reviewed By:
Testing Done: Tested ifupdown sanity
This gets rid of some ugly previous flag handling which was
passed through modules. This creates a global instance of
flags that all addon modules and helper modules can use.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Ticket: CM-9995
Reviewed By: julien
Testing Done: Tested on amd64 hardnode
Right now, ifquery -r shows link speed, duplex and autoneg current running values.
This patch changes the behavior to not show link attributes unless they
differ then the defaults for that interface.
Ticket: CM-7938
Reviewed By: roopa
Testing Done: tested on amd64 cel-redxp box
If the user has not configured a link attribute,
we should not be checking it against the default config.
This will only confuse users into thinking link attributes
were configured.
Modifications to the ethtool.py addon module
to check of configs exist before checking them.
Ticket: CM-6740
Reviewed By: roopa
Testing Done: tested multiple ifreloads with various test cases
In the case of duplicate iface stanzas where one of the stanzas sets
the link attributes, ifupdown2 was confused because the absence
of link attributes forced it to reset them to default values
(when they existed).
This patch tracks link changes and prevents resetting to defaults
only if there are no explicit settings configured. Furthermore,
only the last interface processed (from the duplicates) will take
care of resetting to defaults.
Ticket: CM-7128
Reviewed By: Trivial
Testing Done: unit tested on Ken's machine
The ifupdown2 ethtool addon module fails to set/check
the link-speed on bridge ports.
I removed excessive ifaceLinkKind checking since CM-6619
(03642a9a) added BRIDGE_PORT and BOND_SLAVE. This is ok
since we now check to see if ports have defaults (only swp do)
before showing or changing settings).
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.
Ticket: CM-6557
Reviewed By: roopa, gospo
Testing Done: unit tested
ifquery should not show link attributes for interfaces we do not have defaults for.
Although somewhat useful, we don't want people saving the bond link attributes
to try to use then in a config
Ticket: CM-6275
Reviewed By: roopa,dustin
Testing Done: Unit tested and ran complete ifupdown2 test suite
There are unnecessary calls to the ethtool module that cause some error messages to be printed.
We currently don't check ifaceobj.link_kind at the start
so this check was added.
If someone creates a new interface without setting link_kind, we still printed error message.
This patch adds a check at the start of ethtool.
This patch also removes the global link defaults (used by ifupdown2/ethtool)
created when update-ports is called. The defaults are created for each swp port
so we don't have defaults (and therefore will not attempt to set) for interfaces
like eth0, loopbacks, dummys, vxlans, or any other non swp interface.
Ticket: CM-5254
Reviewed By: roopa
Testing Done: tested master and 2.5_br images with testifupdown2 suite and hand tested
This patch creates a json defaults file upon bootup
(which can be overridden by customer configs in /etc)
which the ethtool module in ifupdown2 will consult
when "link-x" configs are removed in order to restore
them to the initial settings used by the switch.
(cherry picked from commit 8388664f5a5a85f2a813cafbf40ac92d7b86f4bf)
Conflicts:
packages/cl-utilities/usrlib/update-ports
(cherry picked from commit 21c9c10ab2fccaf60be9accb337e82541d497cc4)