Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: Convert the bgp_advertise_attr->adv to a fifo (backport #14554) #15621

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Mar 26, 2024

BGP is storing outgoing updates in a couple of different fifo's. This is to ensure proper packet packing of all bgp_dests that happen to use the same attribute.

How it's all put together currently: On initial update BGP walks through all the bgp_dest's in a table. For each path being sent a bgp_advertise is created. This bgp_advertise is placed in fifo order on the bgp_synchronize->update queue. The bgp_advertise has a pointer to the bgp_advertise_attr which is associated iwth the actual attribute that is being sent to it's peer. In turn this bgp_advertise is placed in a fifo off of the bgp_advertise_attr structure. As such as we have paths that share an attribute, the path/dest is placed on the bgp_syncrhonize->update fifo as well as being placed on the fifo associated with the advertised attribute.

On actual creation of a packet. The first item in the bgp_synchronize->update fifo is popped. The bgp_advertise_attr pointer is grabbed, we fill out the nlri part of the bgp packet and then walk the bgp_advertise_attr fifo to place paths/dests in the packet. As each path/dest is placed in the packet it is removed from both the bgp_synchronize->update fifo and the bgp_advertise_attr fifo.

The whole point of this change is to switch the *next, *prev pointers in the bgp_advertise structure with a typesafe data structure.


This is an automatic backport of pull request #14554 done by Mergify.

BGP is storing outgoing updates in a couple of different
fifo's.  This is to ensure proper packet packing of
all bgp_dests that happen to use the same attribute.

How it's all put together currently:  On initial update
BGP walks through all the bgp_dest's in a table.  For each
path being sent a bgp_advertise is created.  This bgp_advertise
is placed in fifo order on the bgp_synchronize->update queue.
The bgp_advertise has a pointer to the bgp_advertise_attr which
is associated iwth the actual attribute that is being sent to
it's peer.  In turn this bgp_advertise is placed in a fifo off
of the bgp_advertise_attr structure.  As such as we have paths
that share an attribute, the path/dest is placed on the
bgp_syncrhonize->update fifo as well as being placed on the fifo
associated with the advertised attribute.

On actual creation of a packet.  The first item in the
bgp_synchronize->update fifo is popped.  The bgp_advertise_attr
pointer is grabbed, we fill out the nlri part of the bgp packet
and then walk the bgp_advertise_attr fifo to place paths/dests in
the packet.  As each path/dest is placed in the packet it is removed
from both the bgp_synchronize->update fifo and the bgp_advertise_attr
fifo.

The whole point of this change is to switch the *next, *prev
pointers in the bgp_advertise structure with a typesafe data
structure.

Signed-off-by: Donald Sharp <[email protected]>
(cherry picked from commit b2e0c12)
@frrbot frrbot bot added the bgp label Mar 26, 2024
@ton31337 ton31337 merged commit 13f8f5e into stable/9.1 Mar 27, 2024
12 checks passed
@ton31337 ton31337 deleted the mergify/bp/stable/9.1/pr-14554 branch March 27, 2024 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants