Skip to content

Commit

Permalink
Merge "Send Object limits in vrouter UVE." into R3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Aug 23, 2016
2 parents 067a5f2 + 4af3924 commit 1d6bdb1
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 17 deletions.
16 changes: 16 additions & 0 deletions src/vnsw/agent/cmn/agent.cc
Expand Up @@ -861,3 +861,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
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 @@ -984,6 +985,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 @@ -1007,6 +1021,7 @@ class Agent {

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

AgentParam *params_;
Expand Down Expand Up @@ -1188,6 +1203,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
Expand Up @@ -1851,14 +1851,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
Expand Up @@ -1027,16 +1027,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
3 changes: 3 additions & 0 deletions src/vnsw/agent/uve/SConscript
Expand Up @@ -15,12 +15,14 @@ virtual_machine_pkg = env.SandeshGenPy('virtual_machine.sandesh', 'vrouter/sande
virtual_network_pkg = env.SandeshGenPy('virtual_network.sandesh', 'vrouter/sandesh/', False)
cpuinfo_pkg = env.SandeshGenPy('#controller/src/base/sandesh/cpuinfo.sandesh', 'vrouter/vrouter/', False)
process_info_pkg = env.SandeshGenPy('#controller/src/base/sandesh/process_info.sandesh', 'vrouter/vrouter/', False)
agent_pkg = env.SandeshGenPy('#controller/src/vnsw/agent/oper/agent.sandesh', 'vrouter/vrouter/', False)
virtual_machine_port_bmap_pkg = env.SandeshGenPy('port_bmap.sandesh', 'vrouter/sandesh/virtual_machine/', False)
flow_pkg = env.SandeshGenPy('#controller/src/sandesh/common/flow.sandesh', 'vrouter/sandesh/', False)
interface_pkg = env.SandeshGenPy('interface.sandesh', 'vrouter/sandesh/', False)
interface_port_bmap_pkg = env.SandeshGenPy('port_bmap.sandesh', 'vrouter/sandesh/interface/', False)
env.Depends(cpuinfo_pkg, vrouter_pkg)
env.Depends(process_info_pkg, vrouter_pkg)
env.Depends(agent_pkg, vrouter_pkg)
env.Depends(virtual_machine_port_bmap_pkg, virtual_machine_pkg)
env.Depends(interface_port_bmap_pkg, interface_pkg)

Expand Down Expand Up @@ -59,6 +61,7 @@ sdist_depends.extend(vrouter_sources_rules)
sdist_depends.extend(vrouter_pkg)
sdist_depends.extend(cpuinfo_pkg)
sdist_depends.extend(process_info_pkg)
sdist_depends.extend(agent_pkg)
sdist_depends.extend(virtual_machine_pkg)
sdist_depends.extend(virtual_network_pkg)
sdist_depends.extend(virtual_machine_port_bmap_pkg)
Expand Down
1 change: 1 addition & 0 deletions src/vnsw/agent/uve/setup.py
Expand Up @@ -11,6 +11,7 @@
'vrouter.vrouter',
'vrouter.vrouter.cpuinfo',
'vrouter.vrouter.process_info',
'vrouter.vrouter.agent',
'vrouter.loadbalancer',
'vrouter.sandesh',
'vrouter.sandesh.virtual_machine',
Expand Down
2 changes: 2 additions & 0 deletions src/vnsw/agent/uve/vrouter.sandesh
Expand Up @@ -12,6 +12,7 @@
*/
include "base/sandesh/cpuinfo.sandesh"
include "base/sandesh/process_info.sandesh"
include "vnsw/agent/oper/agent.sandesh"

/**
* Sandesh definition for agent's xen server config
Expand Down Expand Up @@ -122,6 +123,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
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
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 1d6bdb1

Please sign in to comment.