Skip to content

Commit

Permalink
Encode fat flow config in vrouter ksync.
Browse files Browse the repository at this point in the history
Also, add introspect for fat flow config.

(cherry picked from commit c9821d4)

Conflicts:
	src/vnsw/agent/oper/agent.sandesh

Change-Id: I9261c39a034b884b273619ee3b9bd55a2d5001b3
closes-bug: 1518234
  • Loading branch information
naveen-n authored and haripk committed Feb 3, 2016
1 parent 60ea648 commit caa89c1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vnsw/agent/oper/agent.sandesh
Expand Up @@ -104,8 +104,9 @@ struct ItfSandeshData {
49: optional string ipv4_active;
50: list<string> fixed_ip4_list;
51: list<string> fixed_ip6_list;
52: optional string health_check_active;
53: optional string metadata_ip_active;
52: list<string> fat_flow_list;
53: optional string health_check_active;
54: optional string metadata_ip_active;
}

struct VnIpamData {
Expand Down
11 changes: 11 additions & 0 deletions src/vnsw/agent/oper/interface.cc
Expand Up @@ -951,6 +951,17 @@ void Interface::SetItfSandeshData(ItfSandeshData &data) const {
}
data.set_fixed_ip6_list(fixed_ip6_list);

std::vector<std::string> fat_flow_list;
VmInterface::FatFlowEntrySet::iterator fat_flow_it =
vintf->fat_flow_list().list_.begin();
while (fat_flow_it != vintf->fat_flow_list().list_.end()) {
ostringstream str;
str << (int)fat_flow_it->protocol << ":" << (int)fat_flow_it->port<<"";
fat_flow_list.push_back(str.str());
fat_flow_it++;
}
data.set_fat_flow_list(fat_flow_list);

if (vintf->fabric_port()) {
data.set_fabric_port("FabricPort");
} else {
Expand Down
10 changes: 10 additions & 0 deletions src/vnsw/agent/vrouter/ksync/interface_ksync.cc
Expand Up @@ -540,6 +540,16 @@ int InterfaceKSyncEntry::Encode(sandesh_op::type op, char *buf, int buf_len) {
((const int8_t *)smac(),
(const int8_t *)smac() + smac().size()));
}

if (fat_flow_list_.list_.size() != 0) {
std::vector<int32_t> fat_flow_list;
for (VmInterface::FatFlowEntrySet::const_iterator it =
fat_flow_list_.list_.begin(); it != fat_flow_list_.list_.end();
it++) {
fat_flow_list.push_back(it->protocol << 16 | it->port);
}
encoder.set_vifr_fat_flow_protocol_port(fat_flow_list);
}
break;
}

Expand Down

0 comments on commit caa89c1

Please sign in to comment.