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 #14554

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

donaldsharp
Copy link
Member

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.

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]>
Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ton31337 ton31337 merged commit aeede09 into FRRouting:master Oct 11, 2023
@mjstapp
Copy link
Contributor

mjstapp commented Mar 26, 2024

@Mergifyio backport stable/9.0 stable/9.1

@mjstapp mjstapp mentioned this pull request Mar 26, 2024
2 tasks
Copy link

mergify bot commented Mar 26, 2024

backport stable/9.0 stable/9.1

✅ Backports have been created

ton31337 added a commit that referenced this pull request Mar 27, 2024
bgpd: Convert the bgp_advertise_attr->adv to a fifo (backport #14554)
mjstapp added a commit that referenced this pull request Mar 27, 2024
bgpd: Convert the bgp_advertise_attr->adv to a fifo (backport #14554)
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.

3 participants