Skip to content

Commit

Permalink
set trap priority only if packet action is trap or copy
Browse files Browse the repository at this point in the history
Summary:
as titled

this is as per SAI spec

Reviewed By: msomasundaran

Differential Revision:
D67953991

Privacy Context Container: L1125642

fbshipit-source-id: a8f6c79574a4b2fa4967f5a5c74e06932ae238b5
  • Loading branch information
Parvez Shaikh authored and facebook-github-bot committed Jan 9, 2025
1 parent 772ae66 commit 89aec34
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fboss/agent/hw/sai/switch/SaiHostifManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,13 @@ SaiHostifManager::makeHostifTrapAttributes(
SaiHostifTrapTraits::Attributes::PacketAction packetAction{
hostifPacketAction};
SaiHostifTrapTraits::Attributes::TrapType trapType{hostifTrapId};
SaiHostifTrapTraits::Attributes::TrapPriority trapPriority{priority};
SaiHostifTrapTraits::Attributes::TrapGroup trapGroup{trapGroupId};
std::optional<SaiHostifTrapTraits::Attributes::TrapPriority> trapPriority{};
std::optional<SaiHostifTrapTraits::Attributes::TrapGroup> trapGroup{};
if (hostifPacketAction == SAI_PACKET_ACTION_TRAP ||
hostifPacketAction == SAI_PACKET_ACTION_COPY) {
trapPriority = priority;
trapGroup = SaiHostifTrapTraits::Attributes::TrapGroup(trapGroupId);
}
return SaiHostifTrapTraits::CreateAttributes{
trapType, packetAction, trapPriority, trapGroup};
}
Expand Down

0 comments on commit 89aec34

Please sign in to comment.