Skip to content

Commit 979a7fd

Browse files
mint570divyagayathri-hcl
authored andcommitted
Add tunnel->neighbor reference.
Signed-off-by: mint570 <[email protected]>
1 parent e367e3a commit 979a7fd

3 files changed

Lines changed: 169 additions & 66 deletions

File tree

orchagent/p4orch/gre_tunnel_manager.cpp

Lines changed: 59 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -104,24 +104,21 @@ ReturnCode GreTunnelManager::validateGreTunnelAppDbEntry(
104104
}
105105

106106
ReturnCode GreTunnelManager::validateGreTunnelAppDbEntry(
107-
const P4GreTunnelAppDbEntry& app_db_entry,
108-
const std::string& operation) {
107+
const P4GreTunnelAppDbEntry& app_db_entry, const std::string& operation) {
109108
SWSS_LOG_ENTER();
110109

111-
P4GreTunnelEntry entry = P4GreTunnelEntry(app_db_entry.tunnel_id,
112-
app_db_entry.router_interface_id,
113-
app_db_entry.encap_src_ip,
114-
app_db_entry.encap_dst_ip,
115-
app_db_entry.encap_dst_ip);
110+
P4GreTunnelEntry entry =
111+
P4GreTunnelEntry(app_db_entry.tunnel_id, app_db_entry.router_interface_id,
112+
app_db_entry.encap_src_ip, app_db_entry.encap_dst_ip,
113+
app_db_entry.encap_dst_ip);
116114

117115
const auto router_interface_key =
118116
KeyGenerator::generateRouterInterfaceKey(entry.router_interface_id);
119117

120118
if (operation == SET_COMMAND) {
121119
RETURN_IF_ERROR(validateGreTunnelAppDbEntry(app_db_entry));
122120
if (getGreTunnelEntry(entry.tunnel_key) == nullptr) {
123-
if (m_p4OidMapper->existsOID(
124-
SAI_OBJECT_TYPE_TUNNEL, entry.tunnel_key)) {
121+
if (m_p4OidMapper->existsOID(SAI_OBJECT_TYPE_TUNNEL, entry.tunnel_key)) {
125122
RETURN_INTERNAL_ERROR_AND_RAISE_CRITICAL(
126123
"GRE tunnel with key " << QuotedVar(entry.tunnel_key)
127124
<< " already exists in centralized mapper");
@@ -137,6 +134,18 @@ ReturnCode GreTunnelManager::validateGreTunnelAppDbEntry(
137134
<< QuotedVar(entry.router_interface_id)
138135
<< " does not exist");
139136
}
137+
// From centralized mapper, get neighbor key that GRE tunnel
138+
// depends on.
139+
const auto neighbor_key = KeyGenerator::generateNeighborKey(
140+
entry.router_interface_id, entry.neighbor_id);
141+
if (!m_p4OidMapper->existsOID(SAI_OBJECT_TYPE_NEIGHBOR_ENTRY,
142+
neighbor_key)) {
143+
LOG_ERROR_AND_RETURN(
144+
ReturnCode(StatusCode::SWSS_RC_NOT_FOUND)
145+
<< "Neighbor with rif=" << QuotedVar(entry.router_interface_id)
146+
<< ", neighbor_ip=" << QuotedVar(entry.neighbor_id.to_string())
147+
<< " does not exist");
148+
}
140149
}
141150
} else if (operation == DEL_COMMAND) {
142151
// Check the existence of the GRE tunnel in GRE tunnel manager and
@@ -157,10 +166,10 @@ ReturnCode GreTunnelManager::validateGreTunnelAppDbEntry(
157166
<< QuotedVar(entry.tunnel_key));
158167
}
159168
if (ref_count > 0) {
160-
LOG_ERROR_AND_RETURN(
161-
ReturnCode(StatusCode::SWSS_RC_INVALID_PARAM)
162-
<< "GRE tunnel " << QuotedVar(entry.tunnel_key)
163-
<< " referenced by other objects (ref_count = " << ref_count);
169+
LOG_ERROR_AND_RETURN(ReturnCode(StatusCode::SWSS_RC_INVALID_PARAM)
170+
<< "GRE tunnel " << QuotedVar(entry.tunnel_key)
171+
<< " referenced by other objects (ref_count = "
172+
<< ref_count);
164173
}
165174
}
166175

@@ -268,13 +277,13 @@ ReturnCode GreTunnelManager::drain() {
268277

269278
if (operation == SET_COMMAND && update) {
270279
status = ReturnCode(StatusCode::SWSS_RC_UNIMPLEMENTED)
271-
<< "Currently GRE tunnel doesn't support update by SAI."
272-
<< "GRE tunnel key " << QuotedVar(tunnel_key);
280+
<< "Currently GRE tunnel doesn't support update by SAI."
281+
<< "GRE tunnel key " << QuotedVar(tunnel_key);
273282
SWSS_LOG_ERROR("%s", status.message().c_str());
274283

275284
m_publisher->publish(APP_P4RT_TABLE_NAME, kfvKey(key_op_fvs_tuple),
276285
kfvFieldsValues(key_op_fvs_tuple), status,
277-
/*replace=*/true);
286+
/*replace=*/true);
278287
break;
279288
} else {
280289
entry_list.push_back(app_db_entry);
@@ -381,27 +390,25 @@ std::vector<ReturnCode> GreTunnelManager::createGreTunnels(
381390
std::vector<P4GreTunnelEntry> entries;
382391
std::vector<std::string> router_interface_keys(gre_tunnel_entries.size());
383392
std::vector<sai_object_id_t> tunnel_oids(gre_tunnel_entries.size());
384-
std::vector<std::vector<sai_attribute_t>>
385-
sai_attrs(gre_tunnel_entries.size());
393+
std::vector<std::vector<sai_attribute_t>> sai_attrs(
394+
gre_tunnel_entries.size());
386395
std::vector<uint32_t> attrs_cnt(gre_tunnel_entries.size());
387396
std::vector<const sai_attribute_t*> attrs_ptr(gre_tunnel_entries.size());
388397
std::vector<sai_status_t> object_statuses(gre_tunnel_entries.size());
389398
std::vector<ReturnCode> statuses(gre_tunnel_entries.size());
390399

391400
for (size_t i = 0; i < gre_tunnel_entries.size(); ++i) {
392401
statuses[i] = StatusCode::SWSS_RC_UNKNOWN;
393-
entries.push_back(
394-
P4GreTunnelEntry(gre_tunnel_entries[i].tunnel_id,
395-
gre_tunnel_entries[i].router_interface_id,
396-
gre_tunnel_entries[i].encap_src_ip,
397-
gre_tunnel_entries[i].encap_dst_ip,
398-
gre_tunnel_entries[i].encap_dst_ip));
402+
entries.push_back(P4GreTunnelEntry(
403+
gre_tunnel_entries[i].tunnel_id,
404+
gre_tunnel_entries[i].router_interface_id,
405+
gre_tunnel_entries[i].encap_src_ip, gre_tunnel_entries[i].encap_dst_ip,
406+
gre_tunnel_entries[i].encap_dst_ip));
399407

400408
// From centralized mapper, get OID of router interface that GRE tunnel
401409
// depends on.
402-
router_interface_keys[i] =
403-
KeyGenerator::generateRouterInterfaceKey(
404-
entries[i].router_interface_id);
410+
router_interface_keys[i] = KeyGenerator::generateRouterInterfaceKey(
411+
entries[i].router_interface_id);
405412
m_p4OidMapper->getOID(SAI_OBJECT_TYPE_ROUTER_INTERFACE,
406413
router_interface_keys[i],
407414
&entries[i].underlay_if_oid);
@@ -419,13 +426,10 @@ std::vector<ReturnCode> GreTunnelManager::createGreTunnels(
419426

420427

421428
// Call bulk SAI API.
422-
sai_tunnel_api->create_tunnels(gSwitchId,
423-
(uint32_t)entries.size(),
424-
attrs_cnt.data(),
425-
attrs_ptr.data(),
429+
sai_tunnel_api->create_tunnels(gSwitchId, (uint32_t)entries.size(),
430+
attrs_cnt.data(), attrs_ptr.data(),
426431
SAI_BULK_OP_ERROR_MODE_STOP_ON_ERROR,
427-
tunnel_oids.data(),
428-
object_statuses.data());
432+
tunnel_oids.data(), object_statuses.data());
429433

430434
for (size_t i = 0; i < gre_tunnel_entries.size(); ++i) {
431435
CHECK_ERROR_AND_LOG(object_statuses[i],
@@ -441,6 +445,12 @@ std::vector<ReturnCode> GreTunnelManager::createGreTunnels(
441445
m_p4OidMapper->increaseRefCount(SAI_OBJECT_TYPE_ROUTER_INTERFACE,
442446
router_interface_keys[i]);
443447

448+
// On successful creation, increment ref count on neighbor object.
449+
m_p4OidMapper->increaseRefCount(
450+
SAI_OBJECT_TYPE_NEIGHBOR_ENTRY,
451+
KeyGenerator::generateNeighborKey(entries[i].router_interface_id,
452+
entries[i].neighbor_id));
453+
444454
// Add created entry to internal table.
445455
m_greTunnelTable.emplace(entries[i].tunnel_key, entries[i]);
446456

@@ -478,24 +488,27 @@ std::vector<ReturnCode> GreTunnelManager::removeGreTunnels(
478488
}
479489

480490
// Call bulk SAI API.
481-
sai_tunnel_api->remove_tunnels((uint32_t)gre_tunnel_entries.size(),
482-
tunnel_oids.data(),
483-
SAI_BULK_OP_ERROR_MODE_STOP_ON_ERROR,
484-
object_statuses.data());
491+
sai_tunnel_api->remove_tunnels(
492+
(uint32_t)gre_tunnel_entries.size(), tunnel_oids.data(),
493+
SAI_BULK_OP_ERROR_MODE_STOP_ON_ERROR, object_statuses.data());
485494

486495
for (size_t i = 0; i < gre_tunnel_entries.size(); ++i) {
487-
CHECK_ERROR_AND_LOG(object_statuses[i],
488-
"Failed to remove GRE tunnel "
489-
<< QuotedVar(entries[i]->tunnel_key));
496+
CHECK_ERROR_AND_LOG(
497+
object_statuses[i],
498+
"Failed to remove GRE tunnel " << QuotedVar(entries[i]->tunnel_key));
490499

491500
if (object_statuses[i] == SAI_STATUS_SUCCESS) {
492501
statuses[i] = StatusCode::SWSS_RC_SUCCESS;
493502

494503
// On successful deletion, decrement ref count.
504+
m_p4OidMapper->decreaseRefCount(SAI_OBJECT_TYPE_ROUTER_INTERFACE,
505+
KeyGenerator::generateRouterInterfaceKey(
506+
entries[i]->router_interface_id));
507+
// On successful deletion, decrement ref count on Neighbor Key.
495508
m_p4OidMapper->decreaseRefCount(
496-
SAI_OBJECT_TYPE_ROUTER_INTERFACE,
497-
KeyGenerator::generateRouterInterfaceKey(
498-
entries[i]->router_interface_id));
509+
SAI_OBJECT_TYPE_NEIGHBOR_ENTRY,
510+
KeyGenerator::generateNeighborKey(entries[i]->router_interface_id,
511+
entries[i]->neighbor_id));
499512

500513
// Remove the key to OID map to centralized mapper.
501514
m_p4OidMapper->eraseOID(SAI_OBJECT_TYPE_TUNNEL, entries[i]->tunnel_key);
@@ -527,8 +540,9 @@ ReturnCode GreTunnelManager::processEntries(
527540
} else {
528541
// Should never happen, as validateGreTunnelAppDbEntry() should fail if
529542
// the operation is update.
530-
LOG_ERROR_AND_RETURN(ReturnCode(StatusCode::SWSS_RC_UNIMPLEMENTED)
531-
<< "Currently GRE tunnel doesn't support update by SAI.");
543+
LOG_ERROR_AND_RETURN(
544+
ReturnCode(StatusCode::SWSS_RC_UNIMPLEMENTED)
545+
<< "Currently GRE tunnel doesn't support update by SAI.");
532546
}
533547
} else {
534548
statuses = removeGreTunnels(entries);

orchagent/p4orch/tests/gre_tunnel_manager_test.cpp

Lines changed: 98 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,26 @@ class GreTunnelManagerTest : public ::testing::Test
349349

350350
P4GreTunnelEntry *GreTunnelManagerTest::AddGreTunnelEntry1()
351351
{
352-
const auto gre_tunnel_key = KeyGenerator::generateTunnelKey(kP4GreTunnelAppDbEntry1.tunnel_id);
352+
const std::string neighbor_key = KeyGenerator::generateNeighborKey(
353+
kP4GreTunnelAppDbEntry1.router_interface_id,
354+
kP4GreTunnelAppDbEntry1.encap_dst_ip);
355+
EXPECT_TRUE(
356+
p4_oid_mapper_.setDummyOID(SAI_OBJECT_TYPE_NEIGHBOR_ENTRY, neighbor_key));
357+
uint32_t original_neighbor_ref_count;
358+
EXPECT_TRUE(p4_oid_mapper_.getRefCount(SAI_OBJECT_TYPE_NEIGHBOR_ENTRY,
359+
neighbor_key,
360+
&original_neighbor_ref_count));
361+
const std::string rif_key = KeyGenerator::generateRouterInterfaceKey(
362+
kP4GreTunnelAppDbEntry1.router_interface_id);
353363
EXPECT_TRUE(p4_oid_mapper_.setOID(SAI_OBJECT_TYPE_ROUTER_INTERFACE,
354364
KeyGenerator::generateRouterInterfaceKey(kRouterInterfaceId1),
355365
kRouterInterfaceOid1));
366+
uint32_t original_rif_ref_count;
367+
EXPECT_TRUE(p4_oid_mapper_.getRefCount(SAI_OBJECT_TYPE_ROUTER_INTERFACE,
368+
rif_key, &original_rif_ref_count));
356369

370+
const std::string gre_tunnel_key =
371+
KeyGenerator::generateTunnelKey(kP4GreTunnelAppDbEntry1.tunnel_id);
357372
std::vector<sai_status_t> exp_status{SAI_STATUS_SUCCESS};
358373
// Set up mock call.
359374
EXPECT_CALL(
@@ -373,6 +388,10 @@ P4GreTunnelEntry *GreTunnelManagerTest::AddGreTunnelEntry1()
373388
std::vector<P4GreTunnelAppDbEntry>{kP4GreTunnelAppDbEntry1}),
374389
ArrayEq(std::vector<StatusCode>{StatusCode::SWSS_RC_SUCCESS}));
375390

391+
EXPECT_TRUE(ValidateRefCnt(SAI_OBJECT_TYPE_NEIGHBOR_ENTRY, neighbor_key,
392+
original_neighbor_ref_count + 1));
393+
EXPECT_TRUE(ValidateRefCnt(SAI_OBJECT_TYPE_ROUTER_INTERFACE, rif_key,
394+
original_rif_ref_count + 1));
376395
return GetGreTunnelEntry(gre_tunnel_key);
377396
}
378397

@@ -553,6 +572,11 @@ TEST_F(GreTunnelManagerTest, ValidateGreTunnelAppDbEntryValidSetEntry) {
553572
SAI_OBJECT_TYPE_ROUTER_INTERFACE,
554573
KeyGenerator::generateRouterInterfaceKey(kRouterInterfaceId1),
555574
kRouterInterfaceOid1));
575+
EXPECT_TRUE(p4_oid_mapper_.setDummyOID(
576+
SAI_OBJECT_TYPE_NEIGHBOR_ENTRY,
577+
KeyGenerator::generateNeighborKey(
578+
kP4GreTunnelAppDbEntry1.router_interface_id,
579+
kP4GreTunnelAppDbEntry1.encap_dst_ip)));
556580

557581
EXPECT_TRUE(
558582
ValidateGreTunnelAppDbEntry(kP4GreTunnelAppDbEntry1, SET_COMMAND).ok());
@@ -694,6 +718,10 @@ TEST_F(GreTunnelManagerTest, DrainDeleteRequestShouldSucceedForExistingGreTunnel
694718
kP4GreTunnelAppDbEntry1.router_interface_id);
695719
EXPECT_TRUE(ValidateRefCnt(SAI_OBJECT_TYPE_ROUTER_INTERFACE,
696720
router_interface_key, 0));
721+
const auto neighbor_key = KeyGenerator::generateNeighborKey(
722+
kP4GreTunnelAppDbEntry1.router_interface_id,
723+
kP4GreTunnelAppDbEntry1.encap_dst_ip);
724+
EXPECT_TRUE(ValidateRefCnt(SAI_OBJECT_TYPE_NEIGHBOR_ENTRY, neighbor_key, 0));
697725
}
698726

699727
TEST_F(GreTunnelManagerTest, DrainValidAppEntryShouldSucceed)
@@ -706,6 +734,19 @@ TEST_F(GreTunnelManagerTest, DrainValidAppEntryShouldSucceed)
706734
EXPECT_TRUE(p4_oid_mapper_.setOID(SAI_OBJECT_TYPE_ROUTER_INTERFACE,
707735
router_interface_key,
708736
kRouterInterfaceOid1));
737+
uint32_t original_rif_ref_count;
738+
EXPECT_TRUE(p4_oid_mapper_.getRefCount(SAI_OBJECT_TYPE_ROUTER_INTERFACE,
739+
router_interface_key,
740+
&original_rif_ref_count));
741+
const auto neighbor_key = KeyGenerator::generateNeighborKey(
742+
kP4GreTunnelAppDbEntry1.router_interface_id,
743+
kP4GreTunnelAppDbEntry1.encap_dst_ip);
744+
EXPECT_TRUE(
745+
p4_oid_mapper_.setDummyOID(SAI_OBJECT_TYPE_NEIGHBOR_ENTRY, neighbor_key));
746+
uint32_t original_neighbor_ref_count;
747+
EXPECT_TRUE(p4_oid_mapper_.getRefCount(SAI_OBJECT_TYPE_NEIGHBOR_ENTRY,
748+
neighbor_key,
749+
&original_neighbor_ref_count));
709750
std::vector<swss::FieldValueTuple> fvs{
710751
{p4orch::kAction, p4orch::kTunnelAction},
711752
{prependParamField(p4orch::kRouterInterfaceId), kP4GreTunnelAppDbEntry1.router_interface_id},
@@ -733,7 +774,9 @@ TEST_F(GreTunnelManagerTest, DrainValidAppEntryShouldSucceed)
733774
EXPECT_TRUE(p4_oid_mapper_.existsOID(SAI_OBJECT_TYPE_TUNNEL, gre_tunnel_key));
734775

735776
EXPECT_TRUE(ValidateRefCnt(SAI_OBJECT_TYPE_ROUTER_INTERFACE,
736-
router_interface_key, 1));
777+
router_interface_key, original_rif_ref_count + 1));
778+
EXPECT_TRUE(ValidateRefCnt(SAI_OBJECT_TYPE_NEIGHBOR_ENTRY, neighbor_key,
779+
original_neighbor_ref_count + 1));
737780
}
738781

739782
TEST_F(GreTunnelManagerTest, DrainInvalidAppEntryShouldFail)
@@ -934,19 +977,45 @@ TEST_F(GreTunnelManagerTest, DrainNotExecuted) {
934977
}
935978

936979
TEST_F(GreTunnelManagerTest, DrainStopOnFirstFailureCreate) {
980+
EXPECT_TRUE(p4_oid_mapper_.setDummyOID(
981+
SAI_OBJECT_TYPE_NEIGHBOR_ENTRY,
982+
KeyGenerator::generateNeighborKey(
983+
kP4GreTunnelAppDbEntry1.router_interface_id,
984+
kP4GreTunnelAppDbEntry1.encap_dst_ip)));
985+
EXPECT_TRUE(p4_oid_mapper_.setDummyOID(
986+
SAI_OBJECT_TYPE_NEIGHBOR_ENTRY,
987+
KeyGenerator::generateNeighborKey(
988+
kP4GreTunnelAppDbEntry3.router_interface_id,
989+
kP4GreTunnelAppDbEntry3.encap_dst_ip)));
990+
const std::string neighbor_key = KeyGenerator::generateNeighborKey(
991+
kP4GreTunnelAppDbEntry2.router_interface_id,
992+
kP4GreTunnelAppDbEntry2.encap_dst_ip);
993+
EXPECT_TRUE(
994+
p4_oid_mapper_.setDummyOID(SAI_OBJECT_TYPE_NEIGHBOR_ENTRY, neighbor_key));
995+
uint32_t original_neighbor_ref_count;
996+
EXPECT_TRUE(p4_oid_mapper_.getRefCount(SAI_OBJECT_TYPE_NEIGHBOR_ENTRY,
997+
neighbor_key,
998+
&original_neighbor_ref_count));
999+
const std::string router_interface_key_2 =
1000+
KeyGenerator::generateRouterInterfaceKey(kRouterInterfaceId2);
1001+
9371002
EXPECT_TRUE(p4_oid_mapper_.setOID(
9381003
SAI_OBJECT_TYPE_ROUTER_INTERFACE,
9391004
KeyGenerator::generateRouterInterfaceKey(kRouterInterfaceId1),
9401005
kRouterInterfaceOid1));
941-
EXPECT_TRUE(p4_oid_mapper_.setOID(
942-
SAI_OBJECT_TYPE_ROUTER_INTERFACE,
943-
KeyGenerator::generateRouterInterfaceKey(kRouterInterfaceId2),
944-
kRouterInterfaceOid2));
1006+
EXPECT_TRUE(p4_oid_mapper_.setOID(SAI_OBJECT_TYPE_ROUTER_INTERFACE,
1007+
router_interface_key_2,
1008+
kRouterInterfaceOid2));
9451009
EXPECT_TRUE(p4_oid_mapper_.setOID(
9461010
SAI_OBJECT_TYPE_ROUTER_INTERFACE,
9471011
KeyGenerator::generateRouterInterfaceKey(kRouterInterfaceId3),
9481012
kRouterInterfaceOid3));
9491013

1014+
uint32_t original_rif_ref_count;
1015+
EXPECT_TRUE(p4_oid_mapper_.getRefCount(SAI_OBJECT_TYPE_ROUTER_INTERFACE,
1016+
router_interface_key_2,
1017+
&original_rif_ref_count));
1018+
9501019
std::vector<swss::FieldValueTuple> fvs1{
9511020
{p4orch::kAction, p4orch::kTunnelAction},
9521021
{prependParamField(p4orch::kRouterInterfaceId),
@@ -1026,10 +1095,10 @@ TEST_F(GreTunnelManagerTest, DrainStopOnFirstFailureCreate) {
10261095
EXPECT_FALSE(
10271096
p4_oid_mapper_.existsOID(SAI_OBJECT_TYPE_TUNNEL, gre_tunnel_key_2));
10281097

1029-
const auto router_interface_key_2 = KeyGenerator::generateRouterInterfaceKey(
1030-
kP4GreTunnelAppDbEntry2.router_interface_id);
10311098
EXPECT_TRUE(ValidateRefCnt(SAI_OBJECT_TYPE_ROUTER_INTERFACE,
1032-
router_interface_key_2, 0));
1099+
router_interface_key_2, original_rif_ref_count));
1100+
EXPECT_TRUE(ValidateRefCnt(SAI_OBJECT_TYPE_NEIGHBOR_ENTRY, neighbor_key,
1101+
original_neighbor_ref_count));
10331102

10341103
const auto gre_tunnel_key_3 = KeyGenerator::generateTunnelKey("tunnel-3");
10351104
EXPECT_EQ(nullptr, GetGreTunnelEntry(gre_tunnel_key_3));
@@ -1043,6 +1112,21 @@ TEST_F(GreTunnelManagerTest, DrainStopOnFirstFailureCreate) {
10431112
}
10441113

10451114
TEST_F(GreTunnelManagerTest, DrainStopOnFirstFailureDel) {
1115+
EXPECT_TRUE(p4_oid_mapper_.setDummyOID(
1116+
SAI_OBJECT_TYPE_NEIGHBOR_ENTRY,
1117+
KeyGenerator::generateNeighborKey(
1118+
kP4GreTunnelAppDbEntry1.router_interface_id,
1119+
kP4GreTunnelAppDbEntry1.encap_dst_ip)));
1120+
EXPECT_TRUE(p4_oid_mapper_.setDummyOID(
1121+
SAI_OBJECT_TYPE_NEIGHBOR_ENTRY,
1122+
KeyGenerator::generateNeighborKey(
1123+
kP4GreTunnelAppDbEntry2.router_interface_id,
1124+
kP4GreTunnelAppDbEntry2.encap_dst_ip)));
1125+
EXPECT_TRUE(p4_oid_mapper_.setDummyOID(
1126+
SAI_OBJECT_TYPE_NEIGHBOR_ENTRY,
1127+
KeyGenerator::generateNeighborKey(
1128+
kP4GreTunnelAppDbEntry3.router_interface_id,
1129+
kP4GreTunnelAppDbEntry3.encap_dst_ip)));
10461130
EXPECT_TRUE(p4_oid_mapper_.setOID(
10471131
SAI_OBJECT_TYPE_ROUTER_INTERFACE,
10481132
KeyGenerator::generateRouterInterfaceKey(kRouterInterfaceId1),
@@ -1188,6 +1272,11 @@ TEST_F(GreTunnelManagerTest, DrainStopOnFirstFailureDel) {
11881272
TEST_F(GreTunnelManagerTest, DrainStopOnFirstFailureDifferentTypes) {
11891273
AddGreTunnelEntry1();
11901274

1275+
EXPECT_TRUE(p4_oid_mapper_.setDummyOID(
1276+
SAI_OBJECT_TYPE_NEIGHBOR_ENTRY,
1277+
KeyGenerator::generateNeighborKey(
1278+
kP4GreTunnelAppDbEntry2.router_interface_id,
1279+
kP4GreTunnelAppDbEntry2.encap_dst_ip)));
11911280
EXPECT_TRUE(p4_oid_mapper_.setOID(
11921281
SAI_OBJECT_TYPE_ROUTER_INTERFACE,
11931282
KeyGenerator::generateRouterInterfaceKey(kRouterInterfaceId2),

0 commit comments

Comments
 (0)