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.

Change-Id: Ibfac8308002e1f91bd423426b771d699fc9bb3f4
Closes-bug: 1549454
  • Loading branch information
manishsing committed Feb 28, 2016
1 parent e498976 commit 465d0b9
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 @@ -395,6 +395,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 @@ -419,6 +421,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 @@ -439,6 +442,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 @@ -458,6 +462,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 @@ -748,6 +761,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 465d0b9

Please sign in to comment.