Merge pull request #16416 from raja-rajasekar/rajasekarr/fix_logs_bp

bgpd: backpressure - fix ret value and log err for evpn
This commit is contained in:
Donatas Abraitis 2024-07-25 21:09:39 +03:00 committed by GitHub
commit 353efe7ae8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 15 deletions

View file

@ -1490,11 +1490,12 @@ int evpn_route_select_install(struct bgp *bgp, struct bgpevpn *vpn,
&& !bgp_addpath_is_addpath_used(&bgp->tx_addpath, afi, safi)) { && !bgp_addpath_is_addpath_used(&bgp->tx_addpath, afi, safi)) {
if (bgp_zebra_has_route_changed(old_select)) { if (bgp_zebra_has_route_changed(old_select)) {
if (CHECK_FLAG(bgp->flags, BGP_FLAG_DELETE_IN_PROGRESS)) if (CHECK_FLAG(bgp->flags, BGP_FLAG_DELETE_IN_PROGRESS))
evpn_zebra_install(bgp, vpn, ret = evpn_zebra_install(bgp, vpn,
(const struct prefix_evpn *) (const struct prefix_evpn
bgp_dest_get_prefix( *)
dest), bgp_dest_get_prefix(
old_select); dest),
old_select);
else else
bgp_zebra_route_install(dest, old_select, bgp, bgp_zebra_route_install(dest, old_select, bgp,
true, vpn, false); true, vpn, false);
@ -1532,10 +1533,11 @@ int evpn_route_select_install(struct bgp *bgp, struct bgpevpn *vpn,
&& (new_select->sub_type == BGP_ROUTE_IMPORTED || && (new_select->sub_type == BGP_ROUTE_IMPORTED ||
bgp_evpn_attr_is_sync(new_select->attr))) { bgp_evpn_attr_is_sync(new_select->attr))) {
if (CHECK_FLAG(bgp->flags, BGP_FLAG_DELETE_IN_PROGRESS)) if (CHECK_FLAG(bgp->flags, BGP_FLAG_DELETE_IN_PROGRESS))
evpn_zebra_install(bgp, vpn, ret = evpn_zebra_install(bgp, vpn,
(const struct prefix_evpn *) (const struct prefix_evpn *)
bgp_dest_get_prefix(dest), bgp_dest_get_prefix(
new_select); dest),
new_select);
else else
bgp_zebra_route_install(dest, new_select, bgp, true, bgp_zebra_route_install(dest, new_select, bgp, true,
vpn, false); vpn, false);
@ -1559,11 +1561,12 @@ int evpn_route_select_install(struct bgp *bgp, struct bgpevpn *vpn,
old_select->sub_type == BGP_ROUTE_IMPORTED) { old_select->sub_type == BGP_ROUTE_IMPORTED) {
if (CHECK_FLAG(bgp->flags, BGP_FLAG_DELETE_IN_PROGRESS) || if (CHECK_FLAG(bgp->flags, BGP_FLAG_DELETE_IN_PROGRESS) ||
CHECK_FLAG(bgp->flags, BGP_FLAG_VNI_DOWN)) CHECK_FLAG(bgp->flags, BGP_FLAG_VNI_DOWN))
evpn_zebra_uninstall(bgp, vpn, ret = evpn_zebra_uninstall(bgp, vpn,
(const struct prefix_evpn *) (const struct prefix_evpn
bgp_dest_get_prefix( *)
dest), bgp_dest_get_prefix(
old_select, false); dest),
old_select, false);
else else
bgp_zebra_route_install(dest, old_select, bgp, bgp_zebra_route_install(dest, old_select, bgp,
false, vpn, false); false, vpn, false);

View file

@ -1785,6 +1785,7 @@ static void bgp_handle_route_announcements_to_zebra(struct event *e)
struct bgp_table *table = NULL; struct bgp_table *table = NULL;
enum zclient_send_status status = ZCLIENT_SEND_SUCCESS; enum zclient_send_status status = ZCLIENT_SEND_SUCCESS;
bool install; bool install;
const struct prefix_evpn *evp = NULL;
while (count < ZEBRA_ANNOUNCEMENTS_LIMIT) { while (count < ZEBRA_ANNOUNCEMENTS_LIMIT) {
is_evpn = false; is_evpn = false;
@ -1796,8 +1797,11 @@ static void bgp_handle_route_announcements_to_zebra(struct event *e)
table = bgp_dest_table(dest); table = bgp_dest_table(dest);
install = CHECK_FLAG(dest->flags, BGP_NODE_SCHEDULE_FOR_INSTALL); install = CHECK_FLAG(dest->flags, BGP_NODE_SCHEDULE_FOR_INSTALL);
if (table->afi == AFI_L2VPN && table->safi == SAFI_EVPN) if (table->afi == AFI_L2VPN && table->safi == SAFI_EVPN) {
is_evpn = true; is_evpn = true;
evp = (const struct prefix_evpn *)bgp_dest_get_prefix(
dest);
}
if (BGP_DEBUG(zebra, ZEBRA)) if (BGP_DEBUG(zebra, ZEBRA))
zlog_debug("BGP %s%s route %pBD(%s) with dest %p and flags 0x%x to zebra", zlog_debug("BGP %s%s route %pBD(%s) with dest %p and flags 0x%x to zebra",
@ -1835,6 +1839,17 @@ static void bgp_handle_route_announcements_to_zebra(struct event *e)
UNSET_FLAG(dest->flags, BGP_NODE_SCHEDULE_FOR_DELETE); UNSET_FLAG(dest->flags, BGP_NODE_SCHEDULE_FOR_DELETE);
} }
if (is_evpn && status == ZCLIENT_SEND_FAILURE)
flog_err(EC_BGP_EVPN_FAIL,
"%s (%u): Failed to %s EVPN %pFX %s route in VNI %u",
vrf_id_to_name(table->bgp->vrf_id),
table->bgp->vrf_id,
install ? "install" : "uninstall", evp,
evp->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE
? "MACIP"
: "IMET",
dest->za_vpn->vni);
bgp_path_info_unlock(dest->za_bgp_pi); bgp_path_info_unlock(dest->za_bgp_pi);
dest->za_bgp_pi = NULL; dest->za_bgp_pi = NULL;
dest->za_vpn = NULL; dest->za_vpn = NULL;