mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-10 10:49:01 +00:00
bgpd: Optimize the path for suppressed announcements
If supress-duplicates is turned of (which is turned on by default), do not calculate attribute hash key, that consumes CPU quite a lot. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
parent
0b1af4c918
commit
59571fd14b
@ -532,7 +532,7 @@ bool bgp_adj_out_set_subgroup(struct bgp_dest *dest,
|
|||||||
struct peer *adv_peer;
|
struct peer *adv_peer;
|
||||||
struct peer_af *paf;
|
struct peer_af *paf;
|
||||||
struct bgp *bgp;
|
struct bgp *bgp;
|
||||||
uint32_t attr_hash = attrhash_key_make(attr);
|
uint32_t attr_hash = 0;
|
||||||
|
|
||||||
peer = SUBGRP_PEER(subgrp);
|
peer = SUBGRP_PEER(subgrp);
|
||||||
afi = SUBGRP_AFI(subgrp);
|
afi = SUBGRP_AFI(subgrp);
|
||||||
@ -567,9 +567,11 @@ bool bgp_adj_out_set_subgroup(struct bgp_dest *dest,
|
|||||||
* the route wasn't changed actually.
|
* the route wasn't changed actually.
|
||||||
* Do not suppress BGP UPDATES for route-refresh.
|
* Do not suppress BGP UPDATES for route-refresh.
|
||||||
*/
|
*/
|
||||||
if (CHECK_FLAG(bgp->flags, BGP_FLAG_SUPPRESS_DUPLICATES)
|
if (likely(CHECK_FLAG(bgp->flags, BGP_FLAG_SUPPRESS_DUPLICATES)))
|
||||||
&& !CHECK_FLAG(subgrp->sflags, SUBGRP_STATUS_FORCE_UPDATES)
|
attr_hash = attrhash_key_make(attr);
|
||||||
&& adj->attr_hash == attr_hash) {
|
|
||||||
|
if (!CHECK_FLAG(subgrp->sflags, SUBGRP_STATUS_FORCE_UPDATES) &&
|
||||||
|
attr_hash && adj->attr_hash == attr_hash) {
|
||||||
if (BGP_DEBUG(update, UPDATE_OUT)) {
|
if (BGP_DEBUG(update, UPDATE_OUT)) {
|
||||||
char attr_str[BUFSIZ] = {0};
|
char attr_str[BUFSIZ] = {0};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user