Skip to content

Commit

Permalink
Attach neighbor_miss trap to default trap group policed at 600pps
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhat Aravind <[email protected]>
  • Loading branch information
prabhataravind committed Dec 20, 2024
1 parent eae729e commit c4dd506
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
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/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

0 comments on commit c4dd506

Please sign in to comment.