summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_evpn_mh.h
diff options
context:
space:
mode:
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>2020-05-09 03:47:52 +0200
committerAnuradha Karuppiah <anuradhak@nvidia.com>2020-12-01 18:46:26 +0100
commit15400f95b77f95012e7676f14105ab9280e52c3d (patch)
tree64602fcf60b24e95f8e9f30cf206a60220d74fb9 /zebra/zebra_evpn_mh.h
parentzebra: on local mac add from the dplane a re-install maybe need as static (diff)
downloadfrr-15400f95b77f95012e7676f14105ab9280e52c3d.tar.xz
frr-15400f95b77f95012e7676f14105ab9280e52c3d.zip
zebra: support for slow-failover of local MACs on an ES
When a local ES flaps there are two modes in which the local MACs are failed over - 1. Fast failover - A backup NHG (ES-peer group) is programmed in the dataplane per-access port. When a local ES flaps the MAC entries are left unaltered i.e. pointing to the down access port. And the dataplane redirects traffic destined to the oper-down access port via the backup NHG. 2. Slow failover - This mode needs to be turned on to allow dataplanes not capable of re-directing traffic. In this mode local MAC entries on a down local ES are re-programmed to point to the ES-peers' NHG. And vice-versa i.e. when the ES comes up the MAC entries are re-programmed with the access port as dest. Fast failover is on by default. Slow failover can be enabled via the following config - evpn mh redirect-off Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_evpn_mh.h')
-rw-r--r--zebra/zebra_evpn_mh.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/zebra/zebra_evpn_mh.h b/zebra/zebra_evpn_mh.h
index c232e3b8f..701e5faa9 100644
--- a/zebra/zebra_evpn_mh.h
+++ b/zebra/zebra_evpn_mh.h
@@ -165,6 +165,11 @@ struct zebra_evpn_access_bd {
#define zmh_info (zrouter.mh_info)
struct zebra_evpn_mh_info {
uint32_t flags;
+/* If the dataplane is not capable of handling a backup NHG on an access
+ * port we will need to explicitly failover each MAC entry on
+ * local ES down
+ */
+#define ZEBRA_EVPN_MH_REDIRECT_OFF (1 << 0)
/* DAD support for EVPN-MH is yet to be added. So on detection of
* first local ES, DAD is turned off
*/
@@ -199,6 +204,8 @@ struct zebra_evpn_mh_info {
*/
#define EVPN_NH_ID_TYPE_BIT (1 << EVPN_NH_ID_TYPE_POS)
#define EVPN_NHG_ID_TYPE_BIT (2 << EVPN_NH_ID_TYPE_POS)
+ /* L2-NHG table - key: nhg_id, data: zebra_evpn_es */
+ struct hash *nhg_table;
/* XXX - re-visit the default hold timer value */
int mac_hold_time;
@@ -234,12 +241,18 @@ static inline bool zebra_evpn_mh_is_fdb_nh(uint32_t id)
(id & EVPN_NH_ID_TYPE_BIT));
}
+static inline bool
+zebra_evpn_es_local_mac_via_network_port(struct zebra_evpn_es *es)
+{
+ return !(es->flags & ZEBRA_EVPNES_OPER_UP)
+ && (zmh_info->flags & ZEBRA_EVPN_MH_REDIRECT_OFF);
+}
+
static inline bool zebra_evpn_mh_do_dup_addr_detect(void)
{
return !(zmh_info->flags & ZEBRA_EVPN_MH_DUP_ADDR_DETECT_OFF);
}
-
/*****************************************************************************/
extern esi_t *zero_esi;
extern void zebra_evpn_mh_init(void);
@@ -296,5 +309,8 @@ extern bool zebra_evpn_is_es_bond(struct interface *ifp);
extern bool zebra_evpn_is_es_bond_member(struct interface *ifp);
extern void zebra_evpn_mh_print(struct vty *vty);
extern void zebra_evpn_mh_json(json_object *json);
+extern bool zebra_evpn_nhg_is_local_es(uint32_t nhg_id,
+ struct zebra_evpn_es **local_es);
+extern int zebra_evpn_mh_redirect_off(struct vty *vty, bool redirect_off);
#endif /* _ZEBRA_EVPN_MH_H */