Skip to content

Commit

Permalink
Define minimum value for number of flow entries to be audited per ite…
Browse files Browse the repository at this point in the history
…ration

When the flow table size is less than 1800, the audit_yield_ value
computed can become 0, which will result in assert.

Change-Id: Iec7d55996b114641b1505cc0e29f3d6bca65be63
Closes-Bug: #1614359
  • Loading branch information
ashoksr committed Aug 18, 2016
1 parent 5c0d5c5 commit 4814619
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vnsw/agent/vrouter/ksync/ksync_flow_memory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ void KSyncFlowMemory::Init() {
audit_yield_ = flow_table_count / timer_per_sweep;
if (audit_yield_ > kAuditYieldMax)
audit_yield_ = kAuditYieldMax;
if (audit_yield_ < kAuditYieldMin)
audit_yield_ = kAuditYieldMin;

audit_timer_->Start(audit_interval_,
boost::bind(&KSyncFlowMemory::AuditProcess, this));
Expand Down
2 changes: 2 additions & 0 deletions src/vnsw/agent/vrouter/ksync/ksync_flow_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class KSyncFlowMemory {
static const uint32_t kAuditTimeout = (5 * 1000 * 1000); // in usec
// Upper limit on number of entries to visit per timer
static const uint32_t kAuditYieldMax = (1024);
// Lower limit on number of entries to visit per timer
static const uint32_t kAuditYieldMin = (100);

KSyncFlowMemory(KSync *ksync);
~KSyncFlowMemory();
Expand Down

0 comments on commit 4814619

Please sign in to comment.