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

bgp attribute cleaning misc #12890

Merged
merged 3 commits into from
Mar 7, 2023
Merged

Conversation

pguibert6WIND
Copy link
Member

some misc cleaning related withBGP attr structure

The attr pointer has been interned during the process of the
function, but has to be uninterned at the end.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
As remind, the attr attribute is a structure that contains
the attributes for a given BGP update. In order to avoid too much
memory consumption, the attr structure is stored in a hash table.
As consequence, other BGP updates may reuse the same attr. The
storage in the hash table is done when calling bgp_attr_intern(),
and a key is calculated based on all the attributes values of the
structure.

In BGP EVPN, when modifying the attributes of the attr structure
after having interned it, this means that some BGP updates will
want to use the old reference, whereas a new attr value is used.
Because in BGP EVPN, the modifications are done on a per BGP update
basis, a new attr entry specific to that BGP update should be created.
This is why a local_attr structure is done, modified, then later
interned.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Now that an additional attribute has been added, clang
format has to be applied.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-9882/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

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

@chiragshah6
Copy link
Member

@pguibert6WIND regarding bgpd: attr evpn attributes should be modified before interning attr commit, do you observe any issue with BGP EVPN update in absence of this fix?
After going through change, I do not see any significant change, I could be wrong but bgp_attr_intern will return same attr pointer which is passed in as input parameters so in this case mobility sequence (mm_seqnum) value updated on attr_new vs. local_attr would be same if local_pi->attr is present
In evpn deployment I see MM sequence correct updated in bgp path attributes and reflected in evpn rib.

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

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

looks good

@riw777 riw777 merged commit e1ee742 into FRRouting:master Mar 7, 2023
@donaldsharp
Copy link
Member

Did Phillippe ever respond to Chirag's question? Was this ready?

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.

6 participants