bgpd: use bm buffer for rcvd_attr_str debug logging - #22479
Merged
Conversation
enkechen-panw
force-pushed
the
bgp-memory-attrstr
branch
from
June 25, 2026 00:04
e628803 to
42b2d60
Compare
Contributor
Author
|
@greptileai review |
donaldsharp
reviewed
Jun 29, 2026
enkechen-panw
force-pushed
the
bgp-memory-attrstr
branch
from
June 30, 2026 05:26
42b2d60 to
417430e
Compare
Contributor
Author
|
@greptileai review |
The embedded rcvd_attr_str[BUFSIZ] array in struct peer consumes 8192 bytes per peer, but is only used for debug logging of received BGP UPDATE attributes. Move to bm (bgp_master) since BGP packet processing is single-threaded. This eliminates 8KB of memory usage per peer. The attribute string buffer is cleared at the end of bgp_update_receive() to prevent stale state when bgp_update() is called from other paths (RPKI, label-unicast, flowspec, EVPN handlers). Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
enkechen-panw
force-pushed
the
bgp-memory-attrstr
branch
from
June 30, 2026 06:02
417430e to
7e7a19c
Compare
Contributor
Author
|
@greptileai review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The embedded rcvd_attr_str[BUFSIZ] array in struct peer consumes 8192 bytes per peer, but is only used for debug logging of received BGP UPDATE attributes.
Change to a bm buffer since BGP packet processing is single-threaded in the event loop. This eliminates 8KB of memory usage per peer.