Skip to content

Enhance return code handling for queryEnumCapabilitiesSai#3798

Merged
prsunny merged 1 commit intosonic-net:masterfrom
dhanasekar-arista:pkt_trim_errs
Aug 4, 2025
Merged

Enhance return code handling for queryEnumCapabilitiesSai#3798
prsunny merged 1 commit intosonic-net:masterfrom
dhanasekar-arista:pkt_trim_errs

Conversation

@dhanasekar-arista
Copy link
Contributor

Backport to msft-202412, msft-202503, 202505

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
Verified that the new LOG messages are printed at NOTICE level rather than ERROR level.

SONiC Software Version: SONiC.branch.202505-ars.ca6b34cb-buildimage.origin.202505-review.478334.1-2025.07.30.06.38
admin@ldp412:~$ show log "SAI_SWITCH_ATTR_PACKET_TRIM_"
2025 Jul 31 01:24:26.140966 ldp412 NOTICE swss#orchagent: :- queryTrimDscpModeEnumCapabilities: Attribute not supported(SAI_SWITCH_ATTR_PACKET_TRIM_DSCP_RESOLUTION_MODE) to query enum capabilities
2025 Jul 31 01:24:26.143248 ldp412 NOTICE swss#orchagent: :- queryTrimQueueModeEnumCapabilities: Attribute not supported(SAI_SWITCH_ATTR_PACKET_TRIM_QUEUE_RESOLUTION_MODE)enum value capabilities

Details if related
This is a follow up for #3778

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

@kperumalbfn fyi

@dhanasekar-arista
Copy link
Contributor Author

@nazariig fyi

@prsunny prsunny merged commit 5ff1c2e into sonic-net:master Aug 4, 2025
14 of 15 checks passed
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202505: #3810

@mssonicbld
Copy link
Collaborator

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

@prsunny
Copy link
Collaborator

prsunny commented Aug 12, 2025

Removing cherry-pick to 202505. @r12f , @kperumalbfn for viz

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202506: Azure/sonic-swss.msft#133

a114j0y pushed a commit to a114j0y/sonic-swss that referenced this pull request Aug 29, 2025
…3798)

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
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
…3798)

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
balanokia pushed a commit to balanokia/sonic-swss that referenced this pull request Nov 17, 2025
…3798)

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
theasianpianist pushed a commit to theasianpianist/sonic-swss that referenced this pull request Feb 4, 2026
…3798)

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

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

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

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