Skip to content

Commit

Permalink
Make sm_policy symmetric
Browse files Browse the repository at this point in the history
Change-Id: I2287a0178ae339bde026d297b3dd6692bc1f23c9
Partial-Bug: 1602347
  • Loading branch information
Nischal Sheth committed Jul 12, 2016
1 parent 7544a0f commit 25182da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
7 changes: 0 additions & 7 deletions src/bgp/routing-instance/rtarget_group_mgr.cc
Expand Up @@ -21,8 +21,6 @@

using std::pair;

int RTargetGroupMgr::rtfilter_task_id_ = -1;

void VpnRouteState::AddRouteTarget(RTargetGroupMgr *mgr, int part_id,
BgpRoute *rt, RTargetList::const_iterator it) {
pair<RTargetList::iterator, bool> result;
Expand Down Expand Up @@ -65,11 +63,6 @@ RTargetGroupMgr::RTargetGroupMgr(BgpServer *server) : server_(server),
TaskScheduler::GetInstance()->GetTaskId("bgp::RTFilter"), 0)),
rtarget_trigger_lists_(DB::PartitionCount()),
master_instance_delete_ref_(this, NULL) {
if (rtfilter_task_id_ == -1) {
TaskScheduler *scheduler = TaskScheduler::GetInstance();
rtfilter_task_id_ = scheduler->GetTaskId("bgp::RTFilter");
}

for (int i = 0; i < DB::PartitionCount(); i++) {
rtarget_dep_triggers_.push_back(boost::shared_ptr<TaskTrigger>(new
TaskTrigger(boost::bind(&RTargetGroupMgr::ProcessRouteTargetList,
Expand Down
2 changes: 0 additions & 2 deletions src/bgp/routing-instance/rtarget_group_mgr.h
Expand Up @@ -236,8 +236,6 @@ class RTargetGroupMgr {
}

private:
static int rtfilter_task_id_;

friend class BgpXmppRTargetTest;
friend class ReplicationTest;

Expand Down
6 changes: 4 additions & 2 deletions src/control-node/control_node.cc
Expand Up @@ -69,7 +69,10 @@ void ControlNode::SetDefaultSchedulingPolicy() {
// Policy for bgp::StateMachine and xmpp::StateMachine Tasks.
// Add policy to provision exclusion between io::Reader and
// bgp/xmpp StateMachine tasks with the same task instance.
TaskPolicy sm_policy;
TaskPolicy sm_policy = boost::assign::list_of
(TaskExclusion(scheduler->GetTaskId("bgp::Config")))
(TaskExclusion(scheduler->GetTaskId("bgp::PeerMembership")))
(TaskExclusion(scheduler->GetTaskId("bgp::RTFilter")));
for (int idx = 0; idx < scheduler->HardwareThreadCount(); ++idx) {
sm_policy.push_back(
(TaskExclusion(scheduler->GetTaskId("io::ReaderTask"), idx)));
Expand Down Expand Up @@ -104,7 +107,6 @@ void ControlNode::SetDefaultSchedulingPolicy() {
(TaskExclusion(scheduler->GetTaskId("db::DBTable")))
(TaskExclusion(scheduler->GetTaskId("db::Walker")))
(TaskExclusion(scheduler->GetTaskId("bgp::StateMachine")))
(TaskExclusion(scheduler->GetTaskId("bgp::RTFilter")))
(TaskExclusion(scheduler->GetTaskId("bgp::Config")));
scheduler->SetPolicy(scheduler->GetTaskId("bgp::RTFilter"),
rtfilter_policy);
Expand Down

0 comments on commit 25182da

Please sign in to comment.