Skip to content

Commit

Permalink
Merge "Send Object limits in vrouter UVE."
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Aug 5, 2016
2 parents 8e9b13f + 0f02cdc commit 3fa2806
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 17 deletions.
16 changes: 16 additions & 0 deletions src/vnsw/agent/cmn/agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -873,3 +873,19 @@ bool Agent::MeasureQueueDelay() {
void Agent::SetMeasureQueueDelay(bool val) {
return params_->set_measure_queue_delay(val);
}

VrouterObjectLimits Agent::GetVrouterObjectLimits() {
VrouterObjectLimits vr_limits;
vr_limits.set_max_labels(vrouter_max_labels());
vr_limits.set_max_nexthops(vrouter_max_nexthops());
vr_limits.set_max_interfaces(vrouter_max_interfaces());
vr_limits.set_max_vrfs(vrouter_max_vrfs());
vr_limits.set_max_mirror_entries(vrouter_max_mirror_entries());
vr_limits.set_vrouter_max_bridge_entries(vrouter_max_bridge_entries());
vr_limits.set_vrouter_max_oflow_bridge_entries(
vrouter_max_oflow_bridge_entries());
vr_limits.set_vrouter_build_info(vrouter_build_info());
vr_limits.set_vrouter_max_flow_entries(vrouter_max_flow_entries());
vr_limits.set_vrouter_max_oflow_entries(vrouter_max_oflow_entries());
return vr_limits;
}
19 changes: 19 additions & 0 deletions src/vnsw/agent/cmn/agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <base/connection_info.h>
#include <base/timer.h>
#include "net/mac_address.h"
#include "oper/agent_types.h"

class Agent;
class AgentParam;
Expand Down Expand Up @@ -1034,6 +1035,19 @@ class Agent {
vrouter_max_oflow_bridge_entries_ = oflow_bridge_entries;
}

uint32_t vrouter_max_flow_entries() const {
return vrouter_max_flow_entries_;
}
void set_vrouter_max_flow_entries(uint32_t value) {
vrouter_max_flow_entries_ = value;
}

uint32_t vrouter_max_oflow_entries() const {
return vrouter_max_oflow_entries_;
}
void set_vrouter_max_oflow_entries(uint32_t value) {
vrouter_max_oflow_entries_ = value;
}
void set_vrouter_build_info(std::string version) {
vrouter_build_info_ = version;
}
Expand All @@ -1057,6 +1071,7 @@ class Agent {

static uint16_t ProtocolStringToInt(const std::string &str);
bool TbbKeepAwake();
VrouterObjectLimits GetVrouterObjectLimits();
private:

AgentParam *params_;
Expand Down Expand Up @@ -1242,6 +1257,10 @@ class Agent {
//Bridge entries that can be porgrammed in vrouter
uint32_t vrouter_max_bridge_entries_;
uint32_t vrouter_max_oflow_bridge_entries_;
//Max Flow entries
uint32_t vrouter_max_flow_entries_;
//Max OverFlow entries
uint32_t vrouter_max_oflow_entries_;
std::string vrouter_build_info_;
FlowStatsReqHandler flow_stats_req_handler_;

Expand Down
16 changes: 9 additions & 7 deletions src/vnsw/agent/oper/agent.sandesh
Original file line number Diff line number Diff line change
Expand Up @@ -1874,14 +1874,16 @@ objectlog sandesh PhysicalDeviceVnObjectLog {
* Sandesh definition for vrouter limits
*/
struct VrouterObjectLimits {
1: i32 max_labels;
2: i32 max_nexthops;
3: i32 max_interfaces;
4: i32 max_vrfs;
5: i32 max_mirror_entries;
6: i32 vrouter_max_bridge_entries;
7: i32 vrouter_max_oflow_bridge_entries;
1: u32 max_labels;
2: u32 max_nexthops;
3: u32 max_interfaces;
4: u32 max_vrfs;
5: u32 max_mirror_entries;
6: u32 vrouter_max_bridge_entries;
7: u32 vrouter_max_oflow_bridge_entries;
8: string vrouter_build_info;
9: u32 vrouter_max_flow_entries;
10: u32 vrouter_max_oflow_entries;
}

/**
Expand Down
12 changes: 2 additions & 10 deletions src/vnsw/agent/oper/agent_sandesh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1029,16 +1029,8 @@ void VrouterObjectLimitsReq::HandleRequest() const {
resp->set_context(context());

Agent *agent = Agent::GetInstance();
VrouterObjectLimits vr_limits;
vr_limits.set_max_labels(agent->vrouter_max_labels());
vr_limits.set_max_nexthops(agent->vrouter_max_nexthops());
vr_limits.set_max_interfaces(agent->vrouter_max_interfaces());
vr_limits.set_max_vrfs(agent->vrouter_max_vrfs());
vr_limits.set_max_mirror_entries(agent->vrouter_max_mirror_entries());
vr_limits.set_vrouter_max_bridge_entries(agent->vrouter_max_bridge_entries());
vr_limits.set_vrouter_max_oflow_bridge_entries(agent->
vrouter_max_oflow_bridge_entries());
vr_limits.set_vrouter_build_info(agent->vrouter_build_info());

VrouterObjectLimits vr_limits = agent->GetVrouterObjectLimits();
resp->set_vrouter_object_limit(vr_limits);
resp->Response();
}
Expand Down
2 changes: 2 additions & 0 deletions src/vnsw/agent/uve/vrouter.sandesh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
include "base/sandesh/cpuinfo.sandesh"
include "base/sandesh/process_info.sandesh"
include "sandesh/library/common/derived_stats_results.sandesh"
include "vnsw/agent/oper/agent.sandesh"

/**
* Sandesh definition for agent's xen server config
Expand Down Expand Up @@ -123,6 +124,7 @@ struct VrouterAgent { // Agent info
49: optional list<string> unmanaged_if_list;
50: optional u32 vn_count; //being sent for UI dashboard optimization
51: optional string platform;
52: optional agent.VrouterObjectLimits vr_limits;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/vnsw/agent/uve/vrouter_uve_entry_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,8 @@ bool VrouterUveEntryBase::SendVrouterMsg() {
VROUTER_AGENT_ON_HOST));
}

VrouterObjectLimits vr_limits = agent_->GetVrouterObjectLimits();
vrouter_agent.set_vr_limits(vr_limits);
first = false;
changed = true;
}
Expand Down
2 changes: 2 additions & 0 deletions src/vnsw/agent/vrouter/ksync/sandesh_ksync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ void KSyncSandeshContext::VrouterOpsMsgHandler(vrouter_ops *r) {
agent->set_vrouter_max_interfaces(r->get_vo_interfaces());
agent->set_vrouter_max_mirror_entries(r->get_vo_mirror_entries());
agent->set_vrouter_max_vrfs(r->get_vo_vrfs());
agent->set_vrouter_max_flow_entries(r->get_vo_flow_entries());
agent->set_vrouter_max_oflow_entries(r->get_vo_oflow_entries());
agent->set_vrouter_build_info(r->get_vo_build_info());
return;
}

0 comments on commit 3fa2806

Please sign in to comment.