]> git.proxmox.com Git - mirror_frr.git/commit - bgpd/bgp_packet.c
bgpd: Don't lookup paf structure get straight to the point
authorDonald Sharp <sharpd@nvidia.com>
Sun, 26 Sep 2021 23:36:03 +0000 (19:36 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 27 Sep 2021 00:17:40 +0000 (20:17 -0400)
commit0e5cdd59eb0f080c4c82b5b54597b16a94775732
treeebd356e66b20c9a39c20e66cc78df4df5552f9a7
parent83caa5e5c1e05062977bdd77ede06d63d03c1ddf
bgpd: Don't lookup paf structure get straight to the point

The paf data structure is stored based upon an internal
bgp enum.  The code is looking over all AFI/SAFI's and
doing a paf_af_find which then calls afindex to find
the right paf structure.  Let's just loop over the
peer->peer_af_array[] and cut straight to the chase.
Under some loads the paf_af_find was taking up 6%
of the run time.  This removes it entirely.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_packet.c
bgpd/bgp_vty.c