Skip to content

Commit

Permalink
Adding/deleting SI in chain results in traffic loss.
Browse files Browse the repository at this point in the history
Problem:
While re-evaluating flow/rflow the old reverse flow of flow/rflow were not
pointing to same(pointing to NULL) and hence were marked as short flow,
but same was not updated to stats_collector. This resulted in flow dangling till
aging and in turn holding respective VRF in deleted state. Afet aging VRF was
removed and new VRF added, in turn restoring traffic.

Solution:
Notify stats collector on marking as short flow.

(cherry picked from commit 74e0dff2e00ffdf55cdbfbcbe74544e169453daf)
Closes-bug: 1549454
Change-Id: Ibfac8308002e1f91bd423426b771d699fc9bb3f4
  • Loading branch information
manishsing authored and praveenkv committed Mar 5, 2016
1 parent 369031a commit d2c75e1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/vnsw/agent/pkt/flow_table.cc
Expand Up @@ -411,6 +411,8 @@ bool FlowTable::ValidFlowMove(const FlowEntry *new_flow,
void FlowTable::UpdateReverseFlow(FlowEntry *flow, FlowEntry *rflow) {
FlowEntry *flow_rev = flow->reverse_flow_entry();
FlowEntry *rflow_rev = NULL;
bool flow_rev_notify = false;
bool rflow_rev_notify = false;

if (rflow) {
rflow_rev = rflow->reverse_flow_entry();
Expand All @@ -435,6 +437,7 @@ void FlowTable::UpdateReverseFlow(FlowEntry *flow, FlowEntry *rflow) {
if (ValidFlowMove(rflow, flow_rev)== false) {
flow->MakeShortFlow(FlowEntry::SHORT_REVERSE_FLOW_CHANGE);
}
flow_rev_notify = true;
}

if (rflow && rflow->is_flags_set(FlowEntry::BgpRouterService)) {
Expand All @@ -455,6 +458,7 @@ void FlowTable::UpdateReverseFlow(FlowEntry *flow, FlowEntry *rflow) {
if (ValidFlowMove(flow, rflow_rev) == false) {
flow->MakeShortFlow(FlowEntry::SHORT_REVERSE_FLOW_CHANGE);
}
rflow_rev_notify = true;
}

if (flow->reverse_flow_entry() == NULL) {
Expand All @@ -474,6 +478,15 @@ void FlowTable::UpdateReverseFlow(FlowEntry *flow, FlowEntry *rflow) {
rflow->set_flags(FlowEntry::Multicast);
}
}
//Has been marked for short flow, notify stats collector
if (flow_rev_notify) {
FlowEntryPtr flow_rev_ptr(flow_rev);
agent()->flow_stats_manager()->AddEvent(flow_rev_ptr);
}
if (rflow_rev_notify) {
FlowEntryPtr rflow_rev_ptr(rflow_rev);
agent()->flow_stats_manager()->AddEvent(rflow_rev_ptr);
}
}

////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -764,6 +777,8 @@ void FlowTable::EvictFlow(FlowEntry *flow, FlowEntry *reverse_flow) {
// Reverse flow unlinked with forward flow. Make it short-flow
if (reverse_flow && reverse_flow->deleted() == false) {
reverse_flow->MakeShortFlow(FlowEntry::SHORT_NO_REVERSE_FLOW);
FlowEntryPtr reverse_flow_ptr(reverse_flow);
agent()->flow_stats_manager()->AddEvent(reverse_flow_ptr);
UpdateKSync(reverse_flow, true);
}
}
Expand Down

0 comments on commit d2c75e1

Please sign in to comment.