Skip to content

Commit

Permalink
Merge "Flows not deleted resulting in vrf del pending."
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jan 27, 2016
2 parents c23ed28 + e0e6be9 commit 02c5cfa
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/vnsw/agent/vrouter/ksync/ksync_flow_index_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,22 @@ bool KSyncFlowIndexManager::Delete(FlowEntry *flow) {
return false;
}

if (index_entry->state_ == KSyncFlowIndexEntry::INDEX_UNASSIGNED)
return false;

if (index_entry->ksync_entry_ == NULL) {
assert(index_entry->index_ == FlowEntry::kInvalidFlowHandle);
return false;
bool force_delete = false;
//Flow index allocation had failed from kernel, so dont wait for
//index allocation and delete flow. Note: Because of failed index allocation
//flow was marked as short flow with reason SHORT_FAILED_VROUTER_INSTALL
force_delete |= (flow->is_flags_set(FlowEntry::ShortFlow) &&
(flow->short_flow_reason() ==
((uint16_t) FlowEntry::SHORT_FAILED_VROUTER_INSTALL)));

if (!force_delete) {
if (index_entry->state_ == KSyncFlowIndexEntry::INDEX_UNASSIGNED)
return false;

if (index_entry->ksync_entry_ == NULL) {
assert(index_entry->index_ == FlowEntry::kInvalidFlowHandle);
return false;
}
}

index_entry->delete_in_progress_ = true;
Expand Down

0 comments on commit 02c5cfa

Please sign in to comment.