Skip to content

Commit

Permalink
Fix wrong token used for flow-updates
Browse files Browse the repository at this point in the history
- Flow-Update operations were using add-token instead of update-tokens
- Minor clean-ups

Change-Id: I0f36d549c240d2417a1b5914faab836119cd4870
Partial-Bug: #1568126
Partial-Bug: #1572270
Partial-Bug: #1572471
  • Loading branch information
praveenkv committed May 14, 2016
1 parent df1c747 commit feaf4cf
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
3 changes: 3 additions & 0 deletions src/ksync/ksync_sock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ KSyncSock::KSyncSock() :
new WorkQueue<char *>(task_id, 0,
boost::bind(&KSyncSock::ProcessKernelData,
this, _1));
char name[128];
sprintf(name, "KSync Receive Queue-%d", i);
receive_work_queue[i]->set_name(name);
}
task_id = scheduler->GetTaskId("Ksync::AsyncSend");
nl_client_ = (nl_client *)malloc(sizeof(nl_client));
Expand Down
2 changes: 0 additions & 2 deletions src/vnsw/agent/cmn/agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,7 @@ void Agent::SetAgentTaskPolicy() {
sizeof(walk_cancel_exclude_list) / sizeof(char *));

const char *ksync_exclude_list[] = {
"Agent::StatsCollector",
"db::DBTable",
"Agent::PktFlowResponder",
AGENT_SHUTDOWN_TASKNAME,
AGENT_INIT_TASKNAME
};
Expand Down
4 changes: 2 additions & 2 deletions src/vnsw/agent/init/agent_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ void AgentInit::InitDoneBase() {
schedule_delay);
scheduler->SetLatencyThreshold(kTaskFlowUpdate, execute_delay,
schedule_delay);
scheduler->SetLatencyThreshold(kTaskFlowStatsCollector, execute_delay,
schedule_delay);
scheduler->SetLatencyThreshold(kTaskFlowStatsCollector, (execute_delay * 2),
(schedule_delay * 2));
agent_->InitDone();
InitDone();
}
Expand Down
2 changes: 1 addition & 1 deletion src/vnsw/agent/pkt/flow_proto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -681,13 +681,13 @@ bool FlowProto::ShouldTrace(const FlowEntry *flow, const FlowEntry *rflow) {
FlowTokenPtr FlowProto::GetToken(FlowEvent::Event event) {
switch (event) {
case FlowEvent::VROUTER_FLOW_MSG:
case FlowEvent::FLOW_MESSAGE:
case FlowEvent::AUDIT_FLOW:
case FlowEvent::KSYNC_EVENT:
case FlowEvent::REENTRANT:
return add_tokens_.GetToken(NULL);
break;

case FlowEvent::FLOW_MESSAGE:
case FlowEvent::DELETE_DBENTRY:
case FlowEvent::REVALUATE_DBENTRY:
case FlowEvent::REVALUATE_FLOW:
Expand Down
30 changes: 15 additions & 15 deletions src/vnsw/agent/pkt/flow_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,21 +208,6 @@ void FlowTable::AddInternal(FlowEntry *flow_req, FlowEntry *flow,
}
}

if (flow) {
if (fwd_flow_update) {
flow->set_last_event(FlowEvent::VROUTER_FLOW_MSG);
} else {
flow->set_last_event(FlowEvent::FLOW_MESSAGE);
}
}
if (rflow) {
if (rev_flow_update) {
rflow->set_last_event(FlowEvent::VROUTER_FLOW_MSG);
} else {
rflow->set_last_event(FlowEvent::FLOW_MESSAGE);
}
}

if (flow_req != flow) {
if (flow->flow_handle() == FlowEntry::kInvalidFlowHandle &&
!flow->deleted()) {
Expand All @@ -235,6 +220,21 @@ void FlowTable::AddInternal(FlowEntry *flow_req, FlowEntry *flow,
flow->set_deleted(false);
}

if (flow) {
if (fwd_flow_update) {
flow->set_last_event(FlowEvent::FLOW_MESSAGE);
} else {
flow->set_last_event(FlowEvent::VROUTER_FLOW_MSG);
}
}
if (rflow) {
if (rev_flow_update) {
rflow->set_last_event(FlowEvent::FLOW_MESSAGE);
} else {
rflow->set_last_event(FlowEvent::VROUTER_FLOW_MSG);
}
}

if (rflow) {
if (rflow_req != rflow) {
Copy(rflow, rflow_req, (rev_flow_update || force_update_rflow));
Expand Down

0 comments on commit feaf4cf

Please sign in to comment.