-
Notifications
You must be signed in to change notification settings - Fork 558
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
VNET and BGP route coexistence #3345
VNET and BGP route coexistence #3345
Conversation
Can you fix coverage? |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
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, minor comment. please fix as a different PR
@@ -2639,6 +2639,51 @@ bool RouteOrch::removeRoutePost(const RouteBulkContext& ctx) | |||
return true; | |||
} | |||
|
|||
bool RouteOrch::hasBgpRoute(const IpPrefix& prefix) |
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.
Please rename to isRouteExists
. bgp is not applicable in orchagent.
What I did This PR adds the logic to give Vnet routes precedence over BGP learnt route. This PR also refactors the test_vnet.py to break out the common code into a library. Why I did it Currently if a route is learnt via BGP and added into the hardware, adding a VNET route results in failure. In addition due to a bug in VnetOrch, we start advertising the failed route, This prompts the BGP to remove the learnt route in favor of the local route. Since the Vnet Orch doesn't retry adding the Vnet route, This results in no route being present in the Hardware.
What I did This PR adds the logic to give Vnet routes precedence over BGP learnt route. This PR also refactors the test_vnet.py to break out the common code into a library. Why I did it Currently if a route is learnt via BGP and added into the hardware, adding a VNET route results in failure. In addition due to a bug in VnetOrch, we start advertising the failed route, This prompts the BGP to remove the learnt route in favor of the local route. Since the Vnet Orch doesn't retry adding the Vnet route, This results in no route being present in the Hardware.
What I did This PR adds the logic to give Vnet routes precedence over BGP learnt route. This PR also refactors the test_vnet.py to break out the common code into a library. Why I did it Currently if a route is learnt via BGP and added into the hardware, adding a VNET route results in failure. In addition due to a bug in VnetOrch, we start advertising the failed route, This prompts the BGP to remove the learnt route in favor of the local route. Since the Vnet Orch doesn't retry adding the Vnet route, This results in no route being present in the Hardware.
What I did This PR adds the logic to give Vnet routes precedence over BGP learnt route. This PR also refactors the test_vnet.py to break out the common code into a library. Why I did it Currently if a route is learnt via BGP and added into the hardware, adding a VNET route results in failure. In addition due to a bug in VnetOrch, we start advertising the failed route, This prompts the BGP to remove the learnt route in favor of the local route. Since the Vnet Orch doesn't retry adding the Vnet route, This results in no route being present in the Hardware.
What is the motivation for this PR? Currently if a route is learnt via BGP and added into the hardware, adding a VNET route results in failure. In addition due to a bug in VnetOrch, we start advertising the failed route, This prompts the BGP to remove the learnt route in favor of the local route. Since the Vnet Orch doesn't retry adding the Vnet route, This results in no route being present in the Hardware. How I verified it The fix is in PR sonic-net/sonic-swss#3345 These tests cover various scenario in which VNET and BGP routes are added and removed in different order How did you do it? How did you verify/test it? Any platform specific information? Cisco-8000 and mlnx. Supported testbed topology if it's a new test case? Documentation There are 5 differnet scenarios which are checked. Each scenario is tested with with the following options. Encap types [v4_inv4, v6_inV4] Monitor Type [BFD, Custom] Init NH state( BFD/monitor sessions for nexthops are initially up or not.) test_vnet_route_after_bgp ADD BGP ROUTE on TOR Add VNET route Configure monitor (BFD or custom) with nexthop state (UP) Test with traffic Remove VNET route Remove BGP route test_vnet_route_before_bgp_after_ep_up Add VNET route Configure monitor (BFD or custom) with nexthop state (UP) Add BGP ROUTE on TOR Test with traffic Remove VNET ROUTE Remove BGP route test_vnet_route_bgp_removal_before_ep ADD BGP ROUTE on TOR Add VNET route Remove BGP route Configure monitor (BFD or custom) with nexthop state (UP) Test with traffic Remove VNET route test_vnet_route_after_bgp_with_early_bgp_removal Add VNET route Add BGP ROUTE on TOR Configure monitor (BFD or custom) with nexthop state (UP) Test with traffic Remove BGP route Test with traffic Remove VNET route test_vnet_route_after_bgp_multi_flap ADD BGP ROUTE on TOR Add VNET route Configure monitor (BFD or custom) with nexthop state (UP) Test with traffic flap the bfd/monitor sessions. Test with traffic Remove VNET route Remove BGP route
What I did This PR adds the logic to give Vnet routes precedence over BGP learnt route. This PR also refactors the test_vnet.py to break out the common code into a library. Why I did it Currently if a route is learnt via BGP and added into the hardware, adding a VNET route results in failure. In addition due to a bug in VnetOrch, we start advertising the failed route, This prompts the BGP to remove the learnt route in favor of the local route. Since the Vnet Orch doesn't retry adding the Vnet route, This results in no route being present in the Hardware.
What I did This PR adds the logic to give Vnet routes precedence over BGP learnt route. This PR also refactors the test_vnet.py to break out the common code into a library. Why I did it Currently if a route is learnt via BGP and added into the hardware, adding a VNET route results in failure. In addition due to a bug in VnetOrch, we start advertising the failed route, This prompts the BGP to remove the learnt route in favor of the local route. Since the Vnet Orch doesn't retry adding the Vnet route, This results in no route being present in the Hardware.
What I did
This PR adds the logic to give Vnet routes precedence over BGP learnt route.
This PR also refactors the test_vnet.py to break out the common code into a library.
Why I did it
Currently if a route is learnt via BGP and added into the hardware, adding a VNET route results in failure. In addition due to a bug in VnetOrch, we start advertising the failed route, This prompts the BGP to remove the learnt route in favor of the local route. Since the Vnet Orch doesn't retry adding the Vnet route, This results in no route being present in the Hardware.
How I verified it
Added 2 tests to verify the learnt route is removed when a Vnet route is added.
One test covers the scnerio where BFD sessions are brought up before the Vnet route is added and the 2nd covers when the Vnet route is added before the BFD sessions are brought up.
Details if related
Tests covering this chage.
sonic-net/sonic-mgmt#15710