From 4b1d1ce53ba37c2dd46639866325c05fc1144d82 Mon Sep 17 00:00:00 2001 From: Manish Date: Fri, 13 May 2016 13:47:27 +0530 Subject: [PATCH] Vrf pending because of mpls label. Problem: MPLS label was pending pointing to Composite NH. This NH holds reference to VRF. This label was programmed because adding EVPN path in multicast route vxlan tag was added as ethernet identifier and label as well. When all routes except evpn peer path is gone this vxlan tag (which was copied in label) gets copied to master path which in turn tries to rebake NH for this label. EVPN mpls label should only be picked from local path or local vm peer path. Solution: Pass invalid label for evpn path. Change-Id: Ia685e9179cb710ce3d0a38ee90330e19bb590ac7 Closes-bug: #1577517 --- src/vnsw/agent/oper/multicast.cc | 2 +- src/vnsw/agent/test/test_l2route.cc | 64 +++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/src/vnsw/agent/oper/multicast.cc b/src/vnsw/agent/oper/multicast.cc index 0fc4f6b4921..7e344be04b1 100644 --- a/src/vnsw/agent/oper/multicast.cc +++ b/src/vnsw/agent/oper/multicast.cc @@ -664,7 +664,7 @@ void MulticastHandler::ModifyEvpnMembers(const Peer *peer, TriggerRemoteRouteChange(obj, peer, vrf_name, olist, peer_identifier, delete_op, Composite::EVPN, - ethernet_tag, false, ethernet_tag); + MplsTable::kInvalidLabel, false, ethernet_tag); MCTRACE(Log, "Add EVPN TOR Olist ", vrf_name, grp.to_string(), 0); } diff --git a/src/vnsw/agent/test/test_l2route.cc b/src/vnsw/agent/test/test_l2route.cc index 10104ef1970..cc968868e39 100644 --- a/src/vnsw/agent/test/test_l2route.cc +++ b/src/vnsw/agent/test/test_l2route.cc @@ -1651,6 +1651,70 @@ TEST_F(RouteTest, SquashPathTest_1) { client->WaitForIdle(); } +//Bug# 1580733 +TEST_F(RouteTest, label_in_evpn_mcast_path) { + struct PortInfo input[] = { + {"vnet1", 1, "1.1.1.10", "00:00:00:01:01:01", 1, 1}, + }; + + client->Reset(); + //Add VM + CreateVmportEnv(input, 1); + client->WaitForIdle(); + + BridgeRouteEntry *rt = L2RouteGet("vrf1", + MacAddress::FromString("00:00:00:01:01:01"), + Ip4Address(0)); + EXPECT_TRUE(rt != NULL); + uint32_t mpls_label = rt->GetActivePath()->label(); + //Add a peer and enqueue path add in multicast route. + BgpPeer *bgp_peer_ptr = CreateBgpPeer(Ip4Address(1), "BGP Peer1"); + boost::shared_ptr bgp_peer = + bgp_peer_ptr->GetBgpXmppPeer()->bgp_peer_id_ref(); + MulticastHandler *mc_handler = static_cast(agent_-> + oper_db()->multicast()); + TunnelOlist olist; + olist.push_back(OlistTunnelEntry(nil_uuid(), 10, + IpAddress::from_string("8.8.8.8").to_v4(), + TunnelType::VxlanType())); + //Add EVPN olist + mc_handler->ModifyEvpnMembers(bgp_peer.get(), + "vrf1", + olist, + mpls_label, + 1); + client->WaitForIdle(); + agent_->oper_db()->multicast()->DeleteBroadcast(agent_->local_vm_peer(), "vrf1", + 0, Composite::L2INTERFACE); + BridgeAgentRouteTable::DeleteBroadcastReq(agent_->local_peer(), + "vrf1", + 0, + Composite::L2COMP); + client->WaitForIdle(); + rt = L2RouteGet("vrf1", + MacAddress::FromString("ff:ff:ff:ff:ff:ff"), + Ip4Address(0)); + EXPECT_TRUE(rt != NULL); + + //Delete VM + DeleteVmportEnv(input, 1, false); + client->WaitForIdle(); + + //Delete EVPN + TunnelOlist del_olist; + mc_handler->ModifyEvpnMembers(bgp_peer.get(), + "vrf1", + del_olist, + mpls_label, + ControllerPeerPath::kInvalidPeerIdentifier); + client->WaitForIdle(); + DeleteVmportEnv(input, 1, true); + client->WaitForIdle(); + DeleteBgpPeer(bgp_peer.get()); + client->WaitForIdle(); + bgp_peer.reset(); +} + int main(int argc, char *argv[]) { ::testing::InitGoogleTest(&argc, argv); GETUSERARGS();