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

[fpmsyncd] Implement pending route suppression feature #2551

Merged
merged 29 commits into from
Mar 19, 2023

Conversation

stepanblyschak
Copy link
Contributor

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

Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
@@ -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);
Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

@stepanblyschak stepanblyschak Dec 19, 2022

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()))
Copy link
Contributor

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?

Copy link
Contributor Author

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 <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
This reverts commit b38772d.
@stepanblyschak stepanblyschak marked this pull request as draft January 16, 2023 14:28
… and later creation there might be an old name<->ifindex mapping entry

Signed-off-by: Stepan Blyschak <[email protected]>
@stepanblyschak stepanblyschak marked this pull request as ready for review February 16, 2023 10:34
@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny
Copy link
Collaborator

prsunny commented Feb 16, 2023

@StormLiangMS , could you help review?

@prsunny
Copy link
Collaborator

prsunny commented Feb 16, 2023

@stepanblyschak , can you please test for backward compatibility?

@stepanblyschak
Copy link
Contributor Author

@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 xfail because they require VS changes done in sonic-net/sonic-buildimage#12853. Otherwise, it is not possible to merge one without the other in order to not break tests or image.
Later this mark has to be removed once sonic-buildimage PR is merged.


if (len > m_bufSize)
{
SWSS_LOG_THROW("Message length %zu is greater then the send buffer size %d", len, m_bufSize);
Copy link
Contributor

Choose a reason for hiding this comment

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

wording issue, then -> than

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed

@StormLiangMS StormLiangMS requested a review from jcaiMR March 4, 2023 03:31
@StormLiangMS
Copy link
Contributor

@jcaiMR could you help to review?

NetDispatcher::getInstance().registerMessageHandler(RTM_NEWROUTE, &sync);
NetDispatcher::getInstance().registerMessageHandler(RTM_DELROUTE, &sync);
NetDispatcher::getInstance().registerMessageHandler(RTM_NEWLINK, &sync);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@prsunny
Copy link
Collaborator

prsunny commented Mar 13, 2023

@StormLiangMS , are we good to merge this? Can you please sign-off if no further comments?

Copy link
Contributor

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

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

LGTM

@StormLiangMS
Copy link
Contributor

@prsunny this looks good to me.

@StormLiangMS
Copy link
Contributor

StormLiangMS commented Mar 18, 2023

@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 StormLiangMS merged commit 840fe1d into sonic-net:master Mar 19, 2023
@stepanblyschak
Copy link
Contributor Author

@StormLiangMS @jcaiMR BGP suppress FIB pending test cases are already available in PRs - test plan + implementation:

liat-grozovik pushed a commit to sonic-net/sonic-utilities that referenced this pull request Jun 14, 2023
- 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 <[email protected]>
pdhruv-marvell pushed a commit to pdhruv-marvell/sonic-utilities that referenced this pull request Aug 23, 2023
…#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 <[email protected]>
stepanblyschak added a commit to stepanblyschak/sonic-swss that referenced this pull request Dec 19, 2023
stepanblyschak added a commit to stepanblyschak/sonic-swss that referenced this pull request Dec 20, 2023
yxieca added a commit that referenced this pull request Jan 25, 2024
* 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 <[email protected]>

---------

Signed-off-by: Stepan Blyschak <[email protected]>
Co-authored-by: Ying Xie <[email protected]>
stepanblyschak added a commit to stepanblyschak/sonic-swss that referenced this pull request May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants