Skip to content

Commit

Permalink
Do not re-evaluate backrefs for ksync flow entries
Browse files Browse the repository at this point in the history
The backref entries are updated in DB and ksync tasks, which are mutually
exclusive. The flow event task was accessing the same and it doesnt actually
require. Avoiding backref reevaluation.

Change-Id: I8cb9b92196626ea219f7f9e1055e2579c62c7c86
closes-bug: #1726709
  • Loading branch information
haripk committed Oct 25, 2017
1 parent 381c1f9 commit 46c9d46
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ksync/ksync_entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class KSyncEntry {
// Get an unresolved reference.
// This entry will be added into resolveq_ of unresolved-entry
virtual KSyncEntry *UnresolvedReference() = 0;
virtual bool ShouldReEvalBackReference() const { return true; }

// Returns true if entry is resolved and referring entry can be written
bool IsResolved();
Expand Down
3 changes: 2 additions & 1 deletion src/ksync/ksync_object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,8 @@ void KSyncObject::NotifyEvent(KSyncEntry *entry, KSyncEntry::KSyncEvent event) {
}

entry->SetState(state);
if (dep_reval == true && entry->IsResolved()) {
if (dep_reval == true && entry->IsResolved() &&
entry->ShouldReEvalBackReference()) {
BackRefReEval(entry);
}

Expand Down
5 changes: 5 additions & 0 deletions src/vnsw/agent/vrouter/ksync/flowtable_ksync.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ class FlowTableKSyncEntry : public KSyncNetlinkEntry {
virtual uint32_t GetTableIndex() const;
virtual bool Sync();
virtual KSyncEntry *UnresolvedReference();
virtual bool ShouldReEvalBackReference() const {
// no need to re-eval unresolved reference for flow entries, as they
// do not depend on anything
return false;
}
bool AllowDeleteStateComp() {return false;}
virtual void ErrorHandler(int, uint32_t, KSyncEvent) const;
virtual std::string VrouterError(uint32_t error) const;
Expand Down

0 comments on commit 46c9d46

Please sign in to comment.