Skip to content

Commit

Permalink
* Fix mirror index not being programmed in ksync
Browse files Browse the repository at this point in the history
Change-Id: I8bab3c02cda8779574e0c9a75abd30b2ac3d2fa5
Closes-bug:#1561775
  • Loading branch information
naveen-n committed Apr 12, 2016
1 parent 050a593 commit 5f6ce1a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/vnsw/agent/pkt/test/test_vrf_assign_acl.cc
Expand Up @@ -399,6 +399,10 @@ TEST_F(TestVrfAssignAclFlow, VrfAssignAclWithMirror1) {
};
CreateFlow(flow, 1);

FlowEntry *entry = FlowGet(VmPortGet(1)->flow_key_nh()->id(), "1.1.1.1",
"2.1.1.1", IPPROTO_TCP, 10, 20);
EXPECT_TRUE(entry->ksync_entry()->old_first_mirror_index() == 0);

DelLink("virtual-network", "default-project:vn1", "access-control-list", "Acl");
DelAcl("Acl");
client->WaitForIdle();
Expand Down
4 changes: 3 additions & 1 deletion src/vnsw/agent/vrouter/ksync/flowtable_ksync.h
Expand Up @@ -53,12 +53,14 @@ class FlowTableKSyncEntry : public KSyncNetlinkEntry {
bool AllowDeleteStateComp() {return false;}
virtual void ErrorHandler(int, uint32_t) const;
virtual std::string VrouterError(uint32_t error) const;

uint8_t gen_id() { return gen_id_; }
void set_gen_id(uint8_t gen_id) { gen_id_ = gen_id; }
uint8_t evict_gen_id() { return evict_gen_id_; }
void set_evict_gen_id(uint8_t gen_id) { evict_gen_id_ = gen_id; }

uint32_t old_first_mirror_index() {
return old_first_mirror_index_;
}
private:
friend class KSyncFlowEntryFreeList;
friend class KSyncFlowIndexManager;
Expand Down
2 changes: 1 addition & 1 deletion src/vnsw/agent/vrouter/ksync/mirror_ksync.cc
Expand Up @@ -149,7 +149,7 @@ uint32_t MirrorKSyncObject::GetIdx(std::string analyzer_name) {
MirrorKSyncEntry key(this, analyzer_name);
KSyncEntry *entry = Find(&key);
if (entry) {
entry->GetIndex();
return entry->GetIndex();
}
return MirrorTable::kInvalidIndex;
}
Expand Down

0 comments on commit 5f6ce1a

Please sign in to comment.