-
Notifications
You must be signed in to change notification settings - Fork 543
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
[fpmsyncd] Implement pending route suppression feature #2551
Conversation
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
fpmsyncd/routesync.cpp
Outdated
@@ -788,6 +831,8 @@ void RouteSync::onLabelRouteMsg(int nlmsg_type, struct nl_object *obj) | |||
struct nl_addr *daddr; | |||
char destaddr[MAX_ADDR_SIZE + 1] = {0}; | |||
|
|||
sendOffloadReply(route_obj); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope you have a test case to test this MPLS label route.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't add additional flows for MPLS route handling. So it should be covered by existing MPLS route tests.
// If field "protocol" is present in the field values then | ||
// it is a SET operation. This field is absent only if we are | ||
// processing DEL operation. | ||
isSetOperation = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont we get Del operation in the event? why should we assume this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we get a response for a delete operation we don't get original FVs. We use this knowledge to filter out DEL events we are not interested in.
ResponsePublisher for reference: https://github.com/sonic-net/sonic-swss/blob/master/orchagent/response_publisher.cpp#L106
// Mark route as OFFLOAD | ||
rtnl_route_set_flags(routeObject.get(), flags); | ||
|
||
if (!sendOffloadReply(routeObject.get())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When there are multiple route updates for the given route, how do we make sure that the response to sent for the right route-update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constructed RTM_NEWROUTE message contains prefix + vrf + protocol of the route
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
This reverts commit b38772d.
… and later creation there might be an old name<->ifindex mapping entry Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
@StormLiangMS , could you help review? |
@stepanblyschak , can you please test for backward compatibility? |
@prsunny It can be merged without sonic-net/sonic-buildimage#12853. BGP facts and FIB test passed on T1-64-LAG with this change. Please note, that I had to mark VS tests with |
fpmsyncd/fpmlink.cpp
Outdated
|
||
if (len > m_bufSize) | ||
{ | ||
SWSS_LOG_THROW("Message length %zu is greater then the send buffer size %d", len, m_bufSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wording issue, then -> than
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed
@jcaiMR could you help to review? |
NetDispatcher::getInstance().registerMessageHandler(RTM_NEWROUTE, &sync); | ||
NetDispatcher::getInstance().registerMessageHandler(RTM_DELROUTE, &sync); | ||
NetDispatcher::getInstance().registerMessageHandler(RTM_NEWLINK, &sync); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stepanblyschak what's the usage for RTM_NETLINK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I listen for newlink/dellink events to refill link cache - https://github.com/sonic-net/sonic-swss/pull/2551/files#diff-0555c0a4f1e207c410ac8ab7d4a44f48a0925da2ed14c57499a4e9175223be57R607.
E.g, we need link cache to map VRF linux interface name to VRF if_index to pass to FRR. In case VRF linux interface is removed and then re-created with the same name the link cache will have an invalid entry. So I refill the cache on newlink/dellink events.
…led -> disabled Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
@StormLiangMS , are we good to merge this? Can you please sign-off if no further comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@prsunny this looks good to me. |
@stepanblyschak could you also have the testcase in sonic-mgmt to cover this FIB suppress feature? and pls involve Jcai and me for the code review. |
@StormLiangMS @jcaiMR BGP suppress FIB pending test cases are already available in PRs - test plan + implementation: |
- What I did I added requires "protocol" field due to fpmsyncd reconcile logic (WarmRestartHelper class) requires old fvs keys to match new fvs. - How I did it Add "protocol" field in db migration. - How to verify it Upgrade from older branch to new image with supported FIB pending. The field was added by sonic-net/sonic-swss#2551. Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
…#2766) - What I did I added requires "protocol" field due to fpmsyncd reconcile logic (WarmRestartHelper class) requires old fvs keys to match new fvs. - How I did it Add "protocol" field in db migration. - How to verify it Upgrade from older branch to new image with supported FIB pending. The field was added by sonic-net/sonic-swss#2551. Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
…-net#2551)" This reverts commit 840fe1d.
…-net#2551)" This reverts commit 840fe1d.
* Revert "[RouteOrch] Record ROUTE_TABLE entry programming status to APPL_STATE_DB (#2512)" This reverts commit 35385ad. * Revert "[fpmsyncd] Implement pending route suppression feature (#2551)" This reverts commit 840fe1d. * Get back gMockResponsePublisher as it is used by other tests Signed-off-by: Stepan Blyschak <stepanb@nvidia.com> --------- Signed-off-by: Stepan Blyschak <stepanb@nvidia.com> Co-authored-by: Ying Xie <yxieca@users.noreply.github.com>
…-net#2551)" This reverts commit 840fe1d.
DEPENDS: #2512
What I did
I implemented support to enable pending routes suppression feature. When this feature is enabled, fpmsyncd will wait for reply from orchagent before sending offload status message to zebra.
Why I did it
This is done to not announce routes which aren't yet offloaded in HW.
How I verified it
UT and manual tests.
Details if related