Skip to content

Commit

Permalink
Rename Layer2 to Evpn.
Browse files Browse the repository at this point in the history
Change-Id: Ife86d20b1fa324b9df558818c446b0105154f7bf
  • Loading branch information
manishsing committed Jan 12, 2015
1 parent 0834845 commit a9fa2b8
Show file tree
Hide file tree
Showing 66 changed files with 515 additions and 516 deletions.
11 changes: 5 additions & 6 deletions src/vnsw/agent/README
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,8 @@ Some of the important tables in Oper-DB are,
- VxLan-Id : VxLan-Id to be used when VxLan encapsulations is used.
- layer3_forwarding : Specifies if layer3 forwarding is enabled for
IPv4/IPv6 packets
- layer2_forwarding : Specifies if layer2 forwarding is enabled.
If layer3_forwarding is disabled, even IPv4/IPv6 packets are layer2
forwarded.
- bridging : Specifies if bridging is enabled.
If layer3_forwarding is disabled, even IPv4/IPv6 packets are bridged.

VRF
---
Expand All @@ -174,7 +173,7 @@ Some of the important tables in Oper-DB are,
Each VRF has a set of routing-tables as its members.
- Inet4 Unicast Table : Table contraining Inet4 unicast routes
- Inet4 Multicast Table : Table containing Inet4 multicast route table
- Layer2 Table : Table containing MAC addresses. The Layer2 table is
- Evpn Table : Table containing MAC addresses. The Evpn table is
currently used only in case of "native" VRF for a virtual-network.

Based on platforms, agent creates few VRF implicitly,
Expand Down Expand Up @@ -247,7 +246,7 @@ Some of the important tables in Oper-DB are,
Routes
------
Every VRF has a set of route tables for Inet4 Unicast routes, Inet4
Mulitcast routes and Layer2 MAC routes.
Mulitcast routes and Evpn MAC routes.

Every route specifies the forwarding action for a destination. Agent has
multiple modules that can have different view of forwarding action for a
Expand Down Expand Up @@ -321,7 +320,7 @@ Some of the important tables in Oper-DB are,

- Two labels are allocated for every VM Interface
* A label for layer3 packets
* A label for layer2 packets
* A label for evpn packets
- A label for every ECMP Composite Nexthop
- A label for every Multicast Composite Nexthop

Expand Down
14 changes: 7 additions & 7 deletions src/vnsw/agent/cmn/agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void intrusive_ptr_add_ref(const VxLanId* p);

class InetUnicastRouteEntry;
class Inet4MulticastRouteEntry;
class Layer2RouteEntry;
class EvpnRouteEntry;
class Route;
typedef boost::intrusive_ptr<Route> RouteRef;
void intrusive_ptr_release(const Route* p);
Expand Down Expand Up @@ -129,7 +129,7 @@ class RouteTable;
class AgentRouteTable;
class InetUnicastAgentRouteTable;
class Inet4MulticastAgentRouteTable;
class Layer2AgentRouteTable;
class EvpnAgentRouteTable;
class CfgIntTable;
class AclTable;
class MirrorTable;
Expand Down Expand Up @@ -198,7 +198,7 @@ class Agent {
INVALID = 0,
INET4_UNICAST,
INET4_MULTICAST,
LAYER2,
EVPN,
INET6_UNICAST,
ROUTE_TABLE_MAX
};
Expand Down Expand Up @@ -319,14 +319,14 @@ class Agent {
mc_rt_table_ = (Inet4MulticastAgentRouteTable *)table;
}

Layer2AgentRouteTable *fabric_l2_unicast_table() const {
EvpnAgentRouteTable *fabric_l2_unicast_table() const {
return l2_rt_table_;
}
void set_fabric_l2_unicast_table(Layer2AgentRouteTable *table) {
void set_fabric_l2_unicast_table(EvpnAgentRouteTable *table) {
l2_rt_table_ = table;
}
void set_fabric_l2_unicast_table(RouteTable *table) {
l2_rt_table_ = (Layer2AgentRouteTable *)table;
l2_rt_table_ = (EvpnAgentRouteTable *)table;
}

PhysicalDeviceTable *physical_device_table() const {
Expand Down Expand Up @@ -812,7 +812,7 @@ class Agent {
NextHopTable *nh_table_;
InetUnicastAgentRouteTable *uc_rt_table_;
Inet4MulticastAgentRouteTable *mc_rt_table_;
Layer2AgentRouteTable *l2_rt_table_;
EvpnAgentRouteTable *l2_rt_table_;
VrfTable *vrf_table_;
VmTable *vm_table_;
VnTable *vn_table_;
Expand Down
12 changes: 6 additions & 6 deletions src/vnsw/agent/controller/controller_export.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ void RouteExport::UnicastNotify(AgentXmppChannel *bgp_xmpp_peer,

if (path) {
if (state->Changed(path)) {
if (type == Agent::LAYER2) {
//In case of layer2 routes any change in vxlan id or
if (type == Agent::EVPN) {
//In case of evpn routes any change in vxlan id or
//movement of tunnelt type from vxlan to mpls should result in
//withdraw and re add of route.
bool withdraw = false;
Expand Down Expand Up @@ -246,7 +246,7 @@ void RouteExport::MulticastNotify(AgentXmppChannel *bgp_xmpp_peer,
bool route_can_be_dissociated = RouteCanDissociate(route);
const Agent *agent = bgp_xmpp_peer->agent();

if (route->GetTableType() != Agent::LAYER2)
if (route->GetTableType() != Agent::EVPN)
return;

if (route_can_be_dissociated && (state != NULL)) {
Expand All @@ -256,7 +256,7 @@ void RouteExport::MulticastNotify(AgentXmppChannel *bgp_xmpp_peer,
state->exported_ = false;
}

if ((route->GetTableType() == Agent::LAYER2) &&
if ((route->GetTableType() == Agent::EVPN) &&
(state->evpn_exported_ == true)) {
state->tunnel_type_ = TunnelType::INVALID;
AgentXmppChannel::ControllerSendEvpnRouteDelete(bgp_xmpp_peer,
Expand Down Expand Up @@ -288,7 +288,7 @@ void RouteExport::MulticastNotify(AgentXmppChannel *bgp_xmpp_peer,

// Dont register for multicast if vrouter is not present. If vrouter is
// not present, vhost interface will also be not present
if (route->GetTableType() == Agent::LAYER2 &&
if (route->GetTableType() == Agent::EVPN &&
agent->vhost_interface() == NULL) {
return;
}
Expand Down Expand Up @@ -320,7 +320,7 @@ void RouteExport::MulticastNotify(AgentXmppChannel *bgp_xmpp_peer,
TunnelType::Type new_tunnel_type = active_path->tunnel_type();
uint32_t new_label = active_path->GetActiveLabel();

if (route->GetTableType() == Agent::LAYER2) {
if (route->GetTableType() == Agent::EVPN) {
if ((state->evpn_exported_ == true) || (state->force_chg_ ==
true)) {
bool withdraw = false;
Expand Down
30 changes: 15 additions & 15 deletions src/vnsw/agent/controller/controller_peer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ void AgentXmppChannel::ReceiveEvpnUpdate(XmlPugi *pugi) {
strtok_r(NULL, "/", &saveptr);
char *vrf_name = strtok_r(NULL, "", &saveptr);
const std::string vrf(vrf_name);
Layer2AgentRouteTable *rt_table =
static_cast<Layer2AgentRouteTable *>
(agent_->vrf_table()->GetLayer2RouteTable(vrf_name));
EvpnAgentRouteTable *rt_table =
static_cast<EvpnAgentRouteTable *>
(agent_->vrf_table()->GetEvpnRouteTable(vrf_name));
if (rt_table == NULL) {
CONTROLLER_TRACE(Trace, GetBgpPeerName(), vrf_name,
"Invalid VRF. Ignoring route retract" +
Expand Down Expand Up @@ -695,9 +695,9 @@ void AgentXmppChannel::AddEvpnRoute(const std::string &vrf_name,
std::string mac_str,
EnetItemType *item) {
// Validate VRF first
Layer2AgentRouteTable *rt_table =
static_cast<Layer2AgentRouteTable *>
(agent_->vrf_table()->GetLayer2RouteTable(vrf_name));
EvpnAgentRouteTable *rt_table =
static_cast<EvpnAgentRouteTable *>
(agent_->vrf_table()->GetEvpnRouteTable(vrf_name));
if (rt_table == NULL) {
CONTROLLER_TRACE(Trace, GetBgpPeerName(), vrf_name,
"Invalid VRF. Ignoring route");
Expand Down Expand Up @@ -762,9 +762,9 @@ void AgentXmppChannel::AddEvpnRoute(const std::string &vrf_name,
return;
}

Layer2RouteKey key(agent_->local_vm_peer(), vrf_name, mac,
EvpnRouteKey key(agent_->local_vm_peer(), vrf_name, mac,
ip_addr, item->entry.nlri.ethernet_tag);
Layer2RouteEntry *route = static_cast<Layer2RouteEntry *>
EvpnRouteEntry *route = static_cast<EvpnRouteEntry *>
(rt_table->FindActiveEntry(&key));
if (route == NULL) {
CONTROLLER_TRACE(Trace, GetBgpPeerName(), vrf_name,
Expand All @@ -779,11 +779,11 @@ void AgentXmppChannel::AddEvpnRoute(const std::string &vrf_name,
return;
}

// We expect only INTERFACE nexthop for layer2 routes
// We expect only INTERFACE nexthop for evpn routes
const InterfaceNH *intf_nh = dynamic_cast<const InterfaceNH *>(nh);
if (nh->GetType() != NextHop::INTERFACE) {
CONTROLLER_TRACE(Trace, GetBgpPeerName(), vrf_name,
"Invalid nexthop in layer2 route");
"Invalid nexthop in evpn route");
return;
}

Expand All @@ -797,7 +797,7 @@ void AgentXmppChannel::AddEvpnRoute(const std::string &vrf_name,
MplsTable::kInvalidLabel,
label, false,
item->entry.virtual_network,
InterfaceNHFlags::LAYER2,
InterfaceNHFlags::BRIDGE,
sg_list, path_preference,
unicast_sequence_number(),
this);
Expand All @@ -808,7 +808,7 @@ void AgentXmppChannel::AddEvpnRoute(const std::string &vrf_name,
VxLanTable::kInvalidvxlan_id,
false,
item->entry.virtual_network,
InterfaceNHFlags::LAYER2,
InterfaceNHFlags::BRIDGE,
sg_list, path_preference,
unicast_sequence_number(),
this);
Expand Down Expand Up @@ -1726,7 +1726,7 @@ bool AgentXmppChannel::ControllerSendEvpnRouteCommon(AgentRoute *route,
stringstream rstr;
rstr << route->ToString();
item.entry.nlri.mac = rstr.str();
Layer2RouteEntry *l2_route = static_cast<Layer2RouteEntry *>(route);
EvpnRouteEntry *l2_route = static_cast<EvpnRouteEntry *>(route);
rstr.str("");
rstr << l2_route->ip_addr().to_string() << "/"
<< l2_route->GetVmIpPlen();
Expand Down Expand Up @@ -2000,7 +2000,7 @@ bool AgentXmppChannel::ControllerSendRouteAdd(AgentXmppChannel *peer,
path_preference, true,
type);
}
if (type == Agent::LAYER2) {
if (type == Agent::EVPN) {
ret = peer->ControllerSendEvpnRouteCommon(route, nexthop_ip, vn,
sg_list, label, bmap, true);
}
Expand Down Expand Up @@ -2034,7 +2034,7 @@ bool AgentXmppChannel::ControllerSendRouteDelete(AgentXmppChannel *peer,
false,
type);
}
if (type == Agent::LAYER2) {
if (type == Agent::EVPN) {
Ip4Address nh_ip(0);
ret = peer->ControllerSendEvpnRouteCommon(route, &nh_ip, vn, NULL,
label, bmap, false);
Expand Down
2 changes: 1 addition & 1 deletion src/vnsw/agent/init/agent_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void AgentInit::CreateVrfBase() {
agent_->set_fabric_inet4_unicast_table(vrf->GetInet4UnicastRouteTable());
agent_->set_fabric_inet4_multicast_table
(vrf->GetInet4MulticastRouteTable());
agent_->set_fabric_l2_unicast_table(vrf->GetLayer2RouteTable());
agent_->set_fabric_l2_unicast_table(vrf->GetEvpnRouteTable());

CreateVrf();
}
Expand Down
2 changes: 1 addition & 1 deletion src/vnsw/agent/oper/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ vnswoperdb = env.Library('vnswoperdb',
'inet4_multicast_route.cc',
'inet_unicast_route.cc',
'interface.cc',
'layer2_route.cc',
'evpn_route.cc',
'loadbalancer.cc',
'loadbalancer_haproxy.cc',
'loadbalancer_properties.cc',
Expand Down
4 changes: 2 additions & 2 deletions src/vnsw/agent/oper/agent.sandesh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ struct VnSandeshData {
6: string vrf_name (link="VrfListReq"); // VRF name
7: list<VnIpamData> ipam_data;
8: list<VnIpamHostRoutes> ipam_host_routes;
9: bool layer2_forwarding;
9: bool bridging;
10: bool ipv4_forwarding;
11: bool admin_state;
12: i32 vxlan_id;
Expand Down Expand Up @@ -841,7 +841,7 @@ struct VnObjectLogInfo {
7: optional string vrf;
8: optional list <VnObjectLogIpam> ipam_list;
9: optional bool ipv4_forwarding;
10: optional bool layer2_forwarding;
10: optional bool bridging;
11: optional bool admin_state;
}

Expand Down
2 changes: 1 addition & 1 deletion src/vnsw/agent/oper/agent_route.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const string &AgentRouteTable::GetSuffix(Agent::RouteTableType type) {
return uc_suffix;
case Agent::INET4_MULTICAST:
return mc_suffix;
case Agent::LAYER2:
case Agent::EVPN:
return l2_suffix;
case Agent::INET6_UNICAST:
return uc_inet6_suffix;
Expand Down
2 changes: 1 addition & 1 deletion src/vnsw/agent/oper/agent_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct RouteTableWalkerState {
};

// Agent implements multiple route tables - inet4-unicast, inet4-multicast,
// layer2. This base class contains common code for all route tables
// evpn. This base class contains common code for all route tables
class AgentRouteTable : public RouteTable {
public:
typedef std::set<const AgentRoute *, RouteComparator> UnresolvedRouteTree;
Expand Down
2 changes: 1 addition & 1 deletion src/vnsw/agent/oper/agent_sandesh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ bool AgentInet4McRtSandesh::UpdateResp(DBEntryBase *entry) {
}

DBTable *AgentLayer2RtSandesh::AgentGetTable() {
return static_cast<DBTable *>(vrf_->GetLayer2RouteTable());
return static_cast<DBTable *>(vrf_->GetEvpnRouteTable());
}

void AgentLayer2RtSandesh::Alloc() {
Expand Down

0 comments on commit a9fa2b8

Please sign in to comment.