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

22 Commits

Author SHA1 Message Date
9a26f48f99 Add support for xmit-hash-policy vlan+srcmac
Add support for xmit-hash-policy 5 - vlan+srcmac, added in Linux 5.12.
2022-01-05 13:51:15 +01:00
859b8643b6 nlcache: link_set_address: override cache after mac address change is aacked
after a successful mac change we should override our cache so that we don't
keep stale values in cache (in case the cache is queried before the kernel
notification arrives)

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 15:24:00 +02:00
59ab29fbd1 addons: vxlan: inherit clagd-vxlan-anycast-ip from lo for clag vxlans (introduces old_ifaceobjs to get_dependent_ifacenames)
When clagd anycast ip configuration changes on an existing setup, we have two issues:
- populate_dependency_info is run twice (in the ifreload case), first on the new
ifaceobjs, then on the old ifaceobjs. Thus hitting vxlan.get_dependent_ifacenames twice
where vxlan._clagd_vxlan_anycast_ip is set (the first time properly, then reset to it's
old value).
The fix: add a "old_ifaceobjs" flag to avoid resetting vxlan._clagd_vxlan_anycast_ip

- when clagd anycast ip changes, clagd also updates the vxlan's ip but there's a chance
that the ifupdown2 cache won't get the netlink notification in time before UP ops are
running on the vxlans, running on a stale cache is no bueno.
The fix: add additional checks to see if we should trust the cache of not.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-06-30 16:29:40 +02:00
d34d1513ca addons: bond: correct bond-slaves regex example
Signed-off-by: Danny Abukalam <danny@softiron.com>
2021-06-15 21:00:56 -04:00
038136754c addons: bond: bond mac should always be inherited from it's first slave
check if the bond mac address is correctly inherited from it's
first slave. There's a case where that might not be happening:
$ ip link show swp1 | grep ether
   link/ether 08:00:27:04:d8:01 brd ff:ff:ff:ff:ff:ff
$ ip link show swp2 | grep ether
   link/ether 08:00:27:04:d8:02 brd ff:ff:ff:ff:ff:ff
$ ip link add dev bond0 type bond
$ ip link set dev swp1 master bond0
$ ip link set dev swp2 master bond0
$ ip link show bond0 | grep ether
   link/ether 08:00:27:04:d8:01 brd ff:ff:ff:ff:ff:ff
$ ip link add dev bond1 type bond
$ ip link set dev swp1 master bond1
$ ip link show swp1 | grep ether
   link/ether 08:00:27:04:d8:01 brd ff:ff:ff:ff:ff:ff
$ ip link show swp2 | grep ether
   link/ether 08:00:27:04:d8:01 brd ff:ff:ff:ff:ff:ff
$ ip link show bond0 | grep ether
   link/ether 08:00:27:04:d8:01 brd ff:ff:ff:ff:ff:ff
$ ip link show bond1 | grep ether
   link/ether 08:00:27:04:d8:01 brd ff:ff:ff:ff:ff:ff
$
ifupdown2 will automatically correct and fix this unexpected behavior

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2021-01-25 21:37:36 +01:00
315f4f03b3 addons: bond: keep link admin up after being removed from bond
with kernel 4.19, slaves that are removed from a bond will be
admin down, this patch makes sure that the links are admin up
if they are part of the "auto" class and link-down yes is not set

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2021-01-25 21:36:15 +01:00
d079ad3fe8 addons: bond: set proto-up on slaves if bond used to be a clag bond or es-bond
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2021-01-25 21:34:50 +01:00
d0d657ed15 addons: bond: add ifname length check in sysfs back up path
When creating a bond, we first use a netlink call, if that
call fails we try to create and setup the bond via sysfs.

If the bond name is longer than 15 chars the netlink call
will fail, we will then enter the sysfs path which creates
the bond by writing to /sys/class/net/bonding_masters. In
this case the bonding driver will simply truncate the bond
name to fit into the 15 chars limit.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2021-01-25 21:33:36 +01:00
3218f49d81 use "except Exception:" instead of "except:"
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-06-24 01:12:24 +02:00
4b706d71e2 addons: bond: fix es-sys-mac example
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-14 02:00:33 +02:00
9808982edf addons: bond: add support for es-sys-mac and es-bonds
ES bonds have the same "init state" requirements as CLAG bonds -
1. A bond needs to be designated as an "es-bond" for this purpose.
For clag-bonds we used "clag-id" attr (to designate a bond as a "clag-bond").
For ES bonds we will use "es-sys-mac" attr.

2. Slaves added to an "ES bond" must have protodown-on.
This is again similar to CLAG bonds

3. And vice-versa i.e. when a slave is removed from an "es-bond",
protodown-on must be cleared.

4. When es-sys-mac is first set on a bond, all the bond-slaves must be
placed in "protodown-on" state. This is needed whether FRR is running at that point or not.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-13 20:27:21 +02:00
6bc9fadc44 addons: bond: refactor get_bond_slaves function
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-04-14 16:33:48 +02:00
1f928890af addons: bond: refactor code to not use python3 set
Python3 sets are using the python hash seed to generate random hashes
which makes the sets ordering different everytime. In our case we need
to honor the user configuration (first device should be enslaved first)

https://docs.python.org/3/using/cmdline.html#envvar-PYTHONHASHSEED

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-04-14 16:33:48 +02:00
716316cf3b bond: add bond-primary-reselect option
This option exist in ifupdown1/ifenslave,
used for active-backup bond
2020-02-21 09:13:55 +01:00
bd441a519d python3: pypi support: except ImportError and ModuleNotFoundError
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 17:25:32 +01:00
c46af1c992 python3: logging: the 'warn' method is deprecated, use warning instead
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 17:19:05 +01:00
3b01ed7618 python3: 2to3 changes
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 16:55:49 +01:00
35681c0608 python3: shebang update
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 16:40:10 +01:00
223ba5af1d ifupdown2 2.0.0-1
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 13:46:18 +01:00
ff775ef150 addons: bond: enable ipv6 on brports before bond enslaving
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-09-18 12:51:34 +02:00
0c4237d58d addons: bond: catch exception and log.info on modprobe failure
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:43:57 -08:00
d486dd0df0 ifupdown2 2.0.0 release
This is a major update coming all at once from master-next branch
master-next branch was started with --orphan option which is basically a new
branch without history.

The major changes are:
    - repackaging
    - cleanup the directory tree
    - rewritte setup.py to allow install from deb file or pypi (pip install)
    - add a Makefile to make things (like building a deb) easier
    - review all debian files

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 11:43:32 -08:00