Skip to content

Enhance return code handling for SAI_SWITCH_ATTR_PACKET_TRIM_QUEUE_RESOLUTION_MODE#3808

Merged
prsunny merged 5 commits intosonic-net:masterfrom
dhanasekar-arista:pkt-trim-errors
Aug 11, 2025
Merged

Enhance return code handling for SAI_SWITCH_ATTR_PACKET_TRIM_QUEUE_RESOLUTION_MODE#3808
prsunny merged 5 commits intosonic-net:masterfrom
dhanasekar-arista:pkt-trim-errors

Conversation

@dhanasekar-arista
Copy link
Contributor

What I did
Change the return code handling such that it does not produce an ERR level syslog in the case that SAI_STATUS_NOT_SUPPORTED is returned. Instead handle it gracefully.

Why I did it
Sonic seems to expect queryEnumCapabilitiesSai() to only be sucessful when it returns SAI_STATUS_SUCCESS. However, SAI_STATUS_NOT_SUPPORTED is also a valid return code if the attribute queried is not supported on a platform.

How I verified it
Tested with 7260CX3 on 202505, new log msg prints in place of previous ERR log

Details if related

justin-wong-ce and others added 4 commits July 22, 2025 17:00
Sonic seems to expect queryEnumCapabilitiesSai() to only be sucessful
when it returns SAI_STATUS_SUCCESS. However, SAI_STATUS_NOT_SUPPORTED is
also a valid return code if the attribute queried is not supported on a
platform.

Change the return code handling such that it does not produce an ERR
level syslog in the case that SAI_STATUS_NOT_SUPPORTED is returned.
Instead handle it gracefully.

Tested with 7260CX3 on 202505
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dhanasekar-arista
Copy link
Contributor Author

This PR is a duplicate of #3778. I've created this to address review comments given in #3778 and make progress because Justin is on vacation.

@r12f
Copy link

r12f commented Aug 5, 2025

Please update the PR title to reflect the actual change better.

@dhanasekar-arista dhanasekar-arista changed the title Pkt trim errors Enhance return code handling for SAI_SWITCH_ATTR_PACKET_TRIM_QUEUE_RESOLUTION_MODE Aug 5, 2025
@dhanasekar-arista
Copy link
Contributor Author

Please update the PR title to reflect the actual change better.

done

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dhanasekar-arista
Copy link
Contributor Author

@prsunny please review and merge this change. The changes are an extension of #3798.

@prsunny prsunny merged commit f6a229a into sonic-net:master Aug 11, 2025
14 of 15 checks passed
@prsunny
Copy link
Collaborator

prsunny commented Aug 11, 2025

Merged to unblock feature, but please add unit tests for coverage for future PRs

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202412: Azure/sonic-swss.msft#128

@dhanasekar-arista
Copy link
Contributor Author

@prsunny can you comment why "Request for 202505 Branch" was removed.

@ZhaohuiS
Copy link

@prsunny we also found this error syslog on 202505, should we backport it into 202505?

https://github.com/aristanetworks/sonic-qual.msft/issues/772

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202505: #3840

@prsunny
Copy link
Collaborator

prsunny commented Aug 21, 2025

@dhanasekar-arista , in general we want to reduce the cherry-pick unless its a bug fix. For packet trimming, i see a bunch of cherry-picks in the past and my feedback is to target this feature for 202511 and stop backport. But since this is a log level error on 202505, approving the cherry-pick.

a114j0y pushed a commit to a114j0y/sonic-swss that referenced this pull request Aug 29, 2025
…SOLUTION_MODE (sonic-net#3808)

What I did
Change the return code handling such that it does not produce an ERR level syslog in the case that SAI_STATUS_NOT_SUPPORTED is returned. Instead handle it gracefully.

Why I did it
Sonic seems to expect queryEnumCapabilitiesSai() to only be sucessful when it returns SAI_STATUS_SUCCESS. However, SAI_STATUS_NOT_SUPPORTED is also a valid return code if the attribute queried is not supported on a platform.
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
…SOLUTION_MODE (sonic-net#3808)

What I did
Change the return code handling such that it does not produce an ERR level syslog in the case that SAI_STATUS_NOT_SUPPORTED is returned. Instead handle it gracefully.

Why I did it
Sonic seems to expect queryEnumCapabilitiesSai() to only be sucessful when it returns SAI_STATUS_SUCCESS. However, SAI_STATUS_NOT_SUPPORTED is also a valid return code if the attribute queried is not supported on a platform.
balanokia pushed a commit to balanokia/sonic-swss that referenced this pull request Nov 17, 2025
…SOLUTION_MODE (sonic-net#3808)

What I did
Change the return code handling such that it does not produce an ERR level syslog in the case that SAI_STATUS_NOT_SUPPORTED is returned. Instead handle it gracefully.

Why I did it
Sonic seems to expect queryEnumCapabilitiesSai() to only be sucessful when it returns SAI_STATUS_SUCCESS. However, SAI_STATUS_NOT_SUPPORTED is also a valid return code if the attribute queried is not supported on a platform.
theasianpianist pushed a commit to theasianpianist/sonic-swss that referenced this pull request Feb 4, 2026
…SOLUTION_MODE (sonic-net#3808)

What I did
Change the return code handling such that it does not produce an ERR level syslog in the case that SAI_STATUS_NOT_SUPPORTED is returned. Instead handle it gracefully.

Why I did it
Sonic seems to expect queryEnumCapabilitiesSai() to only be sucessful when it returns SAI_STATUS_SUCCESS. However, SAI_STATUS_NOT_SUPPORTED is also a valid return code if the attribute queried is not supported on a platform.

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
baorliu pushed a commit to baorliu/sonic-swss that referenced this pull request Feb 23, 2026
…SOLUTION_MODE (sonic-net#3808)

What I did
Change the return code handling such that it does not produce an ERR level syslog in the case that SAI_STATUS_NOT_SUPPORTED is returned. Instead handle it gracefully.

Why I did it
Sonic seems to expect queryEnumCapabilitiesSai() to only be sucessful when it returns SAI_STATUS_SUCCESS. However, SAI_STATUS_NOT_SUPPORTED is also a valid return code if the attribute queried is not supported on a platform.

Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants