Skip to content

orchagent: copp: associate trap group only if trap action is copy or trap - #2830

Closed
prabhataravind wants to merge 0 commit into
sonic-net:masterfrom
prabhataravind:master
Closed

prabhataravind wants to merge 0 commit into
sonic-net:masterfrom
prabhataravind:master

Conversation

@prabhataravind

@prabhataravind prabhataravind commented Jun 22, 2023 •

Copy link
Copy Markdown
Contributor

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.

@prabhataravind prabhataravind changed the title orchagent: copp: create trap group only if trap action is copy or trap orchagent: copp: associate trap group only if trap action is copy or trap Jun 22, 2023
@prabhataravind
prabhataravind force-pushed the master branch 2 times, most recently from 7e080ab to e5f3abc Compare June 22, 2023 19:59
@prabhataravind
prabhataravind marked this pull request as ready for review June 23, 2023 21:08
@prabhataravind
prabhataravind requested a review from prsunny as a code owner June 23, 2023 21:08
@prsunny

prsunny commented Jun 23, 2023

Copy link
Copy Markdown
Collaborator

@prabhataravind , please update the description as per the template. Also add VS tests

@prsunny
prsunny requested a review from dgsudharsan June 23, 2023 23:31

@dgsudharsan dgsudharsan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add UT and description.
The main use case of CoPP is to trap or copy and apply rate limiting. What usecase does this PR address? Is it drop? If you need to drop traffic, can't regular ACLs be used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants