]> git.proxmox.com Git - mirror_frr.git/commit
staticd: handle when condition check in nb callbacks
authorChirag Shah <chirag@nvidia.com>
Wed, 13 Jan 2021 17:02:32 +0000 (09:02 -0800)
committerChirag Shah <chirag@nvidia.com>
Wed, 13 Jan 2021 17:24:25 +0000 (09:24 -0800)
commit6dfc022ff2a16614541f801e8539c6f785eea1ff
treeccf1cdf8c72b15d489c20b6cf7a826c425a8c0bb
parentdc40d33703c99fd4587978e92cb9007e7215dda4
staticd: handle when condition check in nb callbacks

At present, libyang validate api takes longer time to complete
for a transaction to complete if the same config is re-applied.
For instance if set of static routes are reapplied the config
completion takes longer than it took initial time.

One of the solution is to remove when statement from staticd nexthop yang OM.
When condition adds peformance toll on libyang's validate api.
The same when condition checks are done in frr northbound
validation phase (which are must faster).

With this change, if the same static routes are configured
agian and again, the time to completion does not go up and
perfomance does not degrade.

Ticket:CM-32530
Testing Done:

Configure 400 static routes across two vrfs and keep re-applying them.
The time to complete the config remains in few seconds.

Before:
root@bharat:~/stash/frr4# time vtysh -f static_route_cfg

real    0m19.877s
user    0m0.263s
sys 0m0.014s

After:
root@bharat:~/stash/frr4# time vtysh -f static_route_cfg

real    0m3.857s
user    0m0.239s
sys 0m0.034s

Co-developed-by: VishalDhingra <vdhingra@vmware.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
staticd/static_nb.c
staticd/static_nb.h
staticd/static_nb_config.c