diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 16ecc2e54599..bb05a022dd59 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -3067,13 +3067,25 @@ static int install_evpn_route_entry_in_vrf(struct bgp *bgp_vrf, /* Process for route leaking. */ vpn_leak_from_vrf_update(bgp_get_default(), bgp_vrf, pi); - if (bgp_debug_zebra(NULL)) - zlog_debug("... %s pi dest %p (l %d) pi %p (l %d, f 0x%x)", - new_pi ? "new" : "update", dest, - bgp_dest_get_lock_count(dest), pi, pi->lock, - pi->flags); - - bgp_dest_unlock_node(dest); + if (bgp_debug_zebra(NULL)) { + struct ipaddr nhip; + + memset(&nhip, 0, sizeof(nhip)); + if (pi->net->rn->p.family == AF_INET6) { + SET_IPADDR_V6(&nhip); + memcpy(&nhip.ipaddr_v6, &pi->attr->mp_nexthop_global, + sizeof(nhip.ipaddr_v6)); + } else { + SET_IPADDR_V4(&nhip); + memcpy(&nhip.ipaddr_v4, &pi->attr->nexthop, sizeof(nhip.ipaddr_v4)); + } + zlog_debug("... %s pi dest %p (l %d) pi %p (l %d, f 0x%x) nh %pIA", + new_pi ? "new" : "update", dest, + bgp_dest_get_lock_count(dest), pi, pi->lock, pi->flags, + &nhip); + } + + bgp_dest_unlock_node(dest); return ret; } @@ -3380,12 +3392,26 @@ static int uninstall_evpn_route_entry_in_vrf(struct bgp *bgp_vrf, return 0; } - if (bgp_debug_zebra(NULL)) - zlog_debug("... delete dest %p (l %d) pi %p (l %d, f 0x%x)", - dest, bgp_dest_get_lock_count(dest), pi, pi->lock, - pi->flags); + if (bgp_debug_zebra(NULL)) { + struct ipaddr nhip; - /* Process for route leaking. */ + memset(&nhip, 0, sizeof(nhip)); + if (pi->net->rn->p.family == AF_INET6) { + SET_IPADDR_V6(&nhip); + memcpy(&nhip.ipaddr_v6, &pi->attr->mp_nexthop_global, + sizeof(nhip.ipaddr_v6)); + } else { + SET_IPADDR_V4(&nhip); + memcpy(&nhip.ipaddr_v4, &pi->attr->nexthop, sizeof(nhip.ipaddr_v4)); + } + + zlog_debug( + "... delete pi %s dest %p (l %d) pi %p (l %d, f 0x%x) nh %pIA", + bgp_vrf->name_pretty, dest, bgp_dest_get_lock_count(dest), pi, + pi->lock, pi->flags, &nhip); + } + + /* Process for route leaking. */ vpn_leak_from_vrf_withdraw(bgp_get_default(), bgp_vrf, pi); bgp_aggregate_decrement(bgp_vrf, bgp_dest_get_prefix(dest), pi, afi, diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c index c7d8551b5e2b..2244e6981121 100644 --- a/bgpd/bgp_evpn_mh.c +++ b/bgpd/bgp_evpn_mh.c @@ -4457,15 +4457,14 @@ static void bgp_evpn_nh_zebra_update_send(struct bgp_evpn_nh *nh, bool add) stream_putw_at(s, 0, stream_get_endp(s)); - if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) { - if (add) - zlog_debug("evpn vrf %s nh %s rmac %pEA add to zebra", - nh->bgp_vrf->name_pretty, nh->nh_str, - &nh->rmac); - else if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) - zlog_debug("evpn vrf %s nh %s del to zebra", - nh->bgp_vrf->name_pretty, nh->nh_str); - } + if (BGP_DEBUG(evpn_mh, EVPN_MH_ES) || bgp_debug_zebra(NULL)) { + if (add) + zlog_debug("evpn %s nh %s rmac %pEA add to zebra", + nh->bgp_vrf->name_pretty, nh->nh_str, &nh->rmac); + else + zlog_debug("evpn %s nh %s del to zebra", nh->bgp_vrf->name_pretty, + nh->nh_str); + } frrtrace(2, frr_bgp, evpn_mh_nh_rmac_zsend, add, nh); @@ -4646,9 +4645,9 @@ static void bgp_evpn_nh_update_ref_pi(struct bgp_evpn_nh *nh) continue; if (BGP_DEBUG(evpn_mh, EVPN_MH_ES)) - zlog_debug("evpn vrf %s nh %s ref_pi update", - nh->bgp_vrf->name_pretty, nh->nh_str); - nh->ref_pi = pi; + zlog_debug("evpn %s nh %s ref_pi update", + nh->bgp_vrf->name_pretty, nh->nh_str); + nh->ref_pi = pi; /* If we have a new pi copy rmac from it and update * zebra if the new rmac is different */ @@ -4724,13 +4723,14 @@ static void bgp_evpn_path_nh_unlink(struct bgp_path_evpn_nh_info *nh_info) pi = nh_info->pi; if (BGP_DEBUG(evpn_mh, EVPN_MH_RT)) - zlog_debug("path %s unlinked from nh %s %s", - pi->net ? prefix2str(&pi->net->rn->p, prefix_buf, - sizeof(prefix_buf)) - : "", - nh->bgp_vrf->name_pretty, nh->nh_str); + zlog_debug("path %s unlinked from %s nh %s pathcount %u", + pi->net ? prefix2str(&pi->net->rn->p, prefix_buf, + sizeof(prefix_buf)) + : "", + nh->bgp_vrf->name_pretty, nh->nh_str, + listcount(nh->pi_list)); - list_delete_node(nh->pi_list, &nh_info->nh_listnode); + list_delete_node(nh->pi_list, &nh_info->nh_listnode); nh_info->nh = NULL; @@ -4759,9 +4759,9 @@ static void bgp_evpn_path_nh_link(struct bgp *bgp_vrf, struct bgp_path_info *pi) if (!bgp_vrf->evpn_nh_table) { if (BGP_DEBUG(evpn_mh, EVPN_MH_RT)) - zlog_debug("path %pFX linked to vrf %s failed", - &pi->net->rn->p, bgp_vrf->name_pretty); - return; + zlog_debug("path %pFX linked to %s failed", &pi->net->rn->p, + bgp_vrf->name_pretty); + return; } nh_info = (pi->extra && pi->extra->evpn && pi->extra->evpn->mh_info) @@ -4807,10 +4807,11 @@ static void bgp_evpn_path_nh_link(struct bgp *bgp_vrf, struct bgp_path_info *pi) bgp_evpn_path_nh_unlink(nh_info); if (BGP_DEBUG(evpn_mh, EVPN_MH_RT)) - zlog_debug("path %pFX linked to nh %s %s", &pi->net->rn->p, - nh->bgp_vrf->name_pretty, nh->nh_str); + zlog_debug("path %pFX linked to %s nh %s pathcount %u", + &pi->net->rn->p, nh->bgp_vrf->name_pretty, nh->nh_str, + listcount(nh->pi_list)); - /* link mac-ip path to the new nh */ + /* link mac-ip path to the new nh */ nh_info->nh = nh; listnode_init(&nh_info->nh_listnode, nh_info); listnode_add(nh->pi_list, &nh_info->nh_listnode); diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index dfb8d01f2da8..08427ab17f51 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -2936,14 +2936,14 @@ static int bgp_zebra_process_local_l3vni(ZAPI_CALLBACK_ARGS) is_anycast_mac = stream_getl(s); if (BGP_DEBUG(zebra, ZEBRA)) - zlog_debug( - "Rx L3-VNI ADD VRF %s VNI %u Originator-IP %pI4 RMAC svi-mac %pEA vrr-mac %pEA filter %s svi-if %u", - vrf_id_to_name(vrf_id), l3vni, &originator_ip, - &svi_rmac, &vrr_rmac, - filter ? "prefix-routes-only" : "none", - svi_ifindex); - - frrtrace(8, frr_bgp, evpn_local_l3vni_add_zrecv, l3vni, vrf_id, + zlog_debug( + "Rx L3VNI ADD VRF %s VNI %u Originator-IP %pI4 RMAC " + "svi-mac %pEA vrr-mac %pEA filter %s svi-if %u", + vrf_id_to_name(vrf_id), l3vni, &originator_ip, &svi_rmac, + &vrr_rmac, filter ? "prefix-routes-only" : "none", + svi_ifindex); + + frrtrace(8, frr_bgp, evpn_local_l3vni_add_zrecv, l3vni, vrf_id, &svi_rmac, &vrr_rmac, filter, originator_ip, svi_ifindex, is_anycast_mac); @@ -2952,10 +2952,10 @@ static int bgp_zebra_process_local_l3vni(ZAPI_CALLBACK_ARGS) is_anycast_mac); } else { if (BGP_DEBUG(zebra, ZEBRA)) - zlog_debug("Rx L3-VNI DEL VRF %s VNI %u", - vrf_id_to_name(vrf_id), l3vni); + zlog_debug("Rx L3VNI DEL VRF %s VNI %u", + vrf_id_to_name(vrf_id), l3vni); - frrtrace(2, frr_bgp, evpn_local_l3vni_del_zrecv, l3vni, vrf_id); + frrtrace(2, frr_bgp, evpn_local_l3vni_del_zrecv, l3vni, vrf_id); bgp_evpn_local_l3vni_del(l3vni, vrf_id); } diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 91a5bc4d4252..aa05ddc7faa9 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -2265,16 +2265,16 @@ static int zl3vni_send_add_to_client(struct zebra_l3vni *zl3vni) stream_putw_at(s, 0, stream_get_endp(s)); if (IS_ZEBRA_DEBUG_VXLAN) - zlog_debug( - "Send L3_VNI_ADD %u VRF %s RMAC %pEA VRR %pEA local-ip %pI4 filter %s to %s", - zl3vni->vni, vrf_id_to_name(zl3vni_vrf_id(zl3vni)), - &svi_rmac, &vrr_rmac, &zl3vni->local_vtep_ip, - CHECK_FLAG(zl3vni->filter, PREFIX_ROUTES_ONLY) - ? "prefix-routes-only" - : "none", - zebra_route_string(client->proto)); - - client->l3vniadd_cnt++; + zlog_debug("Send L3VNI ADD %u VRF %s RMAC %pEA VRR %pEA local-ip " + "%pI4 filter %s to %s", + zl3vni->vni, vrf_id_to_name(zl3vni_vrf_id(zl3vni)), + &svi_rmac, &vrr_rmac, &zl3vni->local_vtep_ip, + CHECK_FLAG(zl3vni->filter, PREFIX_ROUTES_ONLY) + ? "prefix-routes-only" + : "none", + zebra_route_string(client->proto)); + + client->l3vniadd_cnt++; return zserv_send_message(client, s); } @@ -2300,11 +2300,11 @@ static int zl3vni_send_del_to_client(struct zebra_l3vni *zl3vni) stream_putw_at(s, 0, stream_get_endp(s)); if (IS_ZEBRA_DEBUG_VXLAN) - zlog_debug("Send L3_VNI_DEL %u VRF %s to %s", zl3vni->vni, - vrf_id_to_name(zl3vni_vrf_id(zl3vni)), - zebra_route_string(client->proto)); + zlog_debug("Send L3VNI DEL %u VRF %s to %s", zl3vni->vni, + vrf_id_to_name(zl3vni_vrf_id(zl3vni)), + zebra_route_string(client->proto)); - client->l3vnidel_cnt++; + client->l3vnidel_cnt++; return zserv_send_message(client, s); }