]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: bgp_path_info_extra memory optimization
authorValerian_He <1826906282@qq.com>
Tue, 8 Aug 2023 10:47:29 +0000 (10:47 +0000)
committerValerian_He <1826906282@qq.com>
Tue, 8 Aug 2023 10:48:07 +0000 (10:48 +0000)
commit98efa5bc6bac9e3917afe2fa206ec795ddf86b87
treebec88bbb7b364d234860c17efe23aa73776bce69
parent49f04841131b917ac6218ecba933af36f51a7f91
bgpd: bgp_path_info_extra memory optimization

Even if some of the attributes in bgp_path_info_extra are
not used, their memory is still allocated every time. It
cause a waste of memory.
This commit code deletes all unnecessary attributes and
changes the optional attributes to pointer storage. Memory
will only be allocated when they are actually used. After
optimization, extra info related memory is reduced by about
half(~400B -> ~200B).

Signed-off-by: Valerian_He <1826906282@qq.com>
19 files changed:
bgpd/bgp_evpn.c
bgpd/bgp_evpn.h
bgpd/bgp_evpn_mh.c
bgpd/bgp_evpn_private.h
bgpd/bgp_flowspec_vty.c
bgpd/bgp_memory.c
bgpd/bgp_memory.h
bgpd/bgp_mpath.c
bgpd/bgp_mplsvpn.c
bgpd/bgp_mplsvpn.h
bgpd/bgp_nht.c
bgpd/bgp_pbr.c
bgpd/bgp_route.c
bgpd/bgp_route.h
bgpd/bgp_routemap.c
bgpd/bgp_vty.c
bgpd/bgp_zebra.c
bgpd/bgp_zebra.h
bgpd/rfapi/rfapi_vty.c