diff options
author | Louis Scalbert <louis.scalbert@6wind.com> | 2020-11-04 15:35:47 +0100 |
---|---|---|
committer | Louis Scalbert <louis.scalbert@6wind.com> | 2021-06-07 10:33:31 +0200 |
commit | 46aeabedaf90c063ba06ee7c096f47428cb7ebb3 (patch) | |
tree | aa7dc0b85a75b140f398ca162be2192774314fe8 /bgpd/bgp_table.h | |
parent | Merge pull request #8783 from idryzhov/doc-varname (diff) | |
download | frr-46aeabedaf90c063ba06ee7c096f47428cb7ebb3.tar.xz frr-46aeabedaf90c063ba06ee7c096f47428cb7ebb3.zip |
bgpd: split soft reconfigure table task into several jobs to not block vtysh
BGP configuration changes that imply recomputing the BGP route table
(e.g. modifying route-maps, setting bgp graceful-shutdown) might be a
long time process depending on the size of the BGP table and the
route-map numbers and complexity. For example, setups with full
Internet routes take something like one minute to reprocess all the
prefixes when graceful-shutdown is configured. During this time, a
"show bgp commands" request on vtysh results in blocking the shell until
the soft reconfigure table task is over.
This patch splits bgp_soft_reconfig_table task into thread jobs of 25K
prefixes.
Some tests on a full Internet route setup show that after reconfiguring
route-maps or graceful-shutdown, vtysh is not stucked anymore. We are
now able to request commands like "show bgp summary" after 1 or 2
seconds instead of 30 to 60s.
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'bgpd/bgp_table.h')
-rw-r--r-- | bgpd/bgp_table.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bgpd/bgp_table.h b/bgpd/bgp_table.h index 68b460149..fb906aa1f 100644 --- a/bgpd/bgp_table.h +++ b/bgpd/bgp_table.h @@ -42,6 +42,13 @@ struct bgp_table { int lock; + /* soft_reconfig_table in progress */ + bool soft_reconfig_init; + struct thread *soft_reconfig_thread; + + /* list of peers on which soft_reconfig_table has to run */ + struct list *soft_reconfig_peers; + struct route_table *route_table; uint64_t version; }; @@ -96,7 +103,7 @@ struct bgp_node { mpls_label_t local_label; - uint8_t flags; + uint16_t flags; #define BGP_NODE_PROCESS_SCHEDULED (1 << 0) #define BGP_NODE_USER_CLEAR (1 << 1) #define BGP_NODE_LABEL_CHANGED (1 << 2) @@ -105,6 +112,7 @@ struct bgp_node { #define BGP_NODE_FIB_INSTALL_PENDING (1 << 5) #define BGP_NODE_FIB_INSTALLED (1 << 6) #define BGP_NODE_LABEL_REQUESTED (1 << 7) +#define BGP_NODE_SOFT_RECONFIG (1 << 8) struct bgp_addpath_node_data tx_addpath; |