Skip to content

Commit

Permalink
Activate the ifmap update Q for all node/link changes
Browse files Browse the repository at this point in the history
Closes-Bug: #1467650
Partial-Bug: #1466825

Change-Id: I88e975e685ebc43ad20b473bb62026bb36f6b044
  • Loading branch information
tkarwa committed Jun 22, 2015
1 parent aec4924 commit 659fe8c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/ifmap/ifmap_exporter.cc
Expand Up @@ -200,12 +200,8 @@ bool IFMapExporter::UpdateAddChange(ObjectType *obj, IFMapState *state,
} else {
update->SetAdvertise(state->interest());
}
bool tm_last = queue()->Enqueue(update);
// If the tail_marker was the last element before the enqueue, send a
// trigger to the sender to create a task to do the 'send'.
if (tm_last) {
sender()->QueueActive();
}
queue()->Enqueue(update);
sender()->QueueActive();
return is_move;
}

Expand Down Expand Up @@ -240,12 +236,8 @@ bool IFMapExporter::UpdateRemove(ObjectType *obj, IFMapState *state,
}

update->SetAdvertise(rm_set);
bool tm_last = queue()->Enqueue(update);
// If the tail_marker was the last element before the enqueue, send a
// trigger to the sender to create a task to do the 'send'.
if (tm_last) {
sender()->QueueActive();
}
queue()->Enqueue(update);
sender()->QueueActive();
return is_move;
}

Expand All @@ -272,10 +264,8 @@ void IFMapExporter::EnqueueDelete(ObjectType *obj, IFMapState *state) {
state->Insert(update);
}
update->SetAdvertise(state->advertised());
bool was_idle = queue()->Enqueue(update);
if (was_idle) {
sender()->QueueActive();
}
queue()->Enqueue(update);
sender()->QueueActive();
}

IFMapLinkState *IFMapExporter::LinkStateLookup(IFMapLink *link) {
Expand All @@ -300,6 +290,7 @@ void IFMapExporter::MoveDependentLinks(IFMapNodeState *state) {
assert(!update->advertise().empty());
queue()->Dequeue(update);
queue()->Enqueue(update);
sender()->QueueActive();
}
}

Expand All @@ -309,6 +300,7 @@ void IFMapExporter::MoveAdjacentNode(IFMapNodeState *state) {
assert(!update->advertise().empty());
queue()->Dequeue(update);
queue()->Enqueue(update);
sender()->QueueActive();
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/ifmap/ifmap_update_sender.cc
Expand Up @@ -64,6 +64,9 @@ void IFMapUpdateSender::StartTask() {
}

void IFMapUpdateSender::QueueActive() {
if (queue_active_) {
return;
}
queue_active_ = true;
tbb::mutex::scoped_lock lock(mutex_);
StartTask();
Expand Down

0 comments on commit 659fe8c

Please sign in to comment.