]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: Paths, received from shutdown peer, not deleted
authorSoumya Roy <souroy@nvidia.com>
Mon, 7 Apr 2025 05:36:09 +0000 (05:36 +0000)
committerSoumya Roy <souroy@nvidia.com>
Wed, 9 Apr 2025 14:32:23 +0000 (14:32 +0000)
commitd2bec7a691cf9651808d6fb57e1720f536330ab9
tree66a87f55fe1465a8ffaa1cde640b701e438c882e
parent2aa6e786a28108ab07546542a90fd8e70f34bef7
bgpd: Paths, received from shutdown peer, not deleted

Issue:
In a scaled setup, (where number of nets > BGP_CLEARING_BATCH_MAX_DESTS
for walk_batch_table_helper), when peer is shutdown, it is seen some
of the paths are not deleted, which are received from that peer.

Fix:
This is due to, in clear_batch_rib_helper, once walk_batch_table_helper
returns after BGP_CLEARING_BATCH_MAX_DESTS is reached, we just break
from inner loop for the afi/safi for loops. So during walk for next
afi/safi that 'ret' state is overwritten with new state. Also the
resume context is overwritten. This causes to lose the start point
for next walk, some nets are skipped forever. So they are not marked
for deletion anymore. To fix this, we immediately return from current
run. This will have resume state to be stored correctly, and next walk
will start from there.

Testing:
32 ecmp paths were received from the shutdown peer
Before fix:
show bgp ipv6 2052:52:1:167::/64
BGP routing table entry for 2052:52:1:167::/64, version 495
Paths: (246 available, best #127, table default)
  Not advertised to any peer

<snip>
  4200165500 4200165002
    2021:21:51:101::2(spine-5) from spine-5(2021:21:51:101::2) (6.0.0.17)
    (fe80::202:ff:fe00:55) (prefer-global)
      Origin incomplete, valid, external, multipath
      Last update: Fri Apr  4 17:25:05 2025
  4200165500 4200165002
    2021:21:11:116::2(spine-1) from spine-1(2021:21:11:116::2) (0.0.0.0)
    (fe80::202:ff:fe00:3d) (prefer-global)<<<<path not deleted
      Origin incomplete, valid, external
      Last update: Fri Apr  4 17:25:05 2025
  4200165500 4200165002
    2021:21:11:115::2(spine-1) from spine-1(2021:21:11:115::2) (0.0.0.0)
    (fe80::202:ff:fe00:3d) (prefer-global)<<<<path not deleted
      Origin incomplete, valid, external
      Last update: Fri Apr  4 17:25:05 2025
<snip>

 32 paths are supposed to be withdrawn:
root@leaf-1:mgmt:# vtysh -c "show bgp ipv6 2052:52:1:167::/64" | grep "prefer-global" | wc -l
256
root@leaf-1:mgmt# vtysh -c "show bgp ipv6 2052:52:1:167::/64" | grep "prefer-global" | wc -l
246<<should be 224, but showing 246, which is wrong
After fix:
 32 paths are supposed to be withdrawn:
root@leaf-1:mgmt:# vtysh -c "show bgp ipv6 2052:52:1:167::/64" | grep "prefer-global" | wc -l
256
root@leaf-1:mgmt:# vtysh -c "show bgp ipv6 2052:52:1:167::/64" | grep "prefer-global" | wc -l
224<<<shows correctly

Signed-off-by: Soumya Roy <souroy@nvidia.com>
bgpd/bgp_route.c