2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-08-27 16:43:37 +02:00
|
|
|
/* Zebra Router header.
|
|
|
|
* Copyright (C) 2018 Cumulus Networks, Inc.
|
|
|
|
* Donald Sharp
|
|
|
|
*/
|
|
|
|
#ifndef __ZEBRA_ROUTER_H__
|
|
|
|
#define __ZEBRA_ROUTER_H__
|
|
|
|
|
2019-01-11 19:17:45 +01:00
|
|
|
#include "lib/mlag.h"
|
|
|
|
|
2018-08-27 16:43:37 +02:00
|
|
|
#include "zebra/zebra_ns.h"
|
|
|
|
|
2019-03-25 15:11:55 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-08-27 16:43:37 +02:00
|
|
|
/*
|
|
|
|
* This header file contains the idea of a router and as such
|
|
|
|
* owns data that is associated with a router from zebra's
|
|
|
|
* perspective.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct zebra_router_table {
|
|
|
|
RB_ENTRY(zebra_router_table) zebra_router_table_entry;
|
|
|
|
|
|
|
|
uint32_t tableid;
|
|
|
|
afi_t afi;
|
|
|
|
safi_t safi;
|
|
|
|
ns_id_t ns_id;
|
|
|
|
|
|
|
|
struct route_table *table;
|
|
|
|
};
|
|
|
|
RB_HEAD(zebra_router_table_head, zebra_router_table);
|
|
|
|
RB_PROTOTYPE(zebra_router_table_head, zebra_router_table,
|
|
|
|
zebra_router_table_entry, zebra_router_table_entry_compare)
|
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
enum protodown_reasons {
|
2022-01-26 06:07:57 +01:00
|
|
|
/* A process outside of FRR's control protodowned the interface */
|
|
|
|
ZEBRA_PROTODOWN_EXTERNAL = (1 << 0),
|
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
|
|
|
/* On startup local ESs are held down for some time to
|
|
|
|
* allow the underlay to converge and EVPN routes to
|
|
|
|
* get learnt
|
|
|
|
*/
|
2022-01-26 06:07:57 +01:00
|
|
|
ZEBRA_PROTODOWN_EVPN_STARTUP_DELAY = (1 << 1),
|
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 all the uplinks are down the switch has lost access
|
|
|
|
* to the VxLAN overlay and must shut down the access
|
|
|
|
* ports to allow servers to re-direct their traffic to
|
|
|
|
* other switches on the Ethernet Segment
|
|
|
|
*/
|
2022-01-26 06:07:57 +01:00
|
|
|
ZEBRA_PROTODOWN_EVPN_UPLINK_DOWN = (1 << 2),
|
|
|
|
ZEBRA_PROTODOWN_EVPN_ALL = (ZEBRA_PROTODOWN_EVPN_UPLINK_DOWN |
|
|
|
|
ZEBRA_PROTODOWN_EVPN_STARTUP_DELAY),
|
|
|
|
ZEBRA_PROTODOWN_VRRP = (1 << 3),
|
|
|
|
/* This reason used exclusively for testing */
|
2022-01-25 19:49:05 +01:00
|
|
|
ZEBRA_PROTODOWN_SHARP = (1 << 4),
|
|
|
|
/* Just used to clear our fields on shutdown, externel not included */
|
|
|
|
ZEBRA_PROTODOWN_ALL = (ZEBRA_PROTODOWN_EVPN_ALL | ZEBRA_PROTODOWN_VRRP |
|
|
|
|
ZEBRA_PROTODOWN_SHARP)
|
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 ZEBRA_PROTODOWN_RC_STR_LEN 80
|
|
|
|
|
2019-01-11 19:17:45 +01:00
|
|
|
struct zebra_mlag_info {
|
|
|
|
/* Role this zebra router is playing */
|
|
|
|
enum mlag_role role;
|
|
|
|
|
|
|
|
/* The peerlink being used for mlag */
|
|
|
|
char *peerlink;
|
|
|
|
ifindex_t peerlink_ifindex;
|
|
|
|
|
|
|
|
/* The system mac being used */
|
|
|
|
struct ethaddr mac;
|
2019-11-12 09:40:35 +01:00
|
|
|
/*
|
|
|
|
* Zebra will open the communication channel with MLAGD only if any
|
|
|
|
* clients are interested and it is controlled dynamically based on
|
|
|
|
* client registers & un-registers.
|
|
|
|
*/
|
|
|
|
uint32_t clients_interested_cnt;
|
|
|
|
|
|
|
|
/* coomunication channel with MLAGD is established */
|
|
|
|
bool connected;
|
|
|
|
|
|
|
|
/* connection retry timer is running */
|
|
|
|
bool timer_running;
|
|
|
|
|
|
|
|
/* Holds the client data(unencoded) that need to be pushed to MCLAGD*/
|
|
|
|
struct stream_fifo *mlag_fifo;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A new Kernel thread will be created to post the data to MCLAGD.
|
|
|
|
* where as, read will be performed from the zebra main thread, because
|
|
|
|
* read involves accessing client registartion data structures.
|
|
|
|
*/
|
|
|
|
struct frr_pthread *zebra_pth_mlag;
|
|
|
|
|
|
|
|
/* MLAG Thread context 'master' */
|
2023-03-07 20:14:41 +01:00
|
|
|
struct event_loop *th_master;
|
2019-11-12 09:40:35 +01:00
|
|
|
|
2019-11-22 05:33:42 +01:00
|
|
|
/*
|
|
|
|
* Event for Initial MLAG Connection setup & Data Read
|
|
|
|
* Read can be performed only after successful connection establishment,
|
|
|
|
* so no issues.
|
|
|
|
*
|
|
|
|
*/
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_read;
|
2019-11-22 05:33:42 +01:00
|
|
|
/* Event for MLAG write */
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_write;
|
2019-01-11 19:17:45 +01:00
|
|
|
};
|
|
|
|
|
zebra: Bring up 514 BGP neighbor sessions
Issue:
When 514 inerfaces/neighbors are configured, it creates socket error,
"Cannot allocate memory", when back to back V6 RA messages are tried
to be sent over the socket. This prevents interface, to know its peer's
link local address. Socket error comes when 1) try to join ICMPv6 all
router multicast group, back to back for all interfaces 2)send back to
back RA for all interfaces
Fix:
1)For ICMPv6 join case, we check if the interface has already joined
all router group, if not try to join. On failure, retry joining after
random amount of time determined 1 ms to ICMPV6_JOIN_TIMER_EXP_MS(100 ms)
2) For RA issue case, batch sending of RA mesages using wheel timer
Testing:
Monitor BGP session running sh bgp summary command
Before fix:
r1# sh bgp summary
IPv4 Unicast Summary:
BGP router identifier 192.168.1.1, local AS number 1001 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 515, using 12 MiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
r1-eth0 4 1002 89 90 0 0 0 00:07:10 0 0 N/A
r1-eth1 4 1002 89 90 0 0 0 00:07:10 0 0 N/A
r1-eth2 4 1002 89 90 0 0 0 00:07:10 0 0 N/A
r1-eth3 4 1002 89 90 0 0 0 00:07:10 0 0 N/A
r1-eth4 4 1002 89 90 0 0 0 00:07:10 0 0 N/A
r1-eth5 4 1002 89 90 0 0 0 00:07:10 0 0 N/A
…..<snip>...
r1-eth252 4 1002 31 29 0 0 0 00:02:08 0 0 N/A
r1-eth253 4 1002 31 29 0 0 0 00:02:08 0 0 N/A
r1-eth254 4 1002 31 29 0 0 0 00:02:08 0 0 N/A
r1-eth255 4 1002 31 29 0 0 0 00:02:08 0 0 N/A
r1-eth256 4 0 0 0 0 0 0 never Idle 0 N/A
r1-eth257 4 0 0 0 0 0 0 never Idle 0 N/A
r1-eth258 4 0 0 0 0 0 0 never Idle 0 N/A
r1-eth259 4 0 0 0 0 0 0 never Idle 0 N/A
r1-eth260 4 0 0 0 0 0 0 never Idle 0 N/A
……..<snip>…..
r1-eth511 4 0 0 0 0 0 0 never Idle 0 N/A
r1-eth512 4 0 0 0 0 0 0 never Idle 0 N/A
r1-eth513 4 0 0 0 0 0 0 never Idle 0 N/A
r1-eth514 4 0 0 0 0 0 0 never Idle 0 N/A
After fix:
r1# show bgp summary
IPv4 Unicast Summary:
BGP router identifier 192.168.1.1, local AS number 1001 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 515, using 12 MiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
r1-eth0 4 1002 87 87 0 0 0 00:07:04 0 0 N/A
r1-eth1 4 1002 87 87 0 0 0 00:07:04 0 0 N/A
r1-eth2 4 1002 87 87 0 0 0 00:07:04 0 0 N/A
r1-eth3 4 1002 64 67 0 0 0 00:05:09 0 0 N/A
r1-eth4 4 1002 87 87 0 0 0 00:07:04 0 0 N/A
r1-eth5 4 1002 87 87 0 0 0 00:07:04 0 0 N/A
r1-eth6 4 1002 67 70 0 0 0 00:05:22 0 0 N/A
r1-eth7 4 1002 87 87 0 0 0 00:07:04 0 0 N/A
r1-eth8 4 1002 87 87 0 0 0 00:07:04 0 0 N/A
....
r1-eth499 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth500 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth501 4 1002 19 22 0 0 0 00:01:21 0 0 N/A
r1-eth502 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth503 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth504 4 1002 20 23 0 0 0 00:01:30 0 0 N/A
r1-eth505 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth506 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth507 4 1002 22 25 0 0 0 00:01:39 0 0 N/A
r1-eth508 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth509 4 1002 17 20 0 0 0 00:01:13 0 0 N/A
r1-eth510 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth511 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth512 4 1002 19 22 0 0 0 00:01:22 0 0 N/A
r1-eth513 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth514 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
Signed-off-by: Soumya Roy <souroy@nvidia.com>
2025-02-15 03:13:37 +01:00
|
|
|
#define RTADV_TIMER_WHEEL_PERIOD_MS 1000
|
|
|
|
#define RTADV_TIMER_WHEEL_SLOTS_NO 100
|
|
|
|
#define ICMPV6_JOIN_TIMER_EXP_MS 100
|
|
|
|
|
2018-08-27 16:43:37 +02:00
|
|
|
struct zebra_router {
|
2019-09-27 18:15:34 +02:00
|
|
|
atomic_bool in_shutdown;
|
|
|
|
|
2019-01-11 19:31:46 +01:00
|
|
|
/* Thread master */
|
2023-03-07 20:14:41 +01:00
|
|
|
struct event_loop *master;
|
2018-08-27 16:43:37 +02:00
|
|
|
|
zebra: Bring up 514 BGP neighbor sessions
Issue:
When 514 inerfaces/neighbors are configured, it creates socket error,
"Cannot allocate memory", when back to back V6 RA messages are tried
to be sent over the socket. This prevents interface, to know its peer's
link local address. Socket error comes when 1) try to join ICMPv6 all
router multicast group, back to back for all interfaces 2)send back to
back RA for all interfaces
Fix:
1)For ICMPv6 join case, we check if the interface has already joined
all router group, if not try to join. On failure, retry joining after
random amount of time determined 1 ms to ICMPV6_JOIN_TIMER_EXP_MS(100 ms)
2) For RA issue case, batch sending of RA mesages using wheel timer
Testing:
Monitor BGP session running sh bgp summary command
Before fix:
r1# sh bgp summary
IPv4 Unicast Summary:
BGP router identifier 192.168.1.1, local AS number 1001 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 515, using 12 MiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
r1-eth0 4 1002 89 90 0 0 0 00:07:10 0 0 N/A
r1-eth1 4 1002 89 90 0 0 0 00:07:10 0 0 N/A
r1-eth2 4 1002 89 90 0 0 0 00:07:10 0 0 N/A
r1-eth3 4 1002 89 90 0 0 0 00:07:10 0 0 N/A
r1-eth4 4 1002 89 90 0 0 0 00:07:10 0 0 N/A
r1-eth5 4 1002 89 90 0 0 0 00:07:10 0 0 N/A
…..<snip>...
r1-eth252 4 1002 31 29 0 0 0 00:02:08 0 0 N/A
r1-eth253 4 1002 31 29 0 0 0 00:02:08 0 0 N/A
r1-eth254 4 1002 31 29 0 0 0 00:02:08 0 0 N/A
r1-eth255 4 1002 31 29 0 0 0 00:02:08 0 0 N/A
r1-eth256 4 0 0 0 0 0 0 never Idle 0 N/A
r1-eth257 4 0 0 0 0 0 0 never Idle 0 N/A
r1-eth258 4 0 0 0 0 0 0 never Idle 0 N/A
r1-eth259 4 0 0 0 0 0 0 never Idle 0 N/A
r1-eth260 4 0 0 0 0 0 0 never Idle 0 N/A
……..<snip>…..
r1-eth511 4 0 0 0 0 0 0 never Idle 0 N/A
r1-eth512 4 0 0 0 0 0 0 never Idle 0 N/A
r1-eth513 4 0 0 0 0 0 0 never Idle 0 N/A
r1-eth514 4 0 0 0 0 0 0 never Idle 0 N/A
After fix:
r1# show bgp summary
IPv4 Unicast Summary:
BGP router identifier 192.168.1.1, local AS number 1001 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 515, using 12 MiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
r1-eth0 4 1002 87 87 0 0 0 00:07:04 0 0 N/A
r1-eth1 4 1002 87 87 0 0 0 00:07:04 0 0 N/A
r1-eth2 4 1002 87 87 0 0 0 00:07:04 0 0 N/A
r1-eth3 4 1002 64 67 0 0 0 00:05:09 0 0 N/A
r1-eth4 4 1002 87 87 0 0 0 00:07:04 0 0 N/A
r1-eth5 4 1002 87 87 0 0 0 00:07:04 0 0 N/A
r1-eth6 4 1002 67 70 0 0 0 00:05:22 0 0 N/A
r1-eth7 4 1002 87 87 0 0 0 00:07:04 0 0 N/A
r1-eth8 4 1002 87 87 0 0 0 00:07:04 0 0 N/A
....
r1-eth499 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth500 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth501 4 1002 19 22 0 0 0 00:01:21 0 0 N/A
r1-eth502 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth503 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth504 4 1002 20 23 0 0 0 00:01:30 0 0 N/A
r1-eth505 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth506 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth507 4 1002 22 25 0 0 0 00:01:39 0 0 N/A
r1-eth508 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth509 4 1002 17 20 0 0 0 00:01:13 0 0 N/A
r1-eth510 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth511 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth512 4 1002 19 22 0 0 0 00:01:22 0 0 N/A
r1-eth513 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
r1-eth514 4 1002 43 43 0 0 0 00:03:22 0 0 N/A
Signed-off-by: Soumya Roy <souroy@nvidia.com>
2025-02-15 03:13:37 +01:00
|
|
|
/* Wheel to process V6 RA update */
|
|
|
|
struct timer_wheel *ra_wheel;
|
|
|
|
|
2019-01-11 19:38:19 +01:00
|
|
|
/* Lists of clients who have connected to us */
|
2025-03-16 21:56:19 +01:00
|
|
|
struct zserv_client_list_head client_list;
|
2019-01-11 19:38:19 +01:00
|
|
|
|
2019-10-22 16:01:58 +02:00
|
|
|
/* List of clients in GR */
|
|
|
|
struct list *stale_client_list;
|
|
|
|
|
2018-08-27 16:43:37 +02:00
|
|
|
struct zebra_router_table_head tables;
|
2018-08-27 20:36:46 +02:00
|
|
|
|
2018-08-27 16:43:37 +02:00
|
|
|
/* L3-VNI hash table (for EVPN). Only in default instance */
|
|
|
|
struct hash *l3vni_table;
|
2018-08-27 20:36:46 +02:00
|
|
|
|
2020-03-28 01:14:45 +01:00
|
|
|
/* Tables and other global info maintained for EVPN multihoming */
|
|
|
|
struct zebra_evpn_mh_info *mh_info;
|
|
|
|
|
2021-12-18 20:28:49 +01:00
|
|
|
struct zebra_neigh_info *neigh_info;
|
|
|
|
|
2020-03-28 01:14:45 +01:00
|
|
|
/* EVPN MH broadcast domains indexed by the VID */
|
|
|
|
struct hash *evpn_vlan_table;
|
|
|
|
|
2018-08-27 20:36:46 +02:00
|
|
|
struct hash *rules_hash;
|
2018-08-27 21:24:02 +02:00
|
|
|
|
|
|
|
struct hash *ipset_hash;
|
|
|
|
|
|
|
|
struct hash *ipset_entry_hash;
|
|
|
|
|
|
|
|
struct hash *iptable_hash;
|
2018-08-27 21:34:36 +02:00
|
|
|
|
2022-09-06 09:10:11 +02:00
|
|
|
struct hash *qdisc_hash;
|
|
|
|
struct hash *class_hash;
|
|
|
|
struct hash *filter_hash;
|
|
|
|
|
2019-01-22 13:39:14 +01:00
|
|
|
/* A sequence number used for tracking routes */
|
|
|
|
_Atomic uint32_t sequence_num;
|
2019-01-11 20:59:36 +01:00
|
|
|
|
2019-01-11 21:11:38 +01:00
|
|
|
/* rib work queue */
|
|
|
|
#define ZEBRA_RIB_PROCESS_HOLD_TIME 10
|
|
|
|
#define ZEBRA_RIB_PROCESS_RETRY_TIME 1
|
|
|
|
struct work_queue *ribq;
|
2019-01-11 21:30:57 +01:00
|
|
|
|
|
|
|
/* Meta Queue Information */
|
|
|
|
struct meta_queue *mq;
|
2019-01-11 21:33:20 +01:00
|
|
|
|
|
|
|
/* LSP work queue */
|
|
|
|
struct work_queue *lsp_process_q;
|
2019-01-11 21:35:45 +01:00
|
|
|
|
|
|
|
#define ZEBRA_ZAPI_PACKETS_TO_PROCESS 1000
|
|
|
|
_Atomic uint32_t packets_to_process;
|
2019-01-11 19:17:45 +01:00
|
|
|
|
|
|
|
/* Mlag information for the router */
|
|
|
|
struct zebra_mlag_info mlag_info;
|
2019-03-27 02:16:27 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The EVPN instance, if any
|
|
|
|
*/
|
|
|
|
struct zebra_vrf *evpn_vrf;
|
2019-02-13 20:58:29 +01:00
|
|
|
|
|
|
|
uint32_t multipath_num;
|
2019-05-10 02:06:13 +02:00
|
|
|
|
|
|
|
/*
|
2024-06-27 00:49:45 +02:00
|
|
|
* zebra start time and time of sweeping RIB of old routes
|
2019-05-10 02:06:13 +02:00
|
|
|
*/
|
|
|
|
time_t startup_time;
|
2024-06-27 00:49:45 +02:00
|
|
|
time_t rib_sweep_time;
|
|
|
|
|
|
|
|
/* FRR fast/graceful restart info */
|
|
|
|
bool graceful_restart;
|
|
|
|
int gr_cleanup_time;
|
|
|
|
#define ZEBRA_GR_DEFAULT_RIB_SWEEP_TIME 500
|
|
|
|
struct event *t_rib_sweep;
|
2019-01-24 14:06:34 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The hash of nexthop groups associated with this router
|
|
|
|
*/
|
|
|
|
struct hash *nhgs;
|
2019-02-15 19:18:48 +01:00
|
|
|
struct hash *nhgs_id;
|
2020-09-18 21:41:19 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Does the underlying system provide an asic offload
|
|
|
|
*/
|
|
|
|
bool asic_offloaded;
|
2020-09-28 21:22:52 +02:00
|
|
|
bool notify_on_ack;
|
2023-07-24 17:16:53 +02:00
|
|
|
bool v6_with_v4_nexthop;
|
2022-01-22 13:53:24 +01:00
|
|
|
|
2023-11-03 17:58:42 +01:00
|
|
|
bool v6_rr_semantics;
|
|
|
|
|
2022-10-05 16:04:11 +02:00
|
|
|
/*
|
|
|
|
* If the asic is notifying us about successful nexthop
|
|
|
|
* allocation/control. Some developers have made their
|
|
|
|
* asic take control of how many nexthops/ecmp they can
|
|
|
|
* have and will report what is successfull or not
|
|
|
|
*/
|
|
|
|
bool asic_notification_nexthop_control;
|
|
|
|
|
2022-01-22 13:53:24 +01:00
|
|
|
bool supports_nhgs;
|
2022-06-16 01:54:29 +02:00
|
|
|
|
2022-06-27 21:30:55 +02:00
|
|
|
bool all_mc_forwardingv4, default_mc_forwardingv4;
|
|
|
|
bool all_mc_forwardingv6, default_mc_forwardingv6;
|
|
|
|
bool all_linkdownv4, default_linkdownv4;
|
|
|
|
bool all_linkdownv6, default_linkdownv6;
|
|
|
|
|
2022-06-16 01:54:29 +02:00
|
|
|
#define ZEBRA_DEFAULT_NHG_KEEP_TIMER 180
|
|
|
|
uint32_t nhg_keep;
|
2022-06-30 17:59:39 +02:00
|
|
|
|
|
|
|
/* Should we allow non FRR processes to delete our routes */
|
|
|
|
bool allow_delete;
|
2023-04-27 13:37:58 +02:00
|
|
|
|
|
|
|
uint8_t protodown_r_bit;
|
2023-09-28 18:44:31 +02:00
|
|
|
|
|
|
|
uint64_t nexthop_weight_scale_value;
|
2018-08-27 16:43:37 +02:00
|
|
|
};
|
|
|
|
|
2019-05-10 02:06:13 +02:00
|
|
|
#define GRACEFUL_RESTART_TIME 60
|
|
|
|
|
2018-08-27 16:43:37 +02:00
|
|
|
extern struct zebra_router zrouter;
|
2022-02-26 21:40:15 +01:00
|
|
|
extern uint32_t rcvbufsize;
|
2018-08-27 16:43:37 +02:00
|
|
|
|
2023-07-24 17:16:53 +02:00
|
|
|
extern void zebra_router_init(bool asic_offload, bool notify_on_ack,
|
|
|
|
bool v6_with_v4_nexthop);
|
2019-03-08 16:35:38 +01:00
|
|
|
extern void zebra_router_cleanup(void);
|
2018-08-27 16:43:37 +02:00
|
|
|
extern void zebra_router_terminate(void);
|
|
|
|
|
2020-02-28 03:38:24 +01:00
|
|
|
extern struct zebra_router_table *zebra_router_find_zrt(struct zebra_vrf *zvrf,
|
|
|
|
uint32_t tableid,
|
|
|
|
afi_t afi, safi_t safi);
|
2023-10-20 10:53:05 +02:00
|
|
|
extern struct zebra_router_table *
|
|
|
|
zebra_router_find_next_zrt(struct zebra_vrf *zvrf, uint32_t tableid, afi_t afi,
|
|
|
|
safi_t safi);
|
2018-08-27 16:43:37 +02:00
|
|
|
extern struct route_table *zebra_router_find_table(struct zebra_vrf *zvrf,
|
|
|
|
uint32_t tableid, afi_t afi,
|
|
|
|
safi_t safi);
|
|
|
|
extern struct route_table *zebra_router_get_table(struct zebra_vrf *zvrf,
|
|
|
|
uint32_t tableid, afi_t afi,
|
|
|
|
safi_t safi);
|
2019-02-28 15:11:41 +01:00
|
|
|
extern void zebra_router_release_table(struct zebra_vrf *zvrf, uint32_t tableid,
|
|
|
|
afi_t afi, safi_t safi);
|
2018-08-27 16:43:37 +02:00
|
|
|
|
|
|
|
extern int zebra_router_config_write(struct vty *vty);
|
|
|
|
|
|
|
|
extern void zebra_router_sweep_route(void);
|
2019-08-01 20:07:04 +02:00
|
|
|
extern void zebra_router_sweep_nhgs(void);
|
2019-01-04 15:41:09 +01:00
|
|
|
|
|
|
|
extern void zebra_router_show_table_summary(struct vty *vty);
|
2019-01-22 13:39:14 +01:00
|
|
|
|
|
|
|
extern uint32_t zebra_router_get_next_sequence(void);
|
2019-03-27 02:16:27 +01:00
|
|
|
|
|
|
|
static inline vrf_id_t zebra_vrf_get_evpn_id(void)
|
|
|
|
{
|
|
|
|
return zrouter.evpn_vrf ? zvrf_id(zrouter.evpn_vrf) : VRF_DEFAULT;
|
|
|
|
}
|
|
|
|
static inline struct zebra_vrf *zebra_vrf_get_evpn(void)
|
|
|
|
{
|
|
|
|
return zrouter.evpn_vrf ? zrouter.evpn_vrf
|
|
|
|
: zebra_vrf_lookup_by_id(VRF_DEFAULT);
|
|
|
|
}
|
2019-03-28 18:41:38 +01:00
|
|
|
|
2020-09-28 21:22:52 +02:00
|
|
|
extern bool zebra_router_notify_on_ack(void);
|
|
|
|
|
2022-01-22 13:53:24 +01:00
|
|
|
static inline void zebra_router_set_supports_nhgs(bool support)
|
|
|
|
{
|
|
|
|
zrouter.supports_nhgs = support;
|
|
|
|
}
|
|
|
|
|
2022-08-04 13:36:51 +02:00
|
|
|
static inline bool zebra_router_in_shutdown(void)
|
|
|
|
{
|
|
|
|
return atomic_load_explicit(&zrouter.in_shutdown, memory_order_relaxed);
|
|
|
|
}
|
|
|
|
|
2023-04-27 13:37:58 +02:00
|
|
|
#define FRR_PROTODOWN_REASON_DEFAULT_BIT 7
|
|
|
|
/* Protodown bit setter/getter
|
|
|
|
*
|
|
|
|
* Allow users to change the bit if it conflicts with another
|
|
|
|
* on their system.
|
|
|
|
*/
|
|
|
|
static inline void if_netlink_set_frr_protodown_r_bit(uint8_t bit)
|
|
|
|
{
|
|
|
|
zrouter.protodown_r_bit = bit;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void if_netlink_unset_frr_protodown_r_bit(void)
|
|
|
|
{
|
|
|
|
zrouter.protodown_r_bit = FRR_PROTODOWN_REASON_DEFAULT_BIT;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool if_netlink_frr_protodown_r_bit_is_set(void)
|
|
|
|
{
|
|
|
|
return (zrouter.protodown_r_bit != FRR_PROTODOWN_REASON_DEFAULT_BIT);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline uint8_t if_netlink_get_frr_protodown_r_bit(void)
|
|
|
|
{
|
|
|
|
return zrouter.protodown_r_bit;
|
|
|
|
}
|
|
|
|
|
2024-09-30 18:41:06 +02:00
|
|
|
extern void zebra_main_router_started(void);
|
|
|
|
|
2019-10-07 23:30:27 +02:00
|
|
|
/* zebra_northbound.c */
|
|
|
|
extern const struct frr_yang_module_info frr_zebra_info;
|
|
|
|
|
2019-03-25 15:11:55 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-08-27 16:43:37 +02:00
|
|
|
#endif
|