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

Cache routes for single nexthop for faster retrieval #1922

Merged
merged 8 commits into from
Sep 27, 2021

Conversation

prsunny
Copy link
Collaborator

@prsunny prsunny commented Sep 22, 2021

What I did
Created a map to store single nexthop routes. This is for faster retrieval when you've to fetch the routes for a particular nexthop. No changes to ECMP route handling.

This is an optimization and the existing VS test covers the code for add flow. Set flow is covered with new test case.

Why I did it
Faster retrieval of route when a particular nexthop state changes. This avoid looping through all the routes to find a matching nexthop.

How I verified it
Tested on DUT:

Sep 21 18:05:46.996655 NOTICE swss#orchagent: :- setState: [Ethernet4] Set MUX state from active to standby
Sep 21 18:05:46.996748 INFO swss#orchagent: :- stateStandby: Set state to Standby for Ethernet4
Sep 21 18:05:46.996798 INFO swss#orchagent: :- disable: Disabling neigh 192.168.0.10 on Vlan1000
Sep 21 18:05:46.996847 INFO swss#orchagent: :- updateNextHopRoutes: Updating route 32.1.1.1/32
Sep 21 18:05:46.998418 NOTICE swss#orchagent: :- disableNeighbor: Neighbor disable request for 192.168.0.10 
Sep 21 18:05:46.999408 NOTICE swss#orchagent: :- removeNeighbor: Removed next hop 192.168.0.10 on Vlan1000
Sep 21 18:05:47.000661 NOTICE swss#orchagent: :- removeNeighbor: Removed neighbor 00:00:11:22:33:44 on Vlan1000
Sep 21 18:05:47.000661 INFO swss#orchagent: :- addTunnelRoute: Add tunnel route DB 'Vlan1000:192.168.0.10/32'
Sep 21 18:05:47.003652 NOTICE swss#orchagent: :- create_route: Created tunnel route to 192.168.0.10/32 
Sep 21 18:05:47.003652 NOTICE swss#orchagent: :- MuxAclHandler: Binding port 1000000000003
Sep 21 18:05:47.003652 INFO swss#orchagent: :- getAclRule: Rule mux_acl_rule doesn't exist
Sep 21 18:05:47.003652 INFO swss#orchagent: :- create: Created counter for the rule mux_acl_rule in table IngressTableDrop
Sep 21 18:05:47.006407 NOTICE swss#orchagent: :- add: Successfully created ACL rule mux_acl_rule in table IngressTableDrop
Sep 21 18:05:47.007733 INFO swss#orchagent: :- setState: Changed state to standby
Sep 21 18:05:47.007960 NOTICE swss#orchagent: :- addOperation: Mux State set to standby for port Ethernet4

Details if related

@prsunny
Copy link
Collaborator Author

prsunny commented Sep 22, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

orchagent/routeorch.cpp Outdated Show resolved Hide resolved
orchagent/routeorch.cpp Show resolved Hide resolved
orchagent/routeorch.cpp Outdated Show resolved Hide resolved
@prsunny
Copy link
Collaborator Author

prsunny commented Sep 22, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

shi-su
shi-su previously approved these changes Sep 22, 2021
shi-su
shi-su previously approved these changes Sep 24, 2021
@prsunny prsunny merged commit f1aca8a into sonic-net:master Sep 27, 2021
@prsunny prsunny deleted the rcache branch September 27, 2021 15:12
raphaelt-nvidia pushed a commit to raphaelt-nvidia/sonic-swss that referenced this pull request Oct 5, 2021
* Created a map to store single nexthop routes. This is for faster retrieval when you've to fetch the routes for a particular nexthop. No changes to ECMP route handling.
vaibhavhd added a commit to sonic-net/sonic-buildimage that referenced this pull request Oct 9, 2021
[Submodule advance sonic-swss]
Include below commits to master image:

Cache routes for single nexthop for faster retrieval sonic-net/sonic-swss#1922
Reduce route count for route perf test (sonic-net/sonic-swss#1928)
[pytest]: Re-use DVS container when possible (sonic-net/sonic-swss#1816)
[PORTSYNCD] when no ports on config db on init, continue and set Port… (sonic-net/sonic-swss#1861)
[gearbox] Add gearbox unit test (sonic-net/sonic-swss#1920)
Reverted skipped test_buffer_dynamic test cases (sonic-net/sonic-swss#1937)
Revert "[buffer orch] Bugfix: Don't query counter SAI_BUFFER_POOL_STA… (sonic-net/sonic-swss#1945)
judyjoseph pushed a commit that referenced this pull request Oct 11, 2021
* Created a map to store single nexthop routes. This is for faster retrieval when you've to fetch the routes for a particular nexthop. No changes to ECMP route handling.
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
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.

4 participants