Skip to content

Commit

Permalink
Correct the metadata string of fip-pool to vn
Browse files Browse the repository at this point in the history
The metadata mentioned in xsd for the link between floating-ip-pool to
VN is "virtual-network-floating-ip-pool" and Agent is adding a rule
in dependency manager for VMI as "floating-ip-pool-virtual-network".
This is resulting in no InterestedEvent in dependency tracker if the
link added between VN-FIP is the last link in that VMI.

As a fix, metadata is corrected in Agent.

Change-Id: I484099d8c843493cfcdb618a3165819f9eab5d08
closes-bug: #1544788

Handle vxlan change for local_vm peer in l2 flood.

Change-Id: I3eb43c9541eec6ef3d343a8aa041b527033c24fe
Closes-bug: 1529665

Add ShowRouteAggregateSummaryReq introspect command

Change-Id: Ib633b018798e19c7fc73f4bebaef10283aef1a89
Related-bug: 1500698

database-purge request fails if analytics-api starts before cassandra

analytics-api creates cql session only on creation of AnalyticsDb
object. Therefore, if analytics-api starts before cassandra becomes
active, then database-purge request fails.

This patch ensures that the cql session is created upon purge request if
cql session is None.

Change-Id: Ic38d82cd1d614cd80af917ff205c3a63b95d6b92
Closes-Bug: #1546435

LBaaS scheduler should not use hardcoded tenant name

This fix removes the hardcoded 'admin' tenant name from
lbaas scheduler and reads the tenant from config.
It also fixes the default admin_tenant_name in svc_monitor.py
to 'admin'.
Closes-Bug: #1543296

Change-Id: If5e558e27ef6fd81d81cf56a317f39dbac2854ce

Fix error message

The VM uuid should be shown instead of the VN uuid

Change-Id: I56a65f5aabbc441139784e672babcf5e7508b880
Closes-Bug: #1546107

Adding UVE information for Health Check

Virtual Machine Interface UVE will also carry additional
information on the HealthCheck instances running on it,
its state and running status

Closes-Bug: 1546390
Change-Id: Ib6f2dac3e80544852359b8e7633343011b9f7a4e

Agent changes to accept port add requests without IP address.

This is done for both REST and thrift interface. Also add a flag to Flow info maintained
by FlowStatsCollector to indicate whether a delete was enqueued for that flow or not.

Change-Id: Ibe1cd81bcd71d42919995860e846383740bdfcdc
Closes-Bug: #1546939
  • Loading branch information
divakardhar authored and vmahuli committed Feb 19, 2016
1 parent 6dfbdf5 commit a6be817
Show file tree
Hide file tree
Showing 32 changed files with 389 additions and 131 deletions.
4 changes: 2 additions & 2 deletions src/bgp/routing-instance/iroute_aggregator.h
Expand Up @@ -23,8 +23,8 @@ class IRouteAggregator {
virtual bool IsAggregateRoute(const BgpRoute *route) const = 0;
virtual bool IsContributingRoute(const BgpRoute *route) const = 0;

virtual bool FillAggregateRouteInfo(RoutingInstance *ri,
AggregateRouteEntriesInfo *info) const = 0;
virtual bool FillAggregateRouteInfo(AggregateRouteEntriesInfo *info,
bool summary) const = 0;

private:
friend class RouteAggregatorTest;
Expand Down
16 changes: 13 additions & 3 deletions src/bgp/routing-instance/route_aggregate.sandesh
Expand Up @@ -9,15 +9,25 @@ struct AggregateRouteInfo {
1: string prefix;
2: bgp_peer.ShowRouteBrief aggregate_rt;
3: string nexthop;
4: list<string> contributors;
5: bool deleted;
4: bool deleted;
5: optional list<string> contributors;
}

struct AggregateRouteEntriesInfo {
1: string ri_name;
1: string name (link="ShowRouteAggregateReq");
2: list<AggregateRouteInfo> aggregate_route_list;
}

response sandesh ShowRouteAggregateSummaryResp {
1: list<AggregateRouteEntriesInfo> aggregate_route_entries;
2: optional string next_batch (link="ShowRouteAggregateSummaryReqIterate",
link_title="next_batch");
}

request sandesh ShowRouteAggregateSummaryReq {
1: string search_string;
}

response sandesh ShowRouteAggregateResp {
1: list<AggregateRouteEntriesInfo> aggregate_route_entries;
2: optional string next_batch (link="ShowRouteAggregateReqIterate",
Expand Down
5 changes: 5 additions & 0 deletions src/bgp/routing-instance/route_aggregate_internal.sandesh
@@ -1,6 +1,11 @@
/*
* Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
*/

request sandesh ShowRouteAggregateReqIterate {
1: string iterate_info;
}

request sandesh ShowRouteAggregateSummaryReqIterate {
1: string iterate_info;
}
24 changes: 14 additions & 10 deletions src/bgp/routing-instance/route_aggregator.cc
Expand Up @@ -236,7 +236,7 @@ class AggregateRoute : public ConditionMatch {
return contributors_[part_id].empty();
}

void FillShowInfo(AggregateRouteInfo *info) const;
void FillShowInfo(AggregateRouteInfo *info, bool summary) const;

private:
RoutingInstance *routing_instance_;
Expand Down Expand Up @@ -481,7 +481,8 @@ void AggregateRoute<T>::set_aggregate_route(BgpRoute *aggregate) {
}

template <typename T>
void AggregateRoute<T>::FillShowInfo(AggregateRouteInfo *info) const {
void AggregateRoute<T>::FillShowInfo(AggregateRouteInfo *info,
bool summary) const {
BgpTable *table = bgp_table();
info->set_deleted(deleted());
info->set_prefix(aggregate_route_prefix_.ToString());
Expand All @@ -493,6 +494,9 @@ void AggregateRoute<T>::FillShowInfo(AggregateRouteInfo *info) const {

info->set_nexthop(nexthop_.to_string());

if (summary)
return;

std::vector<string> contributor_list;
BOOST_FOREACH(const RouteList &list, contribute_route_list()) {
BOOST_FOREACH(BgpRoute *rt, list) {
Expand Down Expand Up @@ -688,18 +692,18 @@ bool RouteAggregator<T>::IsContributingRoute(const BgpRoute *route) const {
}

template <typename T>
bool RouteAggregator<T>::FillAggregateRouteInfo(RoutingInstance *ri,
AggregateRouteEntriesInfo *info) const {
if (aggregate_route_map().empty()) return false;

info->set_ri_name(ri->name());
bool RouteAggregator<T>::FillAggregateRouteInfo(AggregateRouteEntriesInfo *info,
bool summary) const {
if (aggregate_route_map().empty())
return false;

for (typename AggregateRouteMap::const_iterator it = aggregate_route_map_.begin();
it != aggregate_route_map_.end(); it++) {
info->set_name(rtinstance_->name());
for (typename AggregateRouteMap::const_iterator it =
aggregate_route_map_.begin(); it != aggregate_route_map_.end(); it++) {
AggregateRouteT *aggregate =
static_cast<AggregateRouteT *>(it->second.get());
AggregateRouteInfo aggregate_info;
aggregate->FillShowInfo(&aggregate_info);
aggregate->FillShowInfo(&aggregate_info, summary);
info->aggregate_route_list.push_back(aggregate_info);
}
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/bgp/routing-instance/route_aggregator.h
Expand Up @@ -199,8 +199,8 @@ class RouteAggregator : public IRouteAggregator {
virtual bool IsAggregateRoute(const BgpRoute *route) const;
virtual bool IsContributingRoute(const BgpRoute *route) const;

virtual bool FillAggregateRouteInfo(RoutingInstance *ri,
AggregateRouteEntriesInfo *info) const;
virtual bool FillAggregateRouteInfo(AggregateRouteEntriesInfo *info,
bool summary) const;

private:
class DeleteActor;
Expand Down
190 changes: 144 additions & 46 deletions src/bgp/routing-instance/show_route_aggregate.cc
Expand Up @@ -4,59 +4,54 @@

#include "bgp/bgp_show_handler.h"

#include <boost/foreach.hpp>
#include <boost/assign/list_of.hpp>

#include "bgp/bgp_server.h"
#include "bgp/bgp_show_handler.h"
#include "bgp/routing-instance/routing_instance.h"
#include "bgp/routing-instance/route_aggregator.h"
#include "bgp/routing-instance/route_aggregate_internal_types.h"
#include "bgp/routing-instance/route_aggregate_types.h"

using boost::assign::list_of;
using std::string;
using std::vector;

static bool FillRouteAggregateInfo(Address::Family family,
const string search_string,
AggregateRouteEntriesInfo &info,
RoutingInstance *rtinstance) {
const BgpTable *table =
static_cast<const BgpTable *>(rtinstance->GetTable(family));
if (!table)
return false;
if (!search_string.empty() &&
(table->name().find(search_string) == string::npos) &&
(search_string != "deleted" || !table->IsDeleted())) {
return false;
}

IRouteAggregator *iroute_aggregator = rtinstance->route_aggregator(family);
if (!iroute_aggregator)
return false;
return iroute_aggregator->FillAggregateRouteInfo(rtinstance, &info);
}

// Specialization of BgpShowHandler<>::CallbackCommon.
template <>
bool BgpShowHandler<ShowRouteAggregateReq, ShowRouteAggregateReqIterate,
ShowRouteAggregateResp, AggregateRouteEntriesInfo>::CallbackCommon(
const BgpSandeshContext *bsc, Data *data) {
uint32_t page_limit = bsc->page_limit() ? bsc->page_limit() : kPageLimit;
uint32_t iter_limit = bsc->iter_limit() ? bsc->iter_limit() : kIterLimit;
static bool FillRouteAggregateInfoList(const BgpSandeshContext *bsc,
bool summary, uint32_t page_limit, uint32_t iter_limit,
const string &start_instance, const string &search_string,
vector<AggregateRouteEntriesInfo> *are_list, string *next_instance) {
RoutingInstanceMgr *rim = bsc->bgp_server->routing_instance_mgr();

RoutingInstanceMgr::const_name_iterator it =
rim->name_clower_bound(data->next_entry);
rim->name_clower_bound(start_instance);
for (uint32_t iter_count = 0; it != rim->name_cend(); ++it, ++iter_count) {
RoutingInstance *rinstance = it->second;
AggregateRouteEntriesInfo info;
if (FillRouteAggregateInfo(Address::INET, data->search_string, info,
rinstance)) {
data->show_list.push_back(info);
}
if (FillRouteAggregateInfo(Address::INET6, data->search_string, info,
rinstance)) {
data->show_list.push_back(info);
RoutingInstance *rtinstance = it->second;

vector<Address::Family> families =
list_of(Address::INET)(Address::INET6);
BOOST_FOREACH(Address::Family family, families) {
const BgpTable *table =
static_cast<const BgpTable *>(rtinstance->GetTable(family));
if (!table)
continue;
if (!search_string.empty() &&
(table->name().find(search_string) == string::npos) &&
(search_string != "deleted" || !table->IsDeleted())) {
continue;
}

IRouteAggregator *iroute_aggregator =
rtinstance->route_aggregator(family);
if (!iroute_aggregator)
continue;
AggregateRouteEntriesInfo info;
if (!iroute_aggregator->FillAggregateRouteInfo(&info, summary))
continue;
are_list->push_back(info);
}

if (data->show_list.size() >= page_limit)
if (are_list->size() >= page_limit)
break;
if (iter_count >= iter_limit)
break;
Expand All @@ -68,21 +63,76 @@ bool BgpShowHandler<ShowRouteAggregateReq, ShowRouteAggregateReqIterate,

// Return true if we've reached the page limit, false if we've reached the
// iteration limit.
bool done = data->show_list.size() >= page_limit;
SaveContextToData(it->second->name(), done, data);
bool done = are_list->size() >= page_limit;
*next_instance = it->second->name();
return done;
}

// Specialization of BgpShowHandler<>::FillShowList.
//
// Specialization of BgpShowHandler<>::CallbackCommon for regular introspect.
//
template <>
void BgpShowHandler<ShowRouteAggregateReq, ShowRouteAggregateReqIterate,
ShowRouteAggregateResp, AggregateRouteEntriesInfo>::FillShowList(
ShowRouteAggregateResp *resp,
const vector<AggregateRouteEntriesInfo> &show_list) {
bool BgpShowHandler<ShowRouteAggregateReq,
ShowRouteAggregateReqIterate, ShowRouteAggregateResp,
AggregateRouteEntriesInfo>::CallbackCommon(
const BgpSandeshContext *bsc, Data *data) {
uint32_t page_limit = bsc->page_limit() ? bsc->page_limit() : kPageLimit;
uint32_t iter_limit = bsc->iter_limit() ? bsc->iter_limit() : kIterLimit;
string next_instance;
bool done = FillRouteAggregateInfoList(bsc, false, page_limit, iter_limit,
data->next_entry, data->search_string, &data->show_list,
&next_instance);
if (!next_instance.empty())
SaveContextToData(next_instance, done, data);
return done;
}

//
// Specialization of BgpShowHandler<>::FillShowList for regular introspect.
//
template <>
void BgpShowHandler<ShowRouteAggregateReq,
ShowRouteAggregateReqIterate, ShowRouteAggregateResp,
AggregateRouteEntriesInfo>::FillShowList(
ShowRouteAggregateResp *resp,
const vector<AggregateRouteEntriesInfo> &show_list) {
resp->set_aggregate_route_entries(show_list);
}

//
// Specialization of BgpShowHandler<>::CallbackCommon for summary introspect.
//
template <>
bool BgpShowHandler<ShowRouteAggregateSummaryReq,
ShowRouteAggregateSummaryReqIterate, ShowRouteAggregateSummaryResp,
AggregateRouteEntriesInfo>::CallbackCommon(
const BgpSandeshContext *bsc, Data *data) {
uint32_t page_limit = bsc->page_limit() ? bsc->page_limit() : kPageLimit;
uint32_t iter_limit = bsc->iter_limit() ? bsc->iter_limit() : kIterLimit;
string next_instance;
bool done = FillRouteAggregateInfoList(bsc, true, page_limit, iter_limit,
data->next_entry, data->search_string, &data->show_list,
&next_instance);
if (!next_instance.empty())
SaveContextToData(next_instance, done, data);
return done;
}

//
// Specialization of BgpShowHandler<>::FillShowList for summary introspect.
//
template <>
void BgpShowHandler<ShowRouteAggregateSummaryReq,
ShowRouteAggregateSummaryReqIterate, ShowRouteAggregateSummaryResp,
AggregateRouteEntriesInfo>::FillShowList(
ShowRouteAggregateSummaryResp *resp,
const vector<AggregateRouteEntriesInfo> &show_list) {
resp->set_aggregate_route_entries(show_list);
}

//
// Handler for ShowRouteAggregateReq.
//
void ShowRouteAggregateReq::HandleRequest() const {
RequestPipeline::PipeSpec ps(this);
RequestPipeline::StageSpec s1;
Expand Down Expand Up @@ -127,3 +177,51 @@ void ShowRouteAggregateReqIterate::HandleRequest() const {
ps.stages_.push_back(s1);
RequestPipeline rp(ps);
}

//
// Handler for ShowRouteAggregateSummaryReq.
//
void ShowRouteAggregateSummaryReq::HandleRequest() const {
RequestPipeline::PipeSpec ps(this);
RequestPipeline::StageSpec s1;
TaskScheduler *scheduler = TaskScheduler::GetInstance();

s1.taskId_ = scheduler->GetTaskId("bgp::RouteAggregate");
s1.cbFn_ = boost::bind(&BgpShowHandler<
ShowRouteAggregateSummaryReq,
ShowRouteAggregateSummaryReqIterate,
ShowRouteAggregateSummaryResp,
AggregateRouteEntriesInfo>::Callback, _1, _2, _3, _4, _5);
s1.allocFn_ = BgpShowHandler<
ShowRouteAggregateSummaryReq,
ShowRouteAggregateSummaryReqIterate,
ShowRouteAggregateSummaryResp,
AggregateRouteEntriesInfo>::CreateData;
s1.instances_.push_back(0);
ps.stages_.push_back(s1);
RequestPipeline rp(ps);
}

//
// Handler for ShowRouteAggregateSummaryReqIterate.
//
void ShowRouteAggregateSummaryReqIterate::HandleRequest() const {
RequestPipeline::PipeSpec ps(this);
RequestPipeline::StageSpec s1;
TaskScheduler *scheduler = TaskScheduler::GetInstance();

s1.taskId_ = scheduler->GetTaskId("bgp::RouteAggregate");
s1.cbFn_ = boost::bind(&BgpShowHandler<
ShowRouteAggregateSummaryReq,
ShowRouteAggregateSummaryReqIterate,
ShowRouteAggregateSummaryResp,
AggregateRouteEntriesInfo>::CallbackIterate, _1, _2, _3, _4, _5);
s1.allocFn_ = BgpShowHandler<
ShowRouteAggregateSummaryReq,
ShowRouteAggregateSummaryReqIterate,
ShowRouteAggregateSummaryResp,
AggregateRouteEntriesInfo>::CreateData;
s1.instances_.push_back(0);
ps.stages_.push_back(s1);
RequestPipeline rp(ps);
}

0 comments on commit a6be817

Please sign in to comment.