Skip to content

Commit

Permalink
Merge "Fix issue of connected_agent_list not updated in Prouter UVE."…
Browse files Browse the repository at this point in the history
… into R3.2
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 13, 2017
2 parents 4d7453a + eb0fbbe commit 18d14b7
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <base/string_util.h>
#include "ovsdb_client_connection_state.h"
#include <ovsdb_types.h>
#include "ha_stale_dev_vn.h"

using namespace OVSDB;
Expand Down Expand Up @@ -200,11 +201,23 @@ void ConnectionStateTable::UpdateConnectionInfo(ConnectionStateEntry *entry,
void ConnectionStateTable::NotifyUve(ConnectionStateEntry *entry,
bool deleted) {
/* If device uuid is not available we cannot notify Uve Module */
if (entry->device_uuid_ == boost::uuids::nil_uuid())
if (entry->device_uuid_ == boost::uuids::nil_uuid()) {
OVSDB_TRACE(Trace, "UVE notification failed for " +
entry->device_name_ + " No UUID yet");
return;
}

if (agent_->uve() == NULL || agent_->uve()->prouter_uve_table() == NULL)
if (agent_->uve() == NULL) {
OVSDB_TRACE(Trace, "UVE notification failed for " +
entry->device_name_ + " UVE object absent");
return;
}

if (agent_->uve()->prouter_uve_table() == NULL) {
OVSDB_TRACE(Trace, "UVE notification failed for " +
entry->device_name_ + " Prouter UVE object absent");
return;
}

ProuterUveTable *ptable = agent_->uve()->prouter_uve_table();
if (deleted) {
Expand Down
10 changes: 5 additions & 5 deletions src/vnsw/agent/ovs_tor_agent/tor_agent_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,22 @@ void TorAgentInit::CreatePeers() {
}

void TorAgentInit::CreateModules() {
ovsdb_client_.reset(OvsdbClient::Allocate(agent(),
static_cast<TorAgentParam *>(agent_param()),
ovs_peer_manager()));
agent()->set_ovsdb_client(ovsdb_client_.get());
uve_.reset(new AgentUve(agent(), AgentUveBase::kBandwidthInterval,
AgentUveBase::kDefaultInterval,
AgentUveBase::kIncrementalInterval));
agent()->set_uve(uve_.get());
ovsdb_client_.reset(OvsdbClient::Allocate(agent(),
static_cast<TorAgentParam *>(agent_param()),
ovs_peer_manager()));
agent()->set_ovsdb_client(ovsdb_client_.get());
}

void TorAgentInit::CreateDBTables() {
}

void TorAgentInit::RegisterDBClients() {
ovsdb_client_->RegisterClients();
uve_->RegisterDBClients();
ovsdb_client_->RegisterClients();
}

void TorAgentInit::InitModules() {
Expand Down
11 changes: 11 additions & 0 deletions src/vnsw/agent/uve/prouter.sandesh
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,14 @@ struct UvePhysicalInterfaceAgent {
uve sandesh UvePhysicalInterfaceAgentTrace {
1: UvePhysicalInterfaceAgent data;
}


/**
* @description: Trace message for Prouter UVE
* @type: Trace
* @severity: DEBUG
*/
trace sandesh ProuterUveTrace {
/** Message for Prouter object */
1: string message;
}
9 changes: 9 additions & 0 deletions src/vnsw/agent/uve/prouter_uve_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#include <uve/prouter_uve_table.h>
#include <uve/agent_uve_base.h>

SandeshTraceBufferPtr ProuterUveTraceBuf(SandeshTraceBufferCreate
("ProuterUve", 500));

ProuterUveTable::ProuterUveTable(Agent *agent, uint32_t default_intvl)
: uve_prouter_map_(), uve_phy_interface_map_(), agent_(agent),
physical_device_listener_id_(DBTableBase::kInvalidId),
Expand Down Expand Up @@ -877,6 +880,12 @@ void ProuterUveTable::UpdateMastership(const boost::uuids::uuid &u, bool value)
{
ProuterUveEntry *entry = PDEntryToProuterUveEntry(u);
if (entry == NULL) {
string status = " false";
if (value) {
status.assign(" true");
}
string msg = "Mastership update failed for " + to_string(u) + status;
PROUTER_UVE_TRACE(msg);
return;
}
if (entry->mastership_ != value) {
Expand Down
6 changes: 6 additions & 0 deletions src/vnsw/agent/uve/prouter_uve_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
#include <set>
#include <map>

extern SandeshTraceBufferPtr ProuterUveTraceBuf;
#define PROUTER_UVE_TRACE(...)\
do {\
ProuterUveTrace::TraceMsg(ProuterUveTraceBuf, __FILE__, __LINE__, __VA_ARGS__);\
} while (false);

// The container class for objects representing Prouter UVEs
// Defines routines for storing and managing (add, delete, change and send)
// Prouter UVEs
Expand Down

0 comments on commit 18d14b7

Please sign in to comment.