2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-05-15 07:31:08 +02:00
|
|
|
/*
|
|
|
|
* Zebra Layer-2 interface handling code
|
|
|
|
* Copyright (C) 2016, 2017 Cumulus Networks, Inc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <zebra.h>
|
|
|
|
|
|
|
|
#include "if.h"
|
|
|
|
#include "prefix.h"
|
|
|
|
#include "table.h"
|
|
|
|
#include "memory.h"
|
|
|
|
#include "log.h"
|
|
|
|
#include "linklist.h"
|
|
|
|
#include "stream.h"
|
|
|
|
#include "hash.h"
|
|
|
|
#include "jhash.h"
|
|
|
|
|
|
|
|
#include "zebra/rib.h"
|
|
|
|
#include "zebra/rt.h"
|
|
|
|
#include "zebra/zebra_ns.h"
|
|
|
|
#include "zebra/zserv.h"
|
|
|
|
#include "zebra/debug.h"
|
|
|
|
#include "zebra/interface.h"
|
|
|
|
#include "zebra/zebra_vrf.h"
|
|
|
|
#include "zebra/rt_netlink.h"
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
#include "zebra/interface.h"
|
2017-05-15 07:31:08 +02:00
|
|
|
#include "zebra/zebra_l2.h"
|
2021-07-27 11:24:40 +02:00
|
|
|
#include "zebra/zebra_l2_bridge_if.h"
|
2017-05-15 07:38:26 +02:00
|
|
|
#include "zebra/zebra_vxlan.h"
|
2021-07-27 10:10:48 +02:00
|
|
|
#include "zebra/zebra_vxlan_if.h"
|
2020-03-28 01:14:45 +01:00
|
|
|
#include "zebra/zebra_evpn_mh.h"
|
2017-05-15 07:31:08 +02:00
|
|
|
|
|
|
|
/* definitions */
|
|
|
|
|
|
|
|
/* static function declarations */
|
|
|
|
|
|
|
|
/* Private functions */
|
2021-08-17 10:42:51 +02:00
|
|
|
static void map_slaves_to_bridge(struct interface *br_if, int link,
|
|
|
|
bool update_slave, uint8_t chgflags)
|
2017-05-15 07:31:08 +02:00
|
|
|
{
|
|
|
|
struct vrf *vrf;
|
|
|
|
struct interface *ifp;
|
2019-10-03 17:11:37 +02:00
|
|
|
struct zebra_vrf *zvrf;
|
|
|
|
struct zebra_ns *zns;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2021-10-22 00:17:40 +02:00
|
|
|
zvrf = br_if->vrf->info;
|
2019-10-03 17:11:37 +02:00
|
|
|
assert(zvrf);
|
|
|
|
zns = zvrf->zns;
|
|
|
|
assert(zns);
|
2017-09-15 17:47:35 +02:00
|
|
|
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
|
2017-10-06 20:25:58 +02:00
|
|
|
FOR_ALL_INTERFACES (vrf, ifp) {
|
2017-05-15 07:31:08 +02:00
|
|
|
struct zebra_if *zif;
|
|
|
|
struct zebra_l2info_brslave *br_slave;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
if (ifp->ifindex == IFINDEX_INTERNAL || !ifp->info)
|
|
|
|
continue;
|
|
|
|
if (!IS_ZEBRA_IF_BRIDGE_SLAVE(ifp))
|
|
|
|
continue;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
/* NOTE: This assumes 'zebra_l2info_brslave' is the
|
|
|
|
* first field
|
|
|
|
* for any L2 interface.
|
|
|
|
*/
|
|
|
|
zif = (struct zebra_if *)ifp->info;
|
|
|
|
br_slave = &zif->brslave_info;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
if (link) {
|
2021-08-17 10:42:51 +02:00
|
|
|
if (br_slave->bridge_ifindex == br_if->ifindex
|
|
|
|
&& br_slave->ns_id == zns->ns_id) {
|
2017-05-15 07:31:08 +02:00
|
|
|
br_slave->br_if = br_if;
|
2021-08-17 10:42:51 +02:00
|
|
|
if (update_slave) {
|
|
|
|
zebra_l2if_update_bridge_slave(
|
|
|
|
ifp,
|
|
|
|
br_slave->bridge_ifindex,
|
|
|
|
br_slave->ns_id,
|
|
|
|
chgflags);
|
|
|
|
}
|
|
|
|
}
|
2017-05-15 07:31:08 +02:00
|
|
|
} else {
|
|
|
|
if (br_slave->br_if == br_if)
|
|
|
|
br_slave->br_if = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Public functions */
|
zebra: map vxlan interface to bridge interface with correct ns id
an incoming bridge index has been found, that is linked with vxlan
interface, and the search for that bridge interface is done. In
vrf-lite, the search is done across the same default namespace, because
bridge and vxlan may not be in the same vrf. But this behaviour is wrong
when using vrf netns backend, as the bridge and the vxlan have to be in
the same vrf ( hence in the same network namespace). To comply with
that, use the netnamespace of the vxlan interface. Like that, the
appropriate nsid is passed as parameter, and consequently, the search is
correct, and the mac address passed to BGP will be ok too.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-10-01 11:07:13 +02:00
|
|
|
void zebra_l2_map_slave_to_bridge(struct zebra_l2info_brslave *br_slave,
|
|
|
|
struct zebra_ns *zns)
|
2017-05-15 07:31:08 +02:00
|
|
|
{
|
|
|
|
struct interface *br_if;
|
|
|
|
|
|
|
|
/* TODO: Handle change of master */
|
zebra: map vxlan interface to bridge interface with correct ns id
an incoming bridge index has been found, that is linked with vxlan
interface, and the search for that bridge interface is done. In
vrf-lite, the search is done across the same default namespace, because
bridge and vxlan may not be in the same vrf. But this behaviour is wrong
when using vrf netns backend, as the bridge and the vxlan have to be in
the same vrf ( hence in the same network namespace). To comply with
that, use the netnamespace of the vxlan interface. Like that, the
appropriate nsid is passed as parameter, and consequently, the search is
correct, and the mac address passed to BGP will be ok too.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-10-01 11:07:13 +02:00
|
|
|
assert(zns);
|
|
|
|
br_if = if_lookup_by_index_per_ns(zebra_ns_lookup(zns->ns_id),
|
2017-05-15 07:31:08 +02:00
|
|
|
br_slave->bridge_ifindex);
|
|
|
|
if (br_if)
|
|
|
|
br_slave->br_if = br_if;
|
|
|
|
}
|
|
|
|
|
|
|
|
void zebra_l2_unmap_slave_from_bridge(struct zebra_l2info_brslave *br_slave)
|
|
|
|
{
|
|
|
|
br_slave->br_if = NULL;
|
|
|
|
}
|
|
|
|
|
2020-08-05 16:13:55 +02:00
|
|
|
/* If any of the bond members are in bypass state the bond is placed
|
|
|
|
* in bypass state
|
|
|
|
*/
|
|
|
|
static void zebra_l2_bond_lacp_bypass_eval(struct zebra_if *bond_zif)
|
|
|
|
{
|
|
|
|
struct listnode *node;
|
|
|
|
struct zebra_if *bond_mbr;
|
2024-03-12 06:36:35 +01:00
|
|
|
bool old_bypass = !!CHECK_FLAG(bond_zif->flags, ZIF_FLAG_LACP_BYPASS);
|
2020-08-05 16:13:55 +02:00
|
|
|
bool new_bypass = false;
|
|
|
|
|
|
|
|
if (bond_zif->bond_info.mbr_zifs) {
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(bond_zif->bond_info.mbr_zifs, node,
|
|
|
|
bond_mbr)) {
|
2024-03-12 06:36:35 +01:00
|
|
|
if (CHECK_FLAG(bond_mbr->flags, ZIF_FLAG_LACP_BYPASS)) {
|
2020-08-05 16:13:55 +02:00
|
|
|
new_bypass = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (old_bypass == new_bypass)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_EVENT)
|
|
|
|
zlog_debug("bond %s lacp bypass changed to %s",
|
|
|
|
bond_zif->ifp->name, new_bypass ? "on" : "off");
|
|
|
|
|
|
|
|
if (new_bypass)
|
2024-03-12 06:36:35 +01:00
|
|
|
SET_FLAG(bond_zif->flags, ZIF_FLAG_LACP_BYPASS);
|
2020-08-05 16:13:55 +02:00
|
|
|
else
|
2024-03-12 06:36:35 +01:00
|
|
|
UNSET_FLAG(bond_zif->flags, ZIF_FLAG_LACP_BYPASS);
|
2020-08-05 16:13:55 +02:00
|
|
|
|
|
|
|
if (bond_zif->es_info.es)
|
|
|
|
zebra_evpn_es_bypass_update(bond_zif->es_info.es, bond_zif->ifp,
|
|
|
|
new_bypass);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Returns true if member was newly linked to bond */
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
void zebra_l2_map_slave_to_bond(struct zebra_if *zif, vrf_id_t vrf_id)
|
2018-11-10 21:54:43 +01:00
|
|
|
{
|
|
|
|
struct interface *bond_if;
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
struct zebra_if *bond_zif;
|
|
|
|
struct zebra_l2info_bondslave *bond_slave = &zif->bondslave_info;
|
2018-11-10 21:54:43 +01:00
|
|
|
|
2021-10-14 18:11:15 +02:00
|
|
|
bond_if = if_lookup_by_index(bond_slave->bond_ifindex, vrf_id);
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
if (bond_if == bond_slave->bond_if)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* unlink the slave from the old master */
|
|
|
|
zebra_l2_unmap_slave_from_bond(zif);
|
|
|
|
|
|
|
|
/* If the bond is present and ready link the bond-member
|
|
|
|
* to it
|
|
|
|
*/
|
|
|
|
if (bond_if && (bond_zif = bond_if->info)) {
|
|
|
|
if (bond_zif->bond_info.mbr_zifs) {
|
|
|
|
if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_EVENT)
|
|
|
|
zlog_debug("bond mbr %s linked to %s",
|
|
|
|
zif->ifp->name, bond_if->name);
|
|
|
|
bond_slave->bond_if = bond_if;
|
|
|
|
/* link the slave to the new bond master */
|
|
|
|
listnode_add(bond_zif->bond_info.mbr_zifs, zif);
|
|
|
|
/* inherit protodown flags from the es-bond */
|
|
|
|
if (zebra_evpn_is_es_bond(bond_if))
|
|
|
|
zebra_evpn_mh_update_protodown_bond_mbr(
|
|
|
|
zif, false /*clear*/, __func__);
|
2020-08-05 16:13:55 +02:00
|
|
|
zebra_l2_bond_lacp_bypass_eval(bond_zif);
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_EVENT)
|
2024-03-12 06:36:35 +01:00
|
|
|
zlog_debug("bond mbr %s link to bond skipped", zif->ifp->name);
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void zebra_l2_unmap_slave_from_bond(struct zebra_if *zif)
|
|
|
|
{
|
|
|
|
struct zebra_l2info_bondslave *bond_slave = &zif->bondslave_info;
|
|
|
|
struct zebra_if *bond_zif;
|
|
|
|
|
|
|
|
if (!bond_slave->bond_if) {
|
|
|
|
if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_EVENT)
|
2024-03-12 06:36:35 +01:00
|
|
|
zlog_debug("bond mbr %s unlink from bond skipped", zif->ifp->name);
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_EVENT)
|
|
|
|
zlog_debug("bond mbr %s un-linked from %s", zif->ifp->name,
|
|
|
|
bond_slave->bond_if->name);
|
|
|
|
|
|
|
|
/* unlink the slave from the bond master */
|
|
|
|
bond_zif = bond_slave->bond_if->info;
|
|
|
|
/* clear protodown flags */
|
|
|
|
if (zebra_evpn_is_es_bond(bond_zif->ifp))
|
|
|
|
zebra_evpn_mh_update_protodown_bond_mbr(zif, true /*clear*/,
|
|
|
|
__func__);
|
|
|
|
listnode_delete(bond_zif->bond_info.mbr_zifs, zif);
|
|
|
|
bond_slave->bond_if = NULL;
|
2020-08-05 16:13:55 +02:00
|
|
|
zebra_l2_bond_lacp_bypass_eval(bond_zif);
|
2018-11-10 21:54:43 +01:00
|
|
|
}
|
|
|
|
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
void zebra_l2if_update_bond(struct interface *ifp, bool add)
|
2018-11-10 21:54:43 +01:00
|
|
|
{
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
struct zebra_if *zif;
|
|
|
|
struct zebra_l2info_bond *bond;
|
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
assert(zif);
|
|
|
|
bond = &zif->bond_info;
|
|
|
|
|
|
|
|
if (add) {
|
|
|
|
if (!bond->mbr_zifs) {
|
|
|
|
if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_EVENT)
|
2024-03-12 06:36:35 +01:00
|
|
|
zlog_debug("bond %s mbr list create", ifp->name);
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
bond->mbr_zifs = list_new();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
struct listnode *node;
|
|
|
|
struct listnode *nnode;
|
|
|
|
struct zebra_if *bond_mbr;
|
|
|
|
|
|
|
|
if (!bond->mbr_zifs)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_EVENT)
|
|
|
|
zlog_debug("bond %s mbr list delete", ifp->name);
|
|
|
|
for (ALL_LIST_ELEMENTS(bond->mbr_zifs, node, nnode, bond_mbr))
|
|
|
|
zebra_l2_unmap_slave_from_bond(bond_mbr);
|
|
|
|
|
|
|
|
list_delete(&bond->mbr_zifs);
|
|
|
|
}
|
2018-11-10 21:54:43 +01:00
|
|
|
}
|
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
/*
|
|
|
|
* Handle Bridge interface add or update. Update relevant info,
|
|
|
|
* map slaves (if any) to the bridge.
|
|
|
|
*/
|
|
|
|
void zebra_l2_bridge_add_update(struct interface *ifp,
|
2023-04-27 05:02:09 +02:00
|
|
|
const struct zebra_l2info_bridge *bridge_info)
|
2017-05-15 07:31:08 +02:00
|
|
|
{
|
|
|
|
struct zebra_if *zif;
|
2021-07-27 11:24:40 +02:00
|
|
|
struct zebra_l2_bridge_if *br;
|
2017-05-15 07:31:08 +02:00
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
assert(zif);
|
|
|
|
|
2021-07-27 11:24:40 +02:00
|
|
|
br = BRIDGE_FROM_ZEBRA_IF(zif);
|
|
|
|
br->vlan_aware = bridge_info->bridge.vlan_aware;
|
|
|
|
zebra_l2_bridge_if_add(ifp);
|
2017-05-15 07:31:08 +02:00
|
|
|
|
|
|
|
/* Link all slaves to this bridge */
|
2021-08-17 10:42:51 +02:00
|
|
|
map_slaves_to_bridge(ifp, 1, false, ZEBRA_BRIDGE_NO_ACTION);
|
2017-05-15 07:31:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Handle Bridge interface delete.
|
|
|
|
*/
|
|
|
|
void zebra_l2_bridge_del(struct interface *ifp)
|
|
|
|
{
|
2021-07-27 11:24:40 +02:00
|
|
|
zebra_l2_bridge_if_del(ifp);
|
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
/* Unlink all slaves to this bridge */
|
2021-08-17 10:42:51 +02:00
|
|
|
map_slaves_to_bridge(ifp, 0, false, ZEBRA_BRIDGE_NO_ACTION);
|
|
|
|
}
|
|
|
|
|
|
|
|
void zebra_l2if_update_bridge(struct interface *ifp, uint8_t chgflags)
|
|
|
|
{
|
|
|
|
if (!chgflags)
|
|
|
|
return;
|
|
|
|
map_slaves_to_bridge(ifp, 1, true, chgflags);
|
2017-05-15 07:31:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Update L2 info for a VLAN interface. Only relevant parameter is the
|
|
|
|
* VLAN Id and this cannot change.
|
|
|
|
*/
|
|
|
|
void zebra_l2_vlanif_update(struct interface *ifp,
|
2023-04-27 05:02:09 +02:00
|
|
|
const struct zebra_l2info_vlan *vlan_info)
|
2017-05-15 07:31:08 +02:00
|
|
|
{
|
|
|
|
struct zebra_if *zif;
|
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
assert(zif);
|
|
|
|
|
|
|
|
/* Copy over the L2 information. */
|
|
|
|
memcpy(&zif->l2info.vl, vlan_info, sizeof(*vlan_info));
|
|
|
|
}
|
|
|
|
|
2019-12-19 18:33:56 +01:00
|
|
|
/*
|
|
|
|
* Update L2 info for a GRE interface. This is called upon interface
|
|
|
|
* addition as well as update. Upon add/update, need to inform
|
|
|
|
* clients about GRE information.
|
|
|
|
*/
|
|
|
|
void zebra_l2_greif_add_update(struct interface *ifp,
|
2023-04-27 05:02:09 +02:00
|
|
|
const struct zebra_l2info_gre *gre_info, int add)
|
2019-12-19 18:33:56 +01:00
|
|
|
{
|
|
|
|
struct zebra_if *zif;
|
|
|
|
struct in_addr old_vtep_ip;
|
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
assert(zif);
|
|
|
|
|
|
|
|
if (add) {
|
|
|
|
memcpy(&zif->l2info.gre, gre_info, sizeof(*gre_info));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
old_vtep_ip = zif->l2info.gre.vtep_ip;
|
|
|
|
if (IPV4_ADDR_SAME(&old_vtep_ip, &gre_info->vtep_ip))
|
|
|
|
return;
|
|
|
|
|
|
|
|
zif->l2info.gre.vtep_ip = gre_info->vtep_ip;
|
|
|
|
}
|
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
/*
|
|
|
|
* Update L2 info for a VxLAN interface. This is called upon interface
|
|
|
|
* addition as well as update. Upon add, need to invoke the VNI create
|
|
|
|
* function. Upon update, the params of interest are the local tunnel
|
|
|
|
* IP and VLAN mapping, but the latter is handled separately.
|
|
|
|
*/
|
|
|
|
void zebra_l2_vxlanif_add_update(struct interface *ifp,
|
2023-04-27 05:02:09 +02:00
|
|
|
const struct zebra_l2info_vxlan *vxlan_info,
|
|
|
|
int add)
|
2017-05-15 07:31:08 +02:00
|
|
|
{
|
|
|
|
struct zebra_if *zif;
|
2019-03-19 16:57:04 +01:00
|
|
|
uint16_t chgflags = 0;
|
2021-10-08 16:27:50 +02:00
|
|
|
struct zebra_vxlan_if_update_ctx ctx;
|
2017-05-15 07:31:08 +02:00
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
assert(zif);
|
|
|
|
|
|
|
|
if (add) {
|
|
|
|
memcpy(&zif->l2info.vxl, vxlan_info, sizeof(*vxlan_info));
|
2017-05-15 07:38:26 +02:00
|
|
|
zebra_vxlan_if_add(ifp);
|
2017-05-15 07:31:08 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-08 16:27:50 +02:00
|
|
|
memset(&ctx, 0, sizeof(ctx));
|
|
|
|
ctx.old_vtep_ip = zif->l2info.vxl.vtep_ip;
|
2017-05-15 07:31:08 +02:00
|
|
|
|
2021-10-08 16:27:50 +02:00
|
|
|
if (!IPV4_ADDR_SAME(&ctx.old_vtep_ip, &vxlan_info->vtep_ip)) {
|
2024-03-12 06:36:35 +01:00
|
|
|
SET_FLAG(chgflags, ZEBRA_VXLIF_LOCAL_IP_CHANGE);
|
2019-03-19 16:57:04 +01:00
|
|
|
zif->l2info.vxl.vtep_ip = vxlan_info->vtep_ip;
|
|
|
|
}
|
|
|
|
|
2021-07-27 09:44:15 +02:00
|
|
|
if (IS_ZEBRA_VXLAN_IF_VNI(zif)) {
|
2021-10-08 16:27:50 +02:00
|
|
|
ctx.old_vni = vxlan_info->vni_info.vni;
|
2021-07-27 09:44:15 +02:00
|
|
|
if (!IPV4_ADDR_SAME(&zif->l2info.vxl.vni_info.vni.mcast_grp,
|
|
|
|
&vxlan_info->vni_info.vni.mcast_grp)) {
|
2024-03-12 06:36:35 +01:00
|
|
|
SET_FLAG(chgflags, ZEBRA_VXLIF_MCAST_GRP_CHANGE);
|
2021-07-27 09:44:15 +02:00
|
|
|
zif->l2info.vxl.vni_info.vni.mcast_grp =
|
|
|
|
vxlan_info->vni_info.vni.mcast_grp;
|
|
|
|
}
|
2019-03-19 16:57:04 +01:00
|
|
|
}
|
|
|
|
|
2021-10-08 16:27:50 +02:00
|
|
|
if (chgflags) {
|
|
|
|
ctx.chgflags = chgflags;
|
|
|
|
zebra_vxlan_if_update(ifp, &ctx);
|
|
|
|
}
|
2017-05-15 07:31:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Handle change to VLAN to VNI mapping.
|
|
|
|
*/
|
|
|
|
void zebra_l2_vxlanif_update_access_vlan(struct interface *ifp,
|
|
|
|
vlanid_t access_vlan)
|
|
|
|
{
|
|
|
|
struct zebra_if *zif;
|
2017-05-15 07:38:26 +02:00
|
|
|
vlanid_t old_access_vlan;
|
2021-07-27 09:44:15 +02:00
|
|
|
struct zebra_vxlan_vni *vni;
|
2021-10-08 16:27:50 +02:00
|
|
|
struct zebra_vxlan_if_update_ctx ctx;
|
2021-07-27 09:44:15 +02:00
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
assert(zif);
|
|
|
|
|
2021-07-27 09:44:15 +02:00
|
|
|
/* This would be called only in non svd case */
|
2023-08-14 21:06:30 +02:00
|
|
|
if (!IS_ZEBRA_VXLAN_IF_VNI(zif))
|
|
|
|
return;
|
2021-07-27 09:44:15 +02:00
|
|
|
|
|
|
|
old_access_vlan = zif->l2info.vxl.vni_info.vni.access_vlan;
|
2024-03-22 21:25:18 +01:00
|
|
|
|
2017-05-15 07:38:26 +02:00
|
|
|
if (old_access_vlan == access_vlan)
|
|
|
|
return;
|
|
|
|
|
2021-10-08 16:27:50 +02:00
|
|
|
memset(&ctx, 0, sizeof(ctx));
|
2021-07-27 09:44:15 +02:00
|
|
|
vni = zebra_vxlan_if_vni_find(zif, 0);
|
2021-10-08 16:27:50 +02:00
|
|
|
ctx.old_vni = *vni;
|
|
|
|
ctx.chgflags = ZEBRA_VXLIF_VLAN_CHANGE;
|
2021-07-27 09:44:15 +02:00
|
|
|
vni->access_vlan = access_vlan;
|
2020-03-28 01:14:45 +01:00
|
|
|
|
2021-07-27 09:44:15 +02:00
|
|
|
zebra_evpn_vl_vxl_deref(old_access_vlan, vni->vni, zif);
|
|
|
|
zebra_evpn_vl_vxl_ref(access_vlan, vni->vni, zif);
|
2021-10-08 16:27:50 +02:00
|
|
|
zebra_vxlan_if_update(ifp, &ctx);
|
2017-05-15 07:31:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Handle VxLAN interface delete.
|
|
|
|
*/
|
|
|
|
void zebra_l2_vxlanif_del(struct interface *ifp)
|
|
|
|
{
|
2020-03-28 01:14:45 +01:00
|
|
|
struct zebra_if *zif;
|
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
assert(zif);
|
|
|
|
|
2017-05-15 07:38:26 +02:00
|
|
|
zebra_vxlan_if_del(ifp);
|
2017-05-15 07:31:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Map or unmap interface from bridge.
|
|
|
|
* NOTE: It is currently assumped that an interface has to be unmapped
|
|
|
|
* from a bridge before it can be mapped to another bridge.
|
|
|
|
*/
|
|
|
|
void zebra_l2if_update_bridge_slave(struct interface *ifp,
|
2021-08-17 10:42:51 +02:00
|
|
|
ifindex_t bridge_ifindex, ns_id_t ns_id,
|
|
|
|
uint8_t chgflags)
|
2017-05-15 07:31:08 +02:00
|
|
|
{
|
|
|
|
struct zebra_if *zif;
|
|
|
|
ifindex_t old_bridge_ifindex;
|
2019-10-03 17:11:37 +02:00
|
|
|
ns_id_t old_ns_id;
|
zebra: map vxlan interface to bridge interface with correct ns id
an incoming bridge index has been found, that is linked with vxlan
interface, and the search for that bridge interface is done. In
vrf-lite, the search is done across the same default namespace, because
bridge and vxlan may not be in the same vrf. But this behaviour is wrong
when using vrf netns backend, as the bridge and the vxlan have to be in
the same vrf ( hence in the same network namespace). To comply with
that, use the netnamespace of the vxlan interface. Like that, the
appropriate nsid is passed as parameter, and consequently, the search is
correct, and the mac address passed to BGP will be ok too.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-10-01 11:07:13 +02:00
|
|
|
struct zebra_vrf *zvrf;
|
2021-10-08 16:27:50 +02:00
|
|
|
struct zebra_vxlan_if_update_ctx ctx;
|
|
|
|
|
|
|
|
memset(&ctx, 0, sizeof(ctx));
|
2017-05-15 07:31:08 +02:00
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
assert(zif);
|
|
|
|
|
2021-10-22 00:17:40 +02:00
|
|
|
zvrf = ifp->vrf->info;
|
zebra: map vxlan interface to bridge interface with correct ns id
an incoming bridge index has been found, that is linked with vxlan
interface, and the search for that bridge interface is done. In
vrf-lite, the search is done across the same default namespace, because
bridge and vxlan may not be in the same vrf. But this behaviour is wrong
when using vrf netns backend, as the bridge and the vxlan have to be in
the same vrf ( hence in the same network namespace). To comply with
that, use the netnamespace of the vxlan interface. Like that, the
appropriate nsid is passed as parameter, and consequently, the search is
correct, and the mac address passed to BGP will be ok too.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-10-01 11:07:13 +02:00
|
|
|
if (!zvrf)
|
|
|
|
return;
|
|
|
|
|
2021-08-17 10:42:51 +02:00
|
|
|
if (zif->zif_type == ZEBRA_IF_VXLAN
|
|
|
|
&& chgflags != ZEBRA_BRIDGE_NO_ACTION) {
|
2024-03-12 06:36:35 +01:00
|
|
|
if (CHECK_FLAG(chgflags, ZEBRA_BRIDGE_MASTER_MAC_CHANGE)) {
|
2021-10-08 16:27:50 +02:00
|
|
|
ctx.chgflags = ZEBRA_VXLIF_MASTER_MAC_CHANGE;
|
|
|
|
zebra_vxlan_if_update(ifp, &ctx);
|
|
|
|
}
|
2024-03-12 06:36:35 +01:00
|
|
|
if (CHECK_FLAG(chgflags, ZEBRA_BRIDGE_MASTER_UP)) {
|
2021-10-08 16:27:50 +02:00
|
|
|
ctx.chgflags = ZEBRA_VXLIF_MASTER_CHANGE;
|
|
|
|
zebra_vxlan_if_update(ifp, &ctx);
|
|
|
|
}
|
2021-08-17 10:42:51 +02:00
|
|
|
}
|
2017-05-15 07:31:08 +02:00
|
|
|
old_bridge_ifindex = zif->brslave_info.bridge_ifindex;
|
2019-10-03 17:11:37 +02:00
|
|
|
old_ns_id = zif->brslave_info.ns_id;
|
|
|
|
if (old_bridge_ifindex == bridge_ifindex &&
|
|
|
|
old_ns_id == zif->brslave_info.ns_id)
|
2017-05-15 07:31:08 +02:00
|
|
|
return;
|
|
|
|
|
2021-10-08 16:27:50 +02:00
|
|
|
ctx.chgflags = ZEBRA_VXLIF_MASTER_CHANGE;
|
|
|
|
|
|
|
|
|
2019-10-03 17:11:37 +02:00
|
|
|
zif->brslave_info.ns_id = ns_id;
|
2017-05-15 07:31:08 +02:00
|
|
|
zif->brslave_info.bridge_ifindex = bridge_ifindex;
|
|
|
|
/* Set up or remove link with master */
|
2017-07-20 18:54:46 +02:00
|
|
|
if (bridge_ifindex != IFINDEX_INTERNAL) {
|
zebra: map vxlan interface to bridge interface with correct ns id
an incoming bridge index has been found, that is linked with vxlan
interface, and the search for that bridge interface is done. In
vrf-lite, the search is done across the same default namespace, because
bridge and vxlan may not be in the same vrf. But this behaviour is wrong
when using vrf netns backend, as the bridge and the vxlan have to be in
the same vrf ( hence in the same network namespace). To comply with
that, use the netnamespace of the vxlan interface. Like that, the
appropriate nsid is passed as parameter, and consequently, the search is
correct, and the mac address passed to BGP will be ok too.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-10-01 11:07:13 +02:00
|
|
|
zebra_l2_map_slave_to_bridge(&zif->brslave_info, zvrf->zns);
|
2017-07-20 18:54:46 +02:00
|
|
|
/* In the case of VxLAN, invoke the handler for EVPN. */
|
|
|
|
if (zif->zif_type == ZEBRA_IF_VXLAN)
|
2021-10-08 16:27:50 +02:00
|
|
|
zebra_vxlan_if_update(ifp, &ctx);
|
2020-04-14 17:30:09 +02:00
|
|
|
if (zif->es_info.es)
|
|
|
|
zebra_evpn_es_local_br_port_update(zif);
|
2017-07-20 18:54:46 +02:00
|
|
|
} else if (old_bridge_ifindex != IFINDEX_INTERNAL) {
|
2017-08-19 02:23:30 +02:00
|
|
|
/*
|
|
|
|
* In the case of VxLAN, invoke the handler for EVPN.
|
|
|
|
* Note that this should be done *prior*
|
|
|
|
* to unmapping the interface from the bridge.
|
2017-07-20 18:54:46 +02:00
|
|
|
*/
|
|
|
|
if (zif->zif_type == ZEBRA_IF_VXLAN)
|
2021-10-08 16:27:50 +02:00
|
|
|
zebra_vxlan_if_update(ifp, &ctx);
|
2020-04-14 17:30:09 +02:00
|
|
|
if (zif->es_info.es)
|
|
|
|
zebra_evpn_es_local_br_port_update(zif);
|
2017-08-14 06:52:04 +02:00
|
|
|
zebra_l2_unmap_slave_from_bridge(&zif->brslave_info);
|
2017-07-20 18:54:46 +02:00
|
|
|
}
|
2017-05-15 07:31:08 +02:00
|
|
|
}
|
2018-11-10 21:54:43 +01:00
|
|
|
|
2020-08-05 16:13:55 +02:00
|
|
|
void zebra_l2if_update_bond_slave(struct interface *ifp, ifindex_t bond_ifindex,
|
|
|
|
bool new_bypass)
|
2018-11-10 21:54:43 +01:00
|
|
|
{
|
|
|
|
struct zebra_if *zif;
|
|
|
|
ifindex_t old_bond_ifindex;
|
2020-08-05 16:13:55 +02:00
|
|
|
bool old_bypass;
|
|
|
|
struct zebra_l2info_bondslave *bond_mbr;
|
2018-11-10 21:54:43 +01:00
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
assert(zif);
|
|
|
|
|
2024-03-12 06:36:35 +01:00
|
|
|
old_bypass = !!CHECK_FLAG(zif->flags, ZIF_FLAG_LACP_BYPASS);
|
2020-08-05 16:13:55 +02:00
|
|
|
if (old_bypass != new_bypass) {
|
|
|
|
if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_EVENT)
|
|
|
|
zlog_debug("bond-mbr %s lacp bypass changed to %s",
|
|
|
|
zif->ifp->name, new_bypass ? "on" : "off");
|
|
|
|
|
|
|
|
if (new_bypass)
|
2024-03-12 06:36:35 +01:00
|
|
|
SET_FLAG(zif->flags, ZIF_FLAG_LACP_BYPASS);
|
2020-08-05 16:13:55 +02:00
|
|
|
else
|
2024-03-12 06:36:35 +01:00
|
|
|
UNSET_FLAG(zif->flags, ZIF_FLAG_LACP_BYPASS);
|
2020-08-05 16:13:55 +02:00
|
|
|
|
|
|
|
bond_mbr = &zif->bondslave_info;
|
|
|
|
if (bond_mbr->bond_if) {
|
|
|
|
struct zebra_if *bond_zif = bond_mbr->bond_if->info;
|
|
|
|
|
|
|
|
zebra_l2_bond_lacp_bypass_eval(bond_zif);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-10 21:54:43 +01:00
|
|
|
old_bond_ifindex = zif->bondslave_info.bond_ifindex;
|
|
|
|
if (old_bond_ifindex == bond_ifindex)
|
|
|
|
return;
|
|
|
|
|
|
|
|
zif->bondslave_info.bond_ifindex = bond_ifindex;
|
|
|
|
|
|
|
|
/* Set up or remove link with master */
|
|
|
|
if (bond_ifindex != IFINDEX_INTERNAL)
|
2021-10-22 00:17:40 +02:00
|
|
|
zebra_l2_map_slave_to_bond(zif, ifp->vrf->vrf_id);
|
2018-11-10 21:54:43 +01:00
|
|
|
else if (old_bond_ifindex != IFINDEX_INTERNAL)
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
zebra_l2_unmap_slave_from_bond(zif);
|
2018-11-10 21:54:43 +01:00
|
|
|
}
|
2020-03-28 01:14:45 +01:00
|
|
|
|
|
|
|
void zebra_vlan_bitmap_compute(struct interface *ifp,
|
|
|
|
uint32_t vid_start, uint16_t vid_end)
|
|
|
|
{
|
|
|
|
uint32_t vid;
|
|
|
|
struct zebra_if *zif;
|
|
|
|
|
|
|
|
zif = (struct zebra_if *)ifp->info;
|
|
|
|
assert(zif);
|
|
|
|
|
|
|
|
for (vid = vid_start; vid <= vid_end; ++vid)
|
|
|
|
bf_set_bit(zif->vlan_bitmap, vid);
|
|
|
|
}
|
|
|
|
|
|
|
|
void zebra_vlan_mbr_re_eval(struct interface *ifp, bitfield_t old_vlan_bitmap)
|
|
|
|
{
|
|
|
|
uint32_t vid;
|
|
|
|
struct zebra_if *zif;
|
|
|
|
|
|
|
|
zif = (struct zebra_if *)ifp->info;
|
|
|
|
assert(zif);
|
|
|
|
|
|
|
|
if (!bf_cmp(zif->vlan_bitmap, old_vlan_bitmap))
|
|
|
|
/* no change */
|
|
|
|
return;
|
|
|
|
|
|
|
|
bf_for_each_set_bit(zif->vlan_bitmap, vid, IF_VLAN_BITMAP_MAX) {
|
|
|
|
/* if not already set create new reference */
|
|
|
|
if (!bf_test_index(old_vlan_bitmap, vid))
|
|
|
|
zebra_evpn_vl_mbr_ref(vid, zif);
|
|
|
|
|
|
|
|
/* also clear from the old vlan bitmap */
|
|
|
|
bf_release_index(old_vlan_bitmap, vid);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* any bits remaining in the old vlan bitmap are stale references */
|
|
|
|
bf_for_each_set_bit(old_vlan_bitmap, vid, IF_VLAN_BITMAP_MAX) {
|
|
|
|
zebra_evpn_vl_mbr_deref(vid, zif);
|
|
|
|
}
|
|
|
|
}
|