Repository navigation
[Nexthop][misc] Move request routes through the RIB and free them early - #1907
Draft
deepakgudiseva-nexthop wants to merge 1 commit into
Draft
deepakgudiseva-nexthop wants to merge 1 commit into
deepakgudiseva-nexthop wants to merge 1 commit into
Conversation
addUnicastRoutes and syncFib hold every requested route twice until the hardware update returns: the thrift request and the RIB's converted copy, and RibRouteTables::update copies the converted routes once more to resolve named next-hop groups. At high ECMP width each route carries a large next-hop list, so a full-table sync or a large replace peaks at several copies of the table. Move the request routes into RouteUpdateWrapper, free each thrift route once the RIB has converted it, resolve named next-hop groups in place on the owned vector, and free that vector before updateFib, where the push to the hardware peaks.
Author
|
Setup: 128-way ECMP, 22k routes (~2.8M paths), with fboss_sw_agent memory, GiB:
Together the two PRs cut sw_agent's peak during route updates by about 3.6 GiB (~60%). Steady state stays the same. |
2 tasks done
Author
|
/autorebase |
This branch has not been deployed
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.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
addUnicastRoutesandsyncFibhold every requested route twice until the hardware update returns: the thrift request and the RIB's converted copy.RibRouteTables::updatethen copies the converted routes once more to resolve named next-hop groups. At high ECMP width each route carries a large next-hop list, so a full-table sync or a large replace peaks at several copies of the table in sw_agent.This moves the request routes into
RouteUpdateWrapper, frees each thrift route once the RIB has converted it, resolves named next-hop groups in place on the owned vector, and frees that vector beforeupdateFib, where the push to the hardware peaks. Existing callers are unchanged: the newaddRouteandRoutingInformationBase::updateoverloads take rvalues, andRibRouteTables::updatetakes its routes by value.Independent of #1906 (no shared files).
Test Plan
resolvedRoutesline now sits inRibRouteTables::update's updated lambda.pre-commit run(clang-format 21.1.2) clean on the modified files.