From: Donald Sharp Date: Thu, 16 Aug 2018 12:58:01 +0000 (-0400) Subject: bgpd: Convert bgp_evpn.c to use flow_warn X-Git-Tag: frr-7.1-dev~371^2~45 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=286425133ed819d34aac43a99bd0d181dbd28a82;p=mirror%2Ffrr.git bgpd: Convert bgp_evpn.c to use flow_warn Signed-off-by: Donald Sharp --- diff --git a/bgpd/bgp_errors.c b/bgpd/bgp_errors.c index b9f814af2a..afe669ed1e 100644 --- a/bgpd/bgp_errors.c +++ b/bgpd/bgp_errors.c @@ -127,6 +127,24 @@ static struct log_ref ferr_bgp_warn[] = { .description = "BGP attempted to set the SO_MARK option for a socket and was unable to do so", .suggestion = "Please collect log files and open Issue", }, + { + .code = BGP_WARN_EVPN_PMSI_PRESENT, + .title = "BGP Received a EVPN NLRI with PMSI included", + .description = "BGP has received a type-3 NLRI with PMSI information. At this time FRR is not capable of properly handling this NLRI type", + .suggestion = "Setup peer to not send this type of data to FRR" + }, + { + .code = BGP_WARN_EVPN_VPN_VNI, + .title = "BGP has received a local macip and cannot properly handle it", + .description = "BGP has received a local macip from zebra and has no way to properly handle the macip because the vni is not setup properly", + .suggestion = "Ensure proper setup of BGP EVPN", + }, + { + .code = BGP_WARN_EVPN_ESI, + .title = "BGP has received a local ESI for deletion", + .description = "BGP has received a local ESI for deletion but when attempting to find the stored data internally was unable to find the information for deletion", + .suggestion = "Gather logging and open an Issue", + }, { .code = END_FERR, } diff --git a/bgpd/bgp_errors.h b/bgpd/bgp_errors.h index c47a600082..95202cdb04 100644 --- a/bgpd/bgp_errors.h +++ b/bgpd/bgp_errors.h @@ -89,6 +89,9 @@ enum bgp_log_refs { BGP_WARN_UNRECOGNIZED_CAPABILITY, BGP_WARN_NO_TCP_MD5, BGP_WARN_NO_SOCKOPT_MARK, + BGP_WARN_EVPN_PMSI_PRESENT, + BGP_WARN_EVPN_VPN_VNI, + BGP_WARN_EVPN_ESI, }; extern void bgp_error_init(void); diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index a104a2e16d..713179ab97 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -3683,7 +3683,8 @@ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi, if (attr && (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL))) { if (attr->pmsi_tnl_type != PMSI_TNLTYPE_INGR_REPL) { - zlog_warn("%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d", + flog_warn(BGP_WARN_EVPN_PMSI_PRESENT, + "%u:%s - Rx EVPN Type-3 NLRI with unsupported PTA %d", peer->bgp->vrf_id, peer->host, attr->pmsi_tnl_type); } @@ -5162,7 +5163,8 @@ int bgp_evpn_local_macip_del(struct bgp *bgp, vni_t vni, struct ethaddr *mac, /* Lookup VNI hash - should exist. */ vpn = bgp_evpn_lookup_vni(bgp, vni); if (!vpn || !is_vni_live(vpn)) { - zlog_warn("%u: VNI hash entry for VNI %u %s at MACIP DEL", + flog_warn(BGP_WARN_EVPN_VPN_VNI, + "%u: VNI hash entry for VNI %u %s at MACIP DEL", bgp->vrf_id, vni, vpn ? "not live" : "not found"); return -1; } @@ -5186,7 +5188,8 @@ int bgp_evpn_local_macip_add(struct bgp *bgp, vni_t vni, struct ethaddr *mac, /* Lookup VNI hash - should exist. */ vpn = bgp_evpn_lookup_vni(bgp, vni); if (!vpn || !is_vni_live(vpn)) { - zlog_warn("%u: VNI hash entry for VNI %u %s at MACIP ADD", + flog_warn(BGP_WARN_EVPN_VPN_VNI, + "%u: VNI hash entry for VNI %u %s at MACIP ADD", bgp->vrf_id, vni, vpn ? "not live" : "not found"); return -1; } @@ -5398,9 +5401,9 @@ int bgp_evpn_local_vni_del(struct bgp *bgp, vni_t vni) vpn = bgp_evpn_lookup_vni(bgp, vni); if (!vpn) { if (bgp_debug_zebra(NULL)) - zlog_warn( - "%u: VNI hash entry for VNI %u not found at DEL", - bgp->vrf_id, vni); + flog_warn(BGP_WARN_EVPN_VPN_VNI, + "%u: VNI hash entry for VNI %u not found at DEL", + bgp->vrf_id, vni); return 0; } @@ -5529,9 +5532,9 @@ int bgp_evpn_local_es_del(struct bgp *bgp, /* Lookup ESI hash - should exist. */ es = bgp_evpn_lookup_es(bgp, esi); if (!es) { - zlog_warn("%u: ESI hash entry for ESI %s at Local ES DEL", - bgp->vrf_id, - esi_to_str(esi, buf, sizeof(buf))); + flog_warn(BGP_WARN_EVPN_ESI, + "%u: ESI hash entry for ESI %s at Local ES DEL", + bgp->vrf_id, esi_to_str(esi, buf, sizeof(buf))); return -1; }