summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_nhg.c
diff options
context:
space:
mode:
authorRajasekar Raja <rajasekarr@nvidia.com>2025-01-10 22:39:12 +0100
committerRajasekar Raja <rajasekarr@nvidia.com>2025-01-10 22:39:12 +0100
commite77954e5d9b2e989f56690ce18951bc0877b37ab (patch)
tree4ddaa240acd430d034a57e22026264ccf8d29236 /zebra/zebra_nhg.c
parentMerge pull request #17829 from Jafaral/static-metric (diff)
downloadfrr-e77954e5d9b2e989f56690ce18951bc0877b37ab.tar.xz
frr-e77954e5d9b2e989f56690ce18951bc0877b37ab.zip
zebra: Optimize invoking nhg compare func
In some cases, the old_re nhe and the newnhe is same and there is no point in comparing them both since they are the same. Skip comparing in such cases. Ex: 2025/01/09 23:49:27.489020 ZEBRA: [W4Z4R-NTSMD] zebra_nhg_rib_find_nhe: => nhe 0x555f611d30c0 (44[38/39/45]) 2025/01/09 23:49:27.489021 ZEBRA: [ZH3FQ-TE9NV] zebra_nhg_rib_compare_old_nhe: 0.0.0.0/0 new id: 44 old id: 44 2025/01/09 23:49:27.489021 ZEBRA: [YB8HE-Z86GN] zebra_nhg_rib_compare_old_nhe: 0.0.0.0/0 NEW 0x555f611d30c0 (44[38/39/45]) 2025/01/09 23:49:27.489023 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.9[0] vrf default(0) wgt 1, with flags 2025/01/09 23:49:27.489024 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 30.1.2.9[0] vrf default(0) wgt 1, with flags 2025/01/09 23:49:27.489025 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.2[4] vrf default(0) wgt 1, with flags ACTIVE 2025/01/09 23:49:27.489026 ZEBRA: [ZM3BX-HPETZ] zebra_nhg_rib_compare_old_nhe: 0.0.0.0/0 OLD 0x555f611d30c0 (44[38/39/45]) 2025/01/09 23:49:27.489027 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.9[0] vrf default(0) wgt 1, with flags 2025/01/09 23:49:27.489028 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 30.1.2.9[0] vrf default(0) wgt 1, with flags 2025/01/09 23:49:27.489028 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.2[4] vrf default(0) wgt 1, with flags ACTIVE Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
Diffstat (limited to '')
-rw-r--r--zebra/zebra_nhg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c
index 6a43fe0c8..0a79ed559 100644
--- a/zebra/zebra_nhg.c
+++ b/zebra/zebra_nhg.c
@@ -3145,8 +3145,8 @@ backups_done:
remove = new_nhe;
- if (old_re && old_re->type == re->type &&
- old_re->instance == re->instance)
+ if (old_re && old_re->type == re->type && old_re->instance == re->instance &&
+ new_nhe != old_re->nhe)
new_nhe = zebra_nhg_rib_compare_old_nhe(rn, re, new_nhe,
old_re->nhe);