orchagent: copp: associate trap group only if trap action is copy or trap #2830
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
Associate trap group only if trap action is copy or trap.
Why I did it
When using SN4600 as a leaf fanout switch, LACP trap action needs to be changed from "TRAP" to "FORWARD". However this will return an error when creating the host interface as shown in the details section below. In addition, per saihostif definitions, SAI_HOSTIF_TRAP_ATTR_TRAP_GROUP is only valid if SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION == SAI_PACKET_ACTION_TRAP or SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION == SAI_PACKET_ACTION_COPY.
How I verified it
By setting LACP trap action to "FORWARD" and making sure no syncd/orchagent error is seen.
Details if related
ERR syncd#SDK: [SAI_UTILS.ERR] mlnx_sai_utils.c[1906]- sai_attribute_valid_condition_check: Attribute SAI_HOSTIF_TRAP_ATTR_TRAP_GROUP doesn't match a valid
conditions: {(SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION : TRAP)
OR (SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION : COPY)}
ERR syncd#SDK: [SAI_HOST_INTERFACE.ERR] mlnx_sai_host_interface.c[2039]- mlnx_create_hostif_trap: Failed attribs check
ERR syncd#SDK: :- sendApiResponse: api SAI_COMMON_API_CREATE failed in syncd mode: SAI_STATUS_FAILURE
ERR syncd#SDK: :- processQuadEvent: attr: SAI_HOSTIF_TRAP_ATTR_TRAP_TYPE: SAI_HOSTIF_TRAP_TYPE_LACP
ERR syncd#SDK: :- processQuadEvent: attr: SAI_HOSTIF_TRAP_ATTR_TRAP_GROUP: oid:0x11000000000baa
ERR syncd#SDK: :- processQuadEvent: attr: SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION: SAI_PACKET_ACTION_FORWARD
ERR swss#orchagent: :- create: create status: SAI_STATUS_FAILURE
ERR swss#orchagent: :- applyAttributesToTrapIds: Failed to create trap 1, rv:-1
ERR swss#orchagent: :- trapGroupProcessTrapIdChange: Failed to set traps to trap group queue4_group1
ERR swss#orchagent: :- doTask: Processing copp task item failed, exiting.