Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attach neighbor_miss trap to default trap group policed at 600pps #3434

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions orchagent/copporch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ static map<string, sai_hostif_trap_type_t> trap_id_map = {
{"dest_nat_miss", SAI_HOSTIF_TRAP_TYPE_DNAT_MISS},
{"ldp", SAI_HOSTIF_TRAP_TYPE_LDP},
{"bfd_micro", SAI_HOSTIF_TRAP_TYPE_BFD_MICRO},
{"bfdv6_micro", SAI_HOSTIF_TRAP_TYPE_BFDV6_MICRO}
{"bfdv6_micro", SAI_HOSTIF_TRAP_TYPE_BFDV6_MICRO},
{"neighbor_miss", SAI_HOSTIF_TRAP_TYPE_NEIGHBOR_MISS}
};


Expand Down Expand Up @@ -120,7 +121,8 @@ static map<string, sai_packet_action_t> packet_action_map = {

const string default_trap_group = "default";
const vector<sai_hostif_trap_type_t> default_trap_ids = {
SAI_HOSTIF_TRAP_TYPE_TTL_ERROR
SAI_HOSTIF_TRAP_TYPE_TTL_ERROR,
SAI_HOSTIF_TRAP_TYPE_NEIGHBOR_MISS
};
const uint HOSTIF_TRAP_COUNTER_POLLING_INTERVAL_MS = 10000;

Expand Down Expand Up @@ -823,7 +825,8 @@ void CoppOrch::getTrapAddandRemoveList(string trap_group_name,
{
if ((trap_group_name != default_trap_group) ||
((trap_group_name == default_trap_group) &&
(it.first != SAI_HOSTIF_TRAP_TYPE_TTL_ERROR)))
((it.first != SAI_HOSTIF_TRAP_TYPE_TTL_ERROR) ||
(it.first != SAI_HOSTIF_TRAP_TYPE_NEIGHBOR_MISS))))
{
rem_trap_ids.push_back(it.first);
}
Expand Down
2 changes: 1 addition & 1 deletion orchagent/p4orch/tests/acl_manager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ class AclManagerTest : public ::testing::Test
{
// init copp orch
EXPECT_CALL(mock_sai_hostif_, create_hostif_table_entry(_, _, _, _)).WillRepeatedly(Return(SAI_STATUS_SUCCESS));
EXPECT_CALL(mock_sai_hostif_, create_hostif_trap(_, _, _, _)).WillOnce(Return(SAI_STATUS_SUCCESS));
EXPECT_CALL(mock_sai_hostif_, create_hostif_trap(_, _, _, _)).WillRepeatedly(Return(SAI_STATUS_SUCCESS));
EXPECT_CALL(mock_sai_switch_, get_switch_attribute(_, _, _)).WillRepeatedly(Return(SAI_STATUS_SUCCESS));
copp_orch_ = new CoppOrch(gAppDb, APP_COPP_TABLE_NAME);
// add trap group and genetlink for each CPU queue
Expand Down
2 changes: 1 addition & 1 deletion orchagent/p4orch/tests/next_hop_manager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class NextHopManagerTest : public ::testing::Test
sai_hostif_api->create_hostif_trap = mock_create_hostif_trap;
sai_hostif_api->create_hostif_table_entry = mock_create_hostif_table_entry;
EXPECT_CALL(mock_sai_hostif_, create_hostif_table_entry(_, _, _, _)).WillRepeatedly(Return(SAI_STATUS_SUCCESS));
EXPECT_CALL(mock_sai_hostif_, create_hostif_trap(_, _, _, _)).WillOnce(Return(SAI_STATUS_SUCCESS));
EXPECT_CALL(mock_sai_hostif_, create_hostif_trap(_, _, _, _)).WillRepeatedly(Return(SAI_STATUS_SUCCESS));
EXPECT_CALL(mock_sai_switch_, get_switch_attribute(_, _, _)).WillRepeatedly(Return(SAI_STATUS_SUCCESS));
copp_orch_ = new CoppOrch(gAppDb, APP_COPP_TABLE_NAME);
std::vector<std::string> p4_tables;
Expand Down
2 changes: 1 addition & 1 deletion orchagent/p4orch/tests/wcmp_manager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class WcmpManagerTest : public ::testing::Test
{
// init copp orch
EXPECT_CALL(mock_sai_hostif_, create_hostif_table_entry(_, _, _, _)).WillRepeatedly(Return(SAI_STATUS_SUCCESS));
EXPECT_CALL(mock_sai_hostif_, create_hostif_trap(_, _, _, _)).WillOnce(Return(SAI_STATUS_SUCCESS));
EXPECT_CALL(mock_sai_hostif_, create_hostif_trap(_, _, _, _)).WillRepeatedly(Return(SAI_STATUS_SUCCESS));
EXPECT_CALL(mock_sai_switch_, get_switch_attribute(_, _, _)).WillOnce(Return(SAI_STATUS_SUCCESS));
copp_orch_ = new CoppOrch(gAppDb, APP_COPP_TABLE_NAME);

Expand Down
4 changes: 2 additions & 2 deletions tests/mock_tests/copporch_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ namespace copporch_test
const auto &trapGroupIdMap = Portal::CoppOrchInternal::getTrapGroupIdMap(coppOrch.get());
const auto &cit2 = trapGroupIdMap.find(SAI_HOSTIF_TRAP_TYPE_TTL_ERROR);
EXPECT_TRUE(cit2 != trapGroupIdMap.end());
ASSERT_EQ(trapGroupIdMap.size(), 1);
ASSERT_EQ(trapGroupIdMap.size(), 2);
}
}

Expand Down Expand Up @@ -577,7 +577,7 @@ namespace copporch_test
const auto &trapGroupIdMap = Portal::CoppOrchInternal::getTrapGroupIdMap(coppOrch.get());
const auto &cit2 = trapGroupIdMap.find(SAI_HOSTIF_TRAP_TYPE_TTL_ERROR);
EXPECT_TRUE(cit2 != trapGroupIdMap.end());
ASSERT_EQ(trapGroupIdMap.size(), 1);
ASSERT_EQ(trapGroupIdMap.size(), 2);
}
}
}
Loading