Skip to content

Commit

Permalink
Do not allocate mpls label in case of fabric_port
Browse files Browse the repository at this point in the history
  • Loading branch information
haripk committed Jan 16, 2014
1 parent daa6651 commit 7e4ae7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/vnsw/agent/oper/vm_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@ bool VmInterface::Resync(VmInterfaceData *data) {
VrfEntryRef old_vrf = vrf_;
Ip4Address old_addr = ip_addr_;
int old_vxlan_id = vxlan_id_;
bool old_fabric_port = fabric_port_;
bool old_need_linklocal_ip = need_linklocal_ip_;
bool sg_changed = false;

Expand Down Expand Up @@ -591,8 +590,7 @@ bool VmInterface::Resync(VmInterfaceData *data) {

// Apply config based on old and new values
ApplyConfig(old_ipv4_active, old_l2_active, old_policy, old_vrf.get(),
old_addr, old_vxlan_id, old_fabric_port,
old_need_linklocal_ip, sg_changed);
old_addr, old_vxlan_id, old_need_linklocal_ip, sg_changed);

return ret;
}
Expand All @@ -603,8 +601,7 @@ void VmInterface::Delete() {
ipv4_active_ = false;
l2_active_ = false;
ApplyConfig(old_ipv4_active, old_l2_active, policy_enabled_,
vrf_.get(), ip_addr_, vxlan_id_, fabric_port_,
need_linklocal_ip_, false);
vrf_.get(), ip_addr_, vxlan_id_, need_linklocal_ip_, false);
InterfaceNH::DeleteVmInterfaceNHReq(GetUuid());
}

Expand Down Expand Up @@ -805,8 +802,8 @@ void VmInterface::DeleteL2(bool old_l2_active, VrfEntry *old_vrf) {
// Apply the latest configuration
void VmInterface::ApplyConfig(bool old_ipv4_active, bool old_l2_active, bool old_policy,
VrfEntry *old_vrf, const Ip4Address &old_addr,
int old_vxlan_id, bool old_fabric_port,
bool old_need_linklocal_ip, bool sg_changed) {
int old_vxlan_id, bool old_need_linklocal_ip,
bool sg_changed) {
// Update services flag based on l3 active state
UpdateL3Services(ipv4_forwarding_);

Expand Down Expand Up @@ -893,7 +890,7 @@ bool VmInterface::ResyncIpAddress(const VmInterfaceIpAddressData *data) {

ipv4_active_ = IsL3Active();
ApplyConfig(old_ipv4_active, l2_active_, policy_enabled_, vrf_.get(), old_addr,
vxlan_id_, fabric_port_, need_linklocal_ip_, false);
vxlan_id_, need_linklocal_ip_, false);
return ret;
}

Expand Down Expand Up @@ -1009,6 +1006,9 @@ bool VmInterface::IsVxlanMode() const {

// Allocate MPLS Label for Layer3 routes
void VmInterface::AllocL3MplsLabel(bool force_update, bool policy_change) {
if (fabric_port_)
return;

bool new_entry = false;
if (label_ == MplsTable::kInvalidLabel) {
Agent *agent = static_cast<InterfaceTable *>(get_table())->agent();
Expand Down
4 changes: 2 additions & 2 deletions src/vnsw/agent/oper/vm_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ class VmInterface : public Interface {
bool CopyConfig(VmInterfaceConfigData *data, bool *sg_changed);
void ApplyConfig(bool old_ipv4_active,bool old_l2_active, bool old_policy,
VrfEntry *old_vrf, const Ip4Address &old_addr,
int old_vxlan_id, bool old_fabric_port,
bool old_need_linklocal_ip, bool sg_changed);
int old_vxlan_id, bool old_need_linklocal_ip,
bool sg_changed);

void UpdateL3(bool old_ipv4_active, VrfEntry *old_vrf,
const Ip4Address &old_addr, int old_vxlan_id,
Expand Down

0 comments on commit 7e4ae7b

Please sign in to comment.