Commit Graph

1620 Commits

Author SHA1 Message Date
polz113
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
Julien Fortin
5a3a162880
Merge pull request #223 from kvadrage/tunnel_tos_ttl_fix
addons: tunnel: add tunnel-tos attribute and "inherit" support
2021-12-06 15:59:33 +01:00
Alexander Petrovskiy
d290cfe8e7 addons: tunnel: new attribute: tunnel-tos
'tunnel-tos': {
    'help': 'TOS for tunnel packets (range 0..255), 1=inherit',
    "validrange": ["0", "255"],
    'validvals': ['<number>', 'inherit'],
    'required': False,
    'example': ['tunnel-tos inherit'],
    "aliases": ["tos"]
}

Signed-off-by: Alexander Petrovskiy <alexpe@nvidia.com>
2021-12-01 18:36:44 +03:00
Alexander Petrovskiy
4efd36fab0 addons: tunnel: add 'inherit' value to 'tunnel-ttl' attribute
Signed-off-by: Alexander Petrovskiy <alexpe@nvidia.com>
2021-12-01 17:43:29 +03:00
Julien Fortin
7d14f4d4e9
Merge pull request #170 from Jasperswaagman/master
Add none as valid value for bridge-ports on a bridge interface
2021-11-10 18:12:17 +01:00
Julien Fortin
1c1f8d4b12
Merge pull request #221 from li-kunkun/fix-default-route-add
Fix adding a static IPv6 default route failed on RA networks
2021-10-28 17:35:51 +02:00
Kunkun Li
cfc34b5b21 Fix adding a static IPv6 default route failed on RA networks
There may be adding a static IPv6 default route failed on networks where
router advertisements are also present.

The flow of up an interface is this:
1. ip link set dev $interface up
2. set sysctl config
3. config ip addr
4. config default ip route

After setting the link up, the kernel might learning an address and a
default route from RA before the default route config. The default route
will fail to be added. If the RA route is expired, and not be refreshed
for some reasons,the system looses IPv6 network connectivity.

Proposed fix is to use "route replace" instead of "route add". When the
RA learned route is still present it gets replaced, when it is not present
the route gets added.

Signed-off-by: Kunkun Li <likunkun@bytedance.com>
2021-10-25 17:08:31 +08:00
Tobias Mädel
bcd450241f debian: Run ifupdown2 after udev has settled 2021-09-27 16:58:28 +02:00
Julien Fortin
970c72e437 addons: vxlan: fix lib.addon.Vxlan import (fixes: #217)
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-08-26 13:44:05 +02:00
Julien Fortin
1bb6e6f0fb nlcache: fix TypeError: argument of type 'IPNetwork' is not iterable
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-30 11:58:54 +02:00
Julien Fortin
c2b847f7af addons: introduces old_ifaceobjs to get_dependent_ifacenames
Other addon modules need to access the list of old ifaceobjs

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-06 12:46:02 +02:00
Julien Fortin
15666526bf usercmd: fix TypeError: unsupported operand type(s) for |: '_Environ' and 'dict'
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-06 12:38:44 +02:00
Julien Fortin
a1d6115e35 debian: changelog: new 3.1.0-1 entry
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-05 19:35:41 +02:00
Julien Fortin
acfdbff891 nlcache: clean duplicated code (link_add)
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-05 17:00:44 +02:00
Julien Fortin
b334df6e88 nlcache: update link_set_bridge_info_data_dry_run
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-05 16:59:28 +02:00
Julien Fortin
9a6a305084 cleanups - upstream sync
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 18:20:42 +02:00
Julien Fortin
ba5437b9ec nlcache: addr_add: convert pointtopoint and broadcast attribute to ipaddress obj
the following config was broken:

auto swp1
iface swp1
      address 10.128.141.37/26
      broadcast 10.128.141.63

error: netlink: swp1: cannot add address 10.128.141.37/26 dev swp1: 'str' object has no attribute 'packed'

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 18:15:00 +02:00
Julien Fortin
f8ed376891 lib: nlcache: new netlink API "link_add" (waits for link creation)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 18:11:09 +02:00
Julien Fortin
790a55e93e addons: link: ifquery-check now validates admin state
[12:57:29] root:~ # ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto swp1
iface swp1
        post-up ip link set dev swp1 down

auto swp2
iface swp2
        link-down yes

auto swp3
iface swp3
        link-down no

auto swp4
iface swp4

[12:57:29] root:~ #
[12:57:29] root:~ #
[12:57:30] root:~ #
[12:57:30] root:~ # ifquery -ac
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp                                                [pass]

auto swp1
iface swp1 (link is down)                                           [fail]
        post-up ip link set dev swp1 down                               []

auto swp2
iface swp2                                                          [pass]
        link-down yes                                               [pass]

auto swp3
iface swp3                                                          [pass]
        link-down no                                                [pass]

auto swp4
iface swp4

[12:57:31] root:~ #

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 18:07:34 +02:00
Julien Fortin
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
Julien Fortin
9b23b7c684 iproute2: svd: convert vnifilter attr to boolean to cover all case
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:59:25 +02:00
Julien Fortin
9ca87c5e8b addons: vxlan: ifquery-check: mcastgrp-map: use bridge vni show
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:54:09 +02:00
Julien Fortin
3376c23335 addons: vxlan: remove stale code (bridge fdb show call)
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:53:38 +02:00
Julien Fortin
b3a93dfce1 addons: vxlan: fix name 'vni_mcastgrp_map' is not defined
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:53:04 +02:00
Julien Fortin
d910b87c50 addons: vxlan: mcastgrp-map: remove validval attribute
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:51:45 +02:00
Julien Fortin
e7ecab23d9 addons: vxlan: refactoring code to allow updating an existing SVD
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:51:12 +02:00
Roopa Prabhu
20aabf550c addons: vxlan: fix mcast group get api during vni filter set
the mcast group set code was not using the right api
to get mcast groups.

Signed-off-by: Roopa Prabhu <roopa@nvidia.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:48:24 +02:00
Julien Fortin
238e048507 addons: vxlan: remoteip-map: check user config against old config and not running state
'bridge flood macs are deleted everytime ifreload is triggered even without any changes to e/n/i config'
this was happening because ifupdown2 was checking the live fdb entries and calculating the delta between
the new and old config. Now we are simply checking the old and new ifupdown2 (/e/n/i) config to avoid
messing with macs added by the control plane

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:47:44 +02:00
Julien Fortin
d4403f1e77 addons: vxlan: ifquery-check: don't check fdb running state if mcastgrp-map or remoteip map are not configured
fdb entries can be added by FRR, so we won't be checking the running
state if there's no record of a user configuration in /e/n/i

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:47:08 +02:00
Julien Fortin
2b867068c6 addons: vxlan: allow svd config update
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:46:32 +02:00
Roopa Prabhu
8743434a25 addons: vxlan: add null list check when mcastgrp map not present
Signed-off-by: Roopa Prabhu <roopa@nvidia.com>
2021-07-01 19:45:43 +02:00
Julien Fortin
782aff35ce addons: vxlan: support for vxlan-support-mix-dev-types policy (default yes)
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:08:55 +02:00
Julien Fortin
db4371de3c addons: vxlan: error out when an unsupported mix of SVD and TVDs are configured
Currently mixing SVDs and TVDs on the same system is not supported,
regardless of whether they are in the same vlan-aware bridge or
across different ones. NVUE will configure all VNIs as SVDs by
default so this would hopefully only arise if a user edits
/etc/network/interfaces and manages their configuration with ifupdown2.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:08:04 +02:00
Julien Fortin
eff6613023 lib: iproute2: fix missing bridge_vni_del function
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:05:36 +02:00
Roopa Prabhu
abb7644b9c lib: iproute2: batch vni filter commands
Signed-off-by: Roopa Prabhu <roopa@nvidia.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:04:55 +02:00
Roopa Prabhu
af8d5db22b addons: vxlan: use new vni filter api to set mcast groups per vni
Signed-off-by: Roopa Prabhu <roopa@nvidia.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 19:00:17 +02:00
Roopa Prabhu
8acbc3c523 ifupdown2: lib: dont bring down link during vni filter changes
Signed-off-by: Roopa Prabhu <roopa@nvidia.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 18:40:52 +02:00
Julien Fortin
1b7f1f34e4 addons: vxlan: add 'Exception' to try/catch
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 18:13:55 +02:00
Julien Fortin
e79cf84297 addons: bridge-vlan-vni-map: add vlan reserved check
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:59:39 +02:00
Julien Fortin
ec5fde2532 addons: bridge: bridge-vlan-vni-map: add more details log error when finding duplicated vnis
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:58:34 +02:00
Julien Fortin
af3034111f addons: bridge: bridge-vlan-vni-map: fix consecutive vni ids mapped to incorrect range vids
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:57:59 +02:00
Julien Fortin
13ecedd2f7 addons: bridge: add batching commands for vids add/del
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:56:11 +02:00
Julien Fortin
2ac257faed addons: bridge: fix bridge-vlan-vni-map range processing
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:55:03 +02:00
Julien Fortin
905003dd25 addons: bridge: bridge-vlan-vni-map: fix delta calculation between old and new config
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:54:32 +02:00
Julien Fortin
06926b1979 addons: bridge: bridge-vlan-vni-map: remove stale entry from running config
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:53:27 +02:00
Julien Fortin
19b0c19bdf addons: bridge: don't add old_ifaceobjs to internal MVAB list
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:48:28 +02:00
Julien Fortin
995c38e29a addons: bridge: bridge_vlan_aware_list is now a set()
in the case of ifreload bridge.py:get_dependent is entered twice,
once for the old ifaceobjs and once for the new ones. Thus adding
bridges twice to the list. Having a set will prevent this issue.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:45:59 +02:00
Roopa Prabhu
c38ff73d90 lib: iproute2: add vxlan bridge default fdb entries with state permanent
This is to make it consistent with default entries added
by control plane (eg FRR E-VPN)

Signed-off-by: Roopa Prabhu <roopa@nvidia.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:37:43 +02:00
Roopa Prabhu
f3229eecaa lib: iproute2: use self flag when adding svd fdb entries
Signed-off-by: Roopa Prabhu <roopa@nvidia.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-01 17:37:26 +02:00
Julien Fortin
0cb747dd9e iproute2: link_set_address: dont check the cache on link up
To change the mac address of the device we need to set it down,
then make the change, then bring it back up. Thus we don't need
to check the cache before bringing the device back up.

Also adding a TODO: link_up/down should check if we are running
in a batch context, if so the cache shouldn't be checked to avoid
situation like this.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-06-30 23:59:03 +02:00