2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-11-10 21:54:43 +01:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Interface function header.
|
|
|
|
* Copyright (C) 1999 Kunihiro Ishiguro
|
|
|
|
*/
|
|
|
|
|
2004-07-23 17:26:14 +02:00
|
|
|
#ifndef _ZEBRA_INTERFACE_H
|
|
|
|
#define _ZEBRA_INTERFACE_H
|
|
|
|
|
|
|
|
#include "redistribute.h"
|
2016-02-01 19:55:42 +01:00
|
|
|
#include "vrf.h"
|
2017-08-06 08:08:39 +02:00
|
|
|
#include "hook.h"
|
2020-03-28 01:14:45 +01:00
|
|
|
#include "bitfield.h"
|
2004-06-12 16:33:05 +02:00
|
|
|
|
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"
|
2019-10-24 00:28:10 +02:00
|
|
|
#include "zebra/zebra_nhg_private.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/zebra_router.h"
|
2021-04-18 12:11:14 +02:00
|
|
|
#include "zebra/rtadv.h"
|
2017-05-15 07:31:08 +02:00
|
|
|
|
2019-03-25 15:11:55 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-06-29 15:05:17 +02:00
|
|
|
/* For interface configuration. */
|
|
|
|
#define IF_ZEBRA_DATA_UNSPEC 0
|
|
|
|
#define IF_ZEBRA_DATA_ON 1
|
|
|
|
#define IF_ZEBRA_DATA_OFF 2
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2020-03-28 01:14:45 +01:00
|
|
|
#define IF_VLAN_BITMAP_MAX 4096
|
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
/* Zebra interface type - ones of interest. */
|
2021-08-30 19:24:26 +02:00
|
|
|
enum zebra_iftype {
|
2017-08-28 04:42:25 +02:00
|
|
|
ZEBRA_IF_OTHER = 0, /* Anything else */
|
|
|
|
ZEBRA_IF_VXLAN, /* VxLAN interface */
|
|
|
|
ZEBRA_IF_VRF, /* VRF device */
|
|
|
|
ZEBRA_IF_BRIDGE, /* bridge device */
|
|
|
|
ZEBRA_IF_VLAN, /* VLAN sub-interface */
|
|
|
|
ZEBRA_IF_MACVLAN, /* MAC VLAN interface*/
|
2018-08-29 11:29:07 +02:00
|
|
|
ZEBRA_IF_VETH, /* VETH interface*/
|
2018-11-10 21:54:43 +01:00
|
|
|
ZEBRA_IF_BOND, /* Bond */
|
|
|
|
ZEBRA_IF_BOND_SLAVE, /* Bond */
|
2019-12-19 18:33:56 +01:00
|
|
|
ZEBRA_IF_GRE, /* GRE interface */
|
2021-08-30 19:24:26 +02:00
|
|
|
};
|
2017-05-15 07:31:08 +02:00
|
|
|
|
|
|
|
/* Zebra "slave" interface type */
|
2021-08-30 19:27:02 +02:00
|
|
|
enum zebra_slave_iftype {
|
2017-05-15 07:31:08 +02:00
|
|
|
ZEBRA_IF_SLAVE_NONE, /* Not a slave */
|
|
|
|
ZEBRA_IF_SLAVE_VRF, /* Member of a VRF */
|
|
|
|
ZEBRA_IF_SLAVE_BRIDGE, /* Member of a bridge */
|
2018-11-10 21:54:43 +01:00
|
|
|
ZEBRA_IF_SLAVE_BOND, /* Bond member */
|
2017-05-15 07:31:08 +02:00
|
|
|
ZEBRA_IF_SLAVE_OTHER, /* Something else - e.g., bond slave */
|
2021-08-30 19:27:02 +02:00
|
|
|
};
|
2017-05-15 07:31:08 +02:00
|
|
|
|
2017-08-06 08:08:39 +02:00
|
|
|
struct irdp_interface;
|
|
|
|
|
2020-03-28 01:14:45 +01:00
|
|
|
/* Ethernet segment info used for setting up EVPN multihoming */
|
|
|
|
struct zebra_evpn_es;
|
|
|
|
struct zebra_es_if_info {
|
2020-10-21 20:56:48 +02:00
|
|
|
/* type-3 esi config */
|
2020-03-28 01:14:45 +01:00
|
|
|
struct ethaddr sysmac;
|
|
|
|
uint32_t lid; /* local-id; has to be unique per-ES-sysmac */
|
2020-10-21 20:56:48 +02:00
|
|
|
|
|
|
|
esi_t esi;
|
|
|
|
|
2020-05-09 01:41:43 +02:00
|
|
|
uint16_t df_pref;
|
2020-08-05 16:13:55 +02:00
|
|
|
uint8_t flags;
|
|
|
|
#define ZIF_CFG_ES_FLAG_BYPASS (1 << 0)
|
|
|
|
|
2020-03-28 01:14:45 +01:00
|
|
|
struct zebra_evpn_es *es; /* local ES */
|
|
|
|
};
|
|
|
|
|
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
|
|
|
enum zebra_if_flags {
|
|
|
|
/* device has been configured as an uplink for
|
|
|
|
* EVPN multihoming
|
|
|
|
*/
|
|
|
|
ZIF_FLAG_EVPN_MH_UPLINK = (1 << 0),
|
|
|
|
ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP = (1 << 1),
|
|
|
|
|
|
|
|
/* Dataplane protodown-on */
|
2020-08-05 16:13:55 +02:00
|
|
|
ZIF_FLAG_PROTODOWN = (1 << 2),
|
2022-01-21 10:03:01 +01:00
|
|
|
/* Dataplane protodown-on Queued to the dplane */
|
|
|
|
ZIF_FLAG_SET_PROTODOWN = (1 << 3),
|
|
|
|
/* Dataplane protodown-off Queued to the dplane */
|
|
|
|
ZIF_FLAG_UNSET_PROTODOWN = (1 << 4),
|
2020-08-05 16:13:55 +02:00
|
|
|
|
|
|
|
/* LACP bypass state is set by the dataplane on a bond member
|
|
|
|
* and inherited by the bond (if one or more bond members are in
|
|
|
|
* a bypass state the bond is placed in a bypass state)
|
|
|
|
*/
|
2022-01-21 10:03:01 +01:00
|
|
|
ZIF_FLAG_LACP_BYPASS = (1 << 5)
|
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
|
|
|
};
|
|
|
|
|
2022-02-15 20:08:06 +01:00
|
|
|
#define ZEBRA_IF_IS_PROTODOWN(zif) ((zif)->flags & ZIF_FLAG_PROTODOWN)
|
2022-01-25 19:49:05 +01:00
|
|
|
#define ZEBRA_IF_IS_PROTODOWN_ONLY_EXTERNAL(zif) \
|
2022-02-15 20:08:06 +01:00
|
|
|
((zif)->protodown_rc == ZEBRA_PROTODOWN_EXTERNAL)
|
2022-01-25 19:49:05 +01:00
|
|
|
|
2022-12-02 17:10:58 +01:00
|
|
|
/* Mem type for zif desc */
|
|
|
|
DECLARE_MTYPE(ZIF_DESC);
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* `zebra' daemon local interface structure. */
|
|
|
|
struct zebra_if {
|
2020-03-28 01:14:45 +01:00
|
|
|
/* back pointer to the interface */
|
|
|
|
struct interface *ifp;
|
|
|
|
|
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
|
|
|
enum zebra_if_flags flags;
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Shutdown configuration. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t shutdown;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Multicast configuration. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t multicast;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2021-09-17 22:32:27 +02:00
|
|
|
/* MPLS status. */
|
|
|
|
bool mpls;
|
|
|
|
|
2022-06-23 17:00:08 +02:00
|
|
|
/* Linkdown status */
|
2022-06-27 21:11:45 +02:00
|
|
|
bool linkdown, linkdownv6;
|
2022-06-23 17:00:08 +02:00
|
|
|
|
2022-06-27 21:04:21 +02:00
|
|
|
/* Is Multicast Forwarding on? */
|
2022-06-27 21:11:45 +02:00
|
|
|
bool v4mcast_on, v6mcast_on;
|
2022-06-27 21:04:21 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Router advertise configuration. */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t rtadv_enable;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
/* Installed addresses chains tree. */
|
|
|
|
struct route_table *ipv4_subnets;
|
|
|
|
|
2019-05-14 18:53:19 +02:00
|
|
|
/* Nexthops pointing to this interface */
|
2019-03-11 21:29:57 +01:00
|
|
|
/**
|
|
|
|
* Any nexthop that we get should have an
|
|
|
|
* interface. When an interface goes down,
|
|
|
|
* we will use this list to update the nexthops
|
|
|
|
* pointing to it with that info.
|
|
|
|
*/
|
2019-07-24 18:27:40 +02:00
|
|
|
struct nhg_connected_tree_head nhg_dependents;
|
2019-03-11 21:29:57 +01:00
|
|
|
|
2016-04-07 21:43:44 +02:00
|
|
|
/* Information about up/down changes */
|
|
|
|
unsigned int up_count;
|
2021-11-11 20:33:41 +01:00
|
|
|
char up_last[FRR_TIMESTAMP_LEN];
|
2016-04-07 21:43:44 +02:00
|
|
|
unsigned int down_count;
|
2021-11-11 20:33:41 +01:00
|
|
|
char down_last[FRR_TIMESTAMP_LEN];
|
2016-04-07 21:43:44 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
struct rtadvconf rtadv;
|
2016-06-20 17:21:10 +02:00
|
|
|
unsigned int ra_sent, ra_rcvd;
|
2004-06-12 16:33:05 +02:00
|
|
|
|
2017-08-06 08:08:39 +02:00
|
|
|
struct irdp_interface *irdp;
|
2004-06-12 16:33:05 +02:00
|
|
|
|
2016-01-15 16:36:33 +01:00
|
|
|
#ifdef HAVE_STRUCT_SOCKADDR_DL
|
|
|
|
union {
|
|
|
|
/* note that sdl_storage is never accessed, it only exists to
|
|
|
|
* make space.
|
|
|
|
* all actual uses refer to sdl - but use sizeof(sdl_storage)!
|
|
|
|
* this fits
|
|
|
|
* best with C aliasing rules. */
|
|
|
|
struct sockaddr_dl sdl;
|
|
|
|
struct sockaddr_storage sdl_storage;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2016-04-22 00:39:38 +02:00
|
|
|
/* ptm enable configuration */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t ptm_enable;
|
2017-05-15 07:31:08 +02:00
|
|
|
|
|
|
|
/* Zebra interface and "slave" interface type */
|
2021-08-30 19:24:26 +02:00
|
|
|
enum zebra_iftype zif_type;
|
2021-08-30 19:27:02 +02:00
|
|
|
enum zebra_slave_iftype zif_slave_type;
|
2017-05-15 07:31:08 +02:00
|
|
|
|
|
|
|
/* Additional L2 info, depends on zif_type */
|
|
|
|
union zebra_l2if_info l2info;
|
|
|
|
|
|
|
|
/* For members of a bridge, link to bridge. */
|
|
|
|
/* Note: If additional fields become necessary, this can be modified to
|
|
|
|
* be a pointer to a dynamically allocd struct.
|
|
|
|
*/
|
|
|
|
struct zebra_l2info_brslave brslave_info;
|
|
|
|
|
2018-11-10 21:54:43 +01:00
|
|
|
struct zebra_l2info_bondslave bondslave_info;
|
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_l2info_bond bond_info;
|
2018-11-10 21:54:43 +01:00
|
|
|
|
2020-03-28 01:14:45 +01:00
|
|
|
/* ethernet segment */
|
|
|
|
struct zebra_es_if_info es_info;
|
|
|
|
|
|
|
|
/* bitmap of vlans associated with this interface */
|
|
|
|
bitfield_t vlan_bitmap;
|
|
|
|
|
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
|
|
|
/* An interface can be error-disabled if a protocol (such as EVPN or
|
|
|
|
* VRRP) detects a problem with keeping it operationally-up.
|
|
|
|
* If any of the protodown bits are set protodown-on is programmed
|
|
|
|
* in the dataplane. This results in a carrier/L1 down on the
|
|
|
|
* physical device.
|
|
|
|
*/
|
2022-01-26 06:07:57 +01:00
|
|
|
uint32_t protodown_rc;
|
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
|
|
|
|
2020-09-08 15:56:33 +02:00
|
|
|
/* list of zebra_mac entries using this interface as destination */
|
|
|
|
struct list *mac_list;
|
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
/* Link fields - for sub-interfaces. */
|
2023-02-21 07:00:36 +01:00
|
|
|
ns_id_t link_nsid;
|
2017-05-15 07:31:08 +02:00
|
|
|
ifindex_t link_ifindex;
|
|
|
|
struct interface *link;
|
2018-01-11 01:01:57 +01:00
|
|
|
|
2022-02-23 16:32:23 +01:00
|
|
|
uint8_t speed_update_count;
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *speed_update;
|
2018-04-09 14:04:39 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Does this interface have a v6 to v4 ll neighbor entry
|
|
|
|
* for bgp unnumbered?
|
|
|
|
*/
|
|
|
|
bool v6_2_v4_ll_neigh_entry;
|
2018-09-19 17:02:42 +02:00
|
|
|
char neigh_mac[6];
|
2018-04-09 14:04:39 +02:00
|
|
|
struct in6_addr v6_2_v4_ll_addr6;
|
2019-04-28 01:55:21 +02:00
|
|
|
|
|
|
|
/* The description of the interface */
|
|
|
|
char *desc;
|
2002-12-13 21:15:29 +01:00
|
|
|
};
|
|
|
|
|
2017-08-06 08:08:39 +02:00
|
|
|
DECLARE_HOOK(zebra_if_extra_info, (struct vty * vty, struct interface *ifp),
|
|
|
|
(vty, ifp));
|
|
|
|
DECLARE_HOOK(zebra_if_config_wr, (struct vty * vty, struct interface *ifp),
|
|
|
|
(vty, ifp));
|
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
#define IS_ZEBRA_IF_VRF(ifp) \
|
|
|
|
(((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_VRF)
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
#define IS_ZEBRA_IF_BRIDGE(ifp) \
|
|
|
|
(((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_BRIDGE)
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
#define IS_ZEBRA_IF_VLAN(ifp) \
|
|
|
|
(((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_VLAN)
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
#define IS_ZEBRA_IF_VXLAN(ifp) \
|
|
|
|
(((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_VXLAN)
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-06-28 10:51:10 +02:00
|
|
|
#define IS_ZEBRA_IF_MACVLAN(ifp) \
|
|
|
|
(((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_MACVLAN)
|
|
|
|
|
2018-08-29 11:29:07 +02:00
|
|
|
#define IS_ZEBRA_IF_VETH(ifp) \
|
|
|
|
(((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_VETH)
|
|
|
|
|
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
|
|
|
#define IS_ZEBRA_IF_BOND(ifp) \
|
|
|
|
(((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_BOND)
|
|
|
|
|
2019-12-19 18:33:56 +01:00
|
|
|
#define IS_ZEBRA_IF_GRE(ifp) \
|
|
|
|
(((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_GRE)
|
|
|
|
|
2018-08-29 11:29:07 +02:00
|
|
|
#define IS_ZEBRA_IF_BRIDGE_SLAVE(ifp) \
|
2017-05-15 07:31:08 +02:00
|
|
|
(((struct zebra_if *)(ifp->info))->zif_slave_type \
|
|
|
|
== ZEBRA_IF_SLAVE_BRIDGE)
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
#define IS_ZEBRA_IF_VRF_SLAVE(ifp) \
|
|
|
|
(((struct zebra_if *)(ifp->info))->zif_slave_type == ZEBRA_IF_SLAVE_VRF)
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-11-10 21:54:43 +01:00
|
|
|
#define IS_ZEBRA_IF_BOND_SLAVE(ifp) \
|
|
|
|
(((struct zebra_if *)(ifp->info))->zif_slave_type \
|
|
|
|
== ZEBRA_IF_SLAVE_BOND)
|
|
|
|
|
2017-12-08 00:35:29 +01:00
|
|
|
extern void zebra_if_init(void);
|
|
|
|
|
2018-03-27 21:13:34 +02:00
|
|
|
extern struct interface *if_lookup_by_index_per_ns(struct zebra_ns *, uint32_t);
|
2017-04-30 15:26:06 +02:00
|
|
|
extern struct interface *if_lookup_by_name_per_ns(struct zebra_ns *,
|
|
|
|
const char *);
|
2016-02-01 19:55:42 +01:00
|
|
|
extern struct interface *if_link_per_ns(struct zebra_ns *, struct interface *);
|
2023-02-21 07:00:36 +01:00
|
|
|
extern struct interface *if_lookup_by_index_per_nsid(ns_id_t nsid,
|
|
|
|
uint32_t ifindex);
|
2016-02-23 05:17:09 +01:00
|
|
|
extern const char *ifindex2ifname_per_ns(struct zebra_ns *, unsigned int);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-02-01 19:55:42 +01:00
|
|
|
extern void if_unlink_per_ns(struct interface *);
|
2018-09-19 17:02:42 +02:00
|
|
|
extern void if_nbr_mac_to_ipv4ll_neigh_update(struct interface *fip,
|
|
|
|
char mac[6],
|
|
|
|
struct in6_addr *address,
|
|
|
|
int add);
|
2015-06-11 18:19:59 +02:00
|
|
|
extern void if_nbr_ipv6ll_to_ipv4ll_neigh_update(struct interface *ifp,
|
|
|
|
struct in6_addr *address,
|
|
|
|
int add);
|
|
|
|
extern void if_nbr_ipv6ll_to_ipv4ll_neigh_del_all(struct interface *ifp);
|
2022-03-25 01:02:33 +01:00
|
|
|
extern void if_delete_update(struct interface **ifp);
|
2005-06-28 19:17:12 +02:00
|
|
|
extern void if_add_update(struct interface *ifp);
|
2020-10-02 20:49:09 +02:00
|
|
|
extern void if_up(struct interface *ifp, bool install_connected);
|
2005-06-28 19:17:12 +02:00
|
|
|
extern void if_down(struct interface *);
|
|
|
|
extern void if_refresh(struct interface *);
|
[zebra/solaris] Interface state fixups for Solaris.
2006-01-25 Paul Jakma <paul.jakma@sun.com>
* (general) More solaris PF_ROUTE hacks. The IFF_UP mangling
for solaris was incomplete on the PF_ROUTE side. fix it.
This changeset generally uglifies things. For some future
work I'd like to see the state changes seperated out from
the details of the code. Differences between systems might
then be slightly easier to implement without convoluted
hacks.
Changes should be specific to Solaris mostly, however
also tested on FreeBSD 6.
* if_ioctl_solaris.c: (interface_list_ioctl) ignore ~IFF_UP
interfaces, we'll hear about them when/if interface goes up
through NEWADDR.
Update flags explicitely at end of it to kick mangling.
* ioctl_solaris.c: (if_mangle_up) removed to interface.c, in
kind.
(lifreq_set_name) more convenient to take the string, than
the ifp.
(if_get_flags_direct) new convenience function, returns
the actual flags. Used during bootstrap in if_ioctl_solaris.c
to peek at flags of logical interfaces to see whether or
not to ignore them.
(if_get_flags) ENXIO means it's gone, poke out IFF_UP and
kick flags update.
(if_{un,}set_flags) flags argument should be 64bit.
* ioctl.{c,h}: flags argument should be 64bit.
* interface.h: Add a 'primary_state' flag to struct zebra_if on
SUNOS_5.
Export if_flags_update.
* interface.c: (if_flags_mangle) moved over in kind from
ioctl_solaris.c. Nasty kludge to try get IFF_UP right, as
much as is possible. Also keep track of the actual IFF_UP
value for the primary interface, so we can know when the ifp
must be deleted.
(if_flags_update) Take a new interface flags value, apply it
to the interface, and take whatever actions are required due
to flag transitions.
(if_refresh) flag state change logic is moved out to
previous. Just call if_get_flags, which will end up using
previous to effect the update of flags.
(if_flag_dump_vty) IFF_IPV{4,6} aren't interesting, VIRTUAL
and NOXMIT are though.
* kernel_socket.c: (ifm_read) Down->Down transitions shouldn't
create ifp, for non-IFANNOUNCE systems.
Use if_flags_update to update flags.
flag transition logic is now handled automatically through
if_flags_update.
(ifam_read) Better to call if_refresh *after* adding
connected addresses, as connected count affects IFF_UP on
IFF_UP-mangled systems.
On Solaris, Up->Down due to DELADDR means we need to delete
the ifp - the IFINFO might already have been and gone.
* rt.h: include other dependent headers.
2006-01-25 05:31:40 +01:00
|
|
|
extern void if_flags_update(struct interface *, uint64_t);
|
2005-06-28 19:17:12 +02:00
|
|
|
extern int if_subnet_add(struct interface *, struct connected *);
|
|
|
|
extern int if_subnet_delete(struct interface *, struct connected *);
|
2015-12-07 22:05:34 +01:00
|
|
|
extern int ipv6_address_configured(struct interface *ifp);
|
2016-02-25 20:30:53 +01:00
|
|
|
extern void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id);
|
2018-08-27 17:00:18 +02:00
|
|
|
extern void zebra_if_update_link(struct interface *ifp, ifindex_t link_ifindex,
|
|
|
|
ns_id_t ns_id);
|
2021-04-29 12:02:47 +02:00
|
|
|
extern void zebra_if_update_all_links(struct zebra_ns *zns);
|
2022-02-15 18:33:06 +01:00
|
|
|
/**
|
|
|
|
* Directly update entire protodown & reason code bitfield.
|
|
|
|
*/
|
|
|
|
extern int zebra_if_update_protodown_rc(struct interface *ifp, bool new_down,
|
|
|
|
uint32_t new_protodown_rc);
|
2022-11-08 17:59:33 +01:00
|
|
|
|
|
|
|
extern void cli_show_legacy_admin_group(struct vty *vty,
|
|
|
|
const struct lyd_node *dnode,
|
|
|
|
bool show_defaults);
|
|
|
|
extern void cli_show_affinity_mode(struct vty *vty,
|
|
|
|
const struct lyd_node *dnode,
|
|
|
|
bool show_defaults);
|
|
|
|
extern void cli_show_affinity(struct vty *vty, const struct lyd_node *dnode,
|
|
|
|
bool show_defaults);
|
|
|
|
|
2022-02-15 18:33:06 +01:00
|
|
|
/**
|
|
|
|
* Set protodown with single reason.
|
|
|
|
*/
|
2022-01-26 06:07:57 +01:00
|
|
|
extern int zebra_if_set_protodown(struct interface *ifp, bool down,
|
|
|
|
enum protodown_reasons new_reason);
|
2020-02-25 03:40:29 +01:00
|
|
|
extern int if_ip_address_install(struct interface *ifp, struct prefix *prefix,
|
|
|
|
const char *label, struct prefix *pp);
|
|
|
|
extern int if_ipv6_address_install(struct interface *ifp, struct prefix *prefix,
|
|
|
|
const char *label);
|
|
|
|
extern int if_ip_address_uinstall(struct interface *ifp, struct prefix *prefix);
|
|
|
|
extern int if_shutdown(struct interface *ifp);
|
|
|
|
extern int if_no_shutdown(struct interface *ifp);
|
|
|
|
extern int if_multicast_set(struct interface *ifp);
|
|
|
|
extern int if_multicast_unset(struct interface *ifp);
|
|
|
|
extern int if_linkdetect(struct interface *ifp, bool detect);
|
|
|
|
extern void if_addr_wakeup(struct interface *ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2019-05-14 18:53:19 +02:00
|
|
|
/* Nexthop group connected functions */
|
|
|
|
extern void if_nhg_dependents_add(struct interface *ifp,
|
|
|
|
struct nhg_hash_entry *nhe);
|
|
|
|
extern void if_nhg_dependents_del(struct interface *ifp,
|
|
|
|
struct nhg_hash_entry *nhe);
|
|
|
|
extern unsigned int if_nhg_dependents_count(const struct interface *ifp);
|
|
|
|
extern bool if_nhg_dependents_is_empty(const struct interface *ifp);
|
2019-03-11 21:29:57 +01:00
|
|
|
|
2016-02-01 19:55:42 +01:00
|
|
|
extern void vrf_add_update(struct vrf *vrfp);
|
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
|
|
|
extern void zebra_l2_map_slave_to_bond(struct zebra_if *zif, vrf_id_t vrf);
|
|
|
|
extern void zebra_l2_unmap_slave_from_bond(struct zebra_if *zif);
|
2022-01-26 06:07:57 +01:00
|
|
|
extern const char *zebra_protodown_rc_str(uint32_t protodown_rc, char *pd_buf,
|
|
|
|
uint32_t pd_buf_len);
|
|
|
|
void zebra_if_dplane_result(struct zebra_dplane_ctx *ctx);
|
2016-02-01 19:55:42 +01:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#ifdef HAVE_PROC_NET_DEV
|
2006-08-06 17:57:59 +02:00
|
|
|
extern void ifstat_update_proc(void);
|
2002-12-13 21:15:29 +01:00
|
|
|
#endif /* HAVE_PROC_NET_DEV */
|
|
|
|
#ifdef HAVE_NET_RT_IFLIST
|
2005-06-28 19:17:12 +02:00
|
|
|
extern void ifstat_update_sysctl(void);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
#endif /* HAVE_NET_RT_IFLIST */
|
|
|
|
#ifdef HAVE_PROC_NET_DEV
|
2005-06-28 19:17:12 +02:00
|
|
|
extern int interface_list_proc(void);
|
2002-12-13 21:15:29 +01:00
|
|
|
#endif /* HAVE_PROC_NET_DEV */
|
|
|
|
#ifdef HAVE_PROC_NET_IF_INET6
|
2005-06-28 19:17:12 +02:00
|
|
|
extern int ifaddr_proc_ipv6(void);
|
2002-12-13 21:15:29 +01:00
|
|
|
#endif /* HAVE_PROC_NET_IF_INET6 */
|
|
|
|
|
2019-03-25 15:11:55 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-07-23 17:26:14 +02:00
|
|
|
#endif /* _ZEBRA_INTERFACE_H */
|