]> git.proxmox.com Git - mirror_frr.git/commit - lib/if.c
lib: rework management of user pointers in the northbound layer
authorRenato Westphal <renato@opensourcerouting.org>
Thu, 18 Apr 2019 14:55:52 +0000 (11:55 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Thu, 18 Apr 2019 14:56:45 +0000 (11:56 -0300)
commitccd43ada1791793602cbdff3973fae3ca692e6bf
tree16b3e19d28fb4d04178229cf861e1e7fccf618f9
parent3c7940063b40250354cccc6b582a81d10a5a4261
lib: rework management of user pointers in the northbound layer

Introduce a hash table to keep track of user pointers associated
to configuration entries. The previous strategy was to embed
the user pointers inside libyang data nodes, but this solution
incurred a substantial performance overhead. The user pointers
embedded in candidate configurations could be lost while the
configuration was being edited, so they needed to be regenerated
before the candidate could be committed.  This was done by the
nb_candidate_restore_priv_pointers() function, which was extremely
expensive for large configurations. The new hash table solves this
performance problem.

The yang_dnode_[gs]et_entry() functions were renamed and moved from
yang.[ch] to northbound.[ch], which is a more appropriate place
for them. This patch also introduces the nb_running_unset_entry()
function, the counterpart of nb_running_set_entry() (unsetting
user pointers was done automatically before, now it needs to be
done manually).

As a consequence of these changes, we shouldn't need support for
libyang private pointers anymore (-DENABLE_LYD_PRIV=ON). But it's
probably a good idea to keep requiring this feature as we might
need it in the future for other things (e.g. disable configuration
settings without removing them).

Fixes #4136.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
isisd/isis_cli.c
isisd/isis_northbound.c
lib/if.c
lib/northbound.c
lib/northbound.h
lib/yang.c
lib/yang.h
ripd/rip_northbound.c
ripngd/ripng_northbound.c