bgpd: backpressure generic framework - #21192
Conversation
|
I've added to the bgp architecture slide deck what I am thinking here Slide 4 is what we currently have. Slide 5 is where I want to go. Currently we only apply backpressure to routes being installed into zebra. BGP on the other hand sends a bunch of different data down to zebra some of which is ignoring backpressure which is not good and also we get different orderings than originally intended. Chirag has implemented the abstraction of having a installation list instead of a dest list for what to install into zebra. We can now easily come back through and add other types to this setup. |
Greptile SummaryThis PR decouples the zebra announce backpressure FIFO from being directly tied to
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[bgp_zebra_route_install] -->|New dest on list| B{Schedule flags?}
B -->|Neither INSTALL nor DELETE set| C[Allocate bgp_bp_install_node]
C --> D[Set type = BGP_BP_INSTALL_ROUTE]
D --> E[Set ptr = dest]
E --> F[Add to zebra_announce FIFO tail]
F --> G[Set dest->za_inode = inode]
B -->|INSTALL or DELETE already set| H[Update za_bgp_pi in-place]
I[bgp_handle_route_announcements_to_zebra] -->|Pop from FIFO| J{inode->type?}
J -->|BGP_BP_INSTALL_ROUTE| K[Extract dest from inode->ptr]
K --> L[Install/Withdraw to Zebra]
L --> M[Cleanup: unlock, null pointers, XFREE inode]
J -->|Other type future| N[XFREE inode, continue]
O[bgp_delete / evpn_pop] -->|Iterate FIFO| P{inode->type == ROUTE?}
P -->|Yes| Q[Match BGP instance or VPN]
Q -->|Match| R[Del from FIFO, cleanup, XFREE inode]
P -->|No| S[Skip - continue]
Last reviewed commit: a752fb9 |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This change decouples the backpressure logic from being tied exclusively to bgp_dest. It introduces a generic structure that can hold a void pointer to any BGP-related object that needs to send to zebra using the the backpressure framework. The associated enum identifies the object type so the correct ZAPI handler can be invoked. Signed-off-by: Chirag Shah <chirag@nvidia.com> Signed-off-by: Donald Sharp <sharpd@nvidia.com>
For generic backpressur logic, the dest carrying the backpressure list node pointer. Signed-off-by: Chirag Shah <chirag@nvidia.com> Signed-off-by: Donald Sharp <sharpd@nvidia.com>
BGP started at Mon Mar 16 19:27:16 2026
BGP GSHUT is disabled.
Number of BGP instances (including default): 1
BGP suppress-fib-pending is disabled.
BGP Input Queue Limit: 10000
BGP Output Queue Limit: 10000
Zebra Announce Count: 0 <<<
BGP Global Update Delay Timers:
Update Delay Time: 0s
Establish Wait Time: 0s
{
"bgpStartedAt":"Mon Mar 16 19:27:16 2026\n",
"bgpStartedGracefully":"No",
"bgpGShutEnabled":false,
"bgpInMaintenanceMode":"No",
"bgpInstanceCount":1,
"bgpWaitForFibSet":false,
"bgpInputQueueLimit":10000,
"bgpOutputQueueLimit":10000,
"zebraAnnounceCount":0,
"bgpUpdateDelayTime":0,
"bgpEstablishWaitTime":0,
"bgpRMapDelayTimer":5
}
Signed-off-by: Chirag Shah <chirag@nvidia.com>
node# show bgp statistics
BGP IPv6 Unicast RIB statistics (VRF default)
Total Advertisements : 15
Total Prefixes : 15
Average prefix length : 98.13
Unaggregateable prefixes : 15
Maximum aggregateable prefixes: 0
BGP Aggregate advertisements : 0
Address space advertised : 6.01295e+10
/32 equivalent %s
: 7.58942e-19
/48 equivalent %s
: 4.9738e-14
Advertisements with paths : 15
Longest AS-Path (hops) : 0
Average AS-Path length (hops) : 0.00
Largest AS-Path (bytes) : 0
Average AS-Path size (bytes) : 0.00
Highest public ASN : 0
Zebra announce queue : 0 <<<<<<<
node# show bgp statistics json
{
"ipv6Unicast":[
{
"instance":"VRF default",
"totalAdvertisements":171,
"totalPrefixes":64,
"averagePrefixLength":101.0,
"unaggregateablePrefixes":64,
"maximumAggregateablePrefixes":0,
"bgpAggregateAdvertisements":0,
"addressSpaceAdvertised":231928233994.0,
"/32equivalent":2.9273458658370797e-18,
"/48equivalent":1.9184653866349886e-13,
"advertisementsWithPaths":171,
"longestAsPath":4,
"averageAsPathLengthHops":2.2807017543859649,
"largestAsPath":18,
"averageAsPathSizeBytes":10.947368421052632,
"highestPublicAsn":0,
"zebraAnnounceQueue":0, <<<<<
}
Signed-off-by: Chirag Shah <chirag@nvidia.com>
This change decouples the backpressure logic from being tied exclusively to bgp_dest.
It introduces a generic structure that can hold a void pointer to any BGP-related object that needs to send to zebra using the the backpressure framework. The associated enum identifies the object type so the correct ZAPI handler can be invoked.
Signed-off-by: Chirag Shah chirag@nvidia.com
Signed-off-by: Donald Sharp sharpd@nvidia.com