diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-11-18 13:44:14 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-11-18 14:00:51 +0900 |
commit | e11b09d7eae851d777a06ee18fde7865a361f5bb (patch) | |
tree | f33fd973aadabd3cb6ead949f0c8e3fadb481c20 /server/server.go | |
parent | 93d1dca70aa0ae3b34050d24ad7462b8757213bf (diff) |
server: disable advertised number calculation with multiple neighbors
AdjRibOut isn't in memory so needs to be calculated on the fly.
Doing such for multiple neighbors consumes too much CPU (especially
there are lots of routes).
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/server.go')
-rw-r--r-- | server/server.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/server.go b/server/server.go index aaa69e7d..d18cf641 100644 --- a/server/server.go +++ b/server/server.go @@ -1618,7 +1618,7 @@ func (s *BgpServer) GetServer() (c *config.Global) { return c } -func (s *BgpServer) GetNeighbor() (l []*config.Neighbor) { +func (s *BgpServer) GetNeighbor(getAdvertised bool) (l []*config.Neighbor) { ch := make(chan struct{}) defer func() { <-ch }() @@ -1627,7 +1627,7 @@ func (s *BgpServer) GetNeighbor() (l []*config.Neighbor) { l = make([]*config.Neighbor, 0, len(s.neighborMap)) for _, peer := range s.neighborMap { - l = append(l, peer.ToConfig()) + l = append(l, peer.ToConfig(getAdvertised)) } } return l @@ -2511,7 +2511,7 @@ func (w *Watcher) Generate(t WatchEventType) (err error) { }() l := make([]*config.Neighbor, 0, len(w.s.neighborMap)) for _, peer := range w.s.neighborMap { - l = append(l, peer.ToConfig()) + l = append(l, peer.ToConfig(false)) } w.notify(&WatchEventTable{PathList: pathList, Neighbor: l}) default: |