Skip to content

Commit

Permalink
Merge "Support large number of routing instances"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jun 25, 2016
2 parents 5930dda + f43128c commit 044581b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
9 changes: 3 additions & 6 deletions src/bgp/bgp_server.cc
Expand Up @@ -554,12 +554,9 @@ uint32_t BgpServer::num_down_static_routes() const {
}

void BgpServer::VisitBgpPeers(BgpServer::VisitorFn fn) const {
for (RoutingInstanceMgr::RoutingInstanceIterator rit = inst_mgr_->begin();
rit != inst_mgr_->end(); ++rit) {
BgpPeerKey key = BgpPeerKey();
while (BgpPeer *peer = rit->peer_manager()->NextPeer(key)) {
fn(peer);
}
for (BgpPeerList::const_iterator loc = peer_list_.begin();
loc != peer_list_.end(); ++loc) {
fn(loc->second);
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/bgp/bgp_show_neighbor.cc
Expand Up @@ -132,7 +132,7 @@ void BgpNeighborReq::HandleRequest() const {
RequestPipeline::StageSpec s1;
TaskScheduler *scheduler = TaskScheduler::GetInstance();

s1.taskId_ = scheduler->GetTaskId("bgp::PeerMembership");
s1.taskId_ = scheduler->GetTaskId("bgp::ShowCommand");
s1.cbFn_ = boost::bind(&BgpShowHandler<
BgpNeighborReq,
BgpNeighborReqIterate,
Expand All @@ -156,7 +156,7 @@ void BgpNeighborReqIterate::HandleRequest() const {
RequestPipeline::StageSpec s1;
TaskScheduler *scheduler = TaskScheduler::GetInstance();

s1.taskId_ = scheduler->GetTaskId("bgp::PeerMembership");
s1.taskId_ = scheduler->GetTaskId("bgp::ShowCommand");
s1.cbFn_ = boost::bind(&BgpShowHandler<
BgpNeighborReq,
BgpNeighborReqIterate,
Expand All @@ -180,7 +180,7 @@ void ShowBgpNeighborSummaryReq::HandleRequest() const {
RequestPipeline::StageSpec s1;
TaskScheduler *scheduler = TaskScheduler::GetInstance();

s1.taskId_ = scheduler->GetTaskId("bgp::PeerMembership");
s1.taskId_ = scheduler->GetTaskId("bgp::ShowCommand");
s1.cbFn_ = boost::bind(&BgpShowHandler<
ShowBgpNeighborSummaryReq,
ShowBgpNeighborSummaryReqIterate,
Expand All @@ -204,7 +204,7 @@ void ShowBgpNeighborSummaryReqIterate::HandleRequest() const {
RequestPipeline::StageSpec s1;
TaskScheduler *scheduler = TaskScheduler::GetInstance();

s1.taskId_ = scheduler->GetTaskId("bgp::PeerMembership");
s1.taskId_ = scheduler->GetTaskId("bgp::ShowCommand");
s1.cbFn_ = boost::bind(&BgpShowHandler<
ShowBgpNeighborSummaryReq,
ShowBgpNeighborSummaryReqIterate,
Expand Down
2 changes: 1 addition & 1 deletion src/bgp/scheduling_group.cc
Expand Up @@ -509,7 +509,7 @@ bool SchedulingGroup::empty() const {
// Return true if the IPeer is in sync.
//
bool SchedulingGroup::PeerInSync(IPeerUpdate *peer) const {
CHECK_CONCURRENCY("bgp::PeerMembership");
CHECK_CONCURRENCY("bgp::PeerMembership", "bgp::ShowCommand");

PeerState *ps = peer_state_imap_.Find(peer);
return (ps) ? ps->in_sync() : false;
Expand Down

0 comments on commit 044581b

Please sign in to comment.