Enhance return code handling for queryEnumCapabilitiesSai()#3778
Enhance return code handling for queryEnumCapabilitiesSai()#3778justin-wong-ce wants to merge 2 commits intosonic-net:masterfrom
Conversation
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
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw run Azure.sonic-swss |
|
/AzurePipelines run Azure.sonic-swss |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw run Azure.sonic-swss |
|
/AzurePipelines run Azure.sonic-swss |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
#3765 |
| attrCap, SAI_OBJECT_TYPE_SWITCH, SAI_SWITCH_ATTR_PACKET_TRIM_QUEUE_RESOLUTION_MODE | ||
| ); | ||
| if (status != SAI_STATUS_SUCCESS) | ||
| if (status == SAI_STATUS_NOT_SUPPORTED) |
There was a problem hiding this comment.
do you mind to update the other functions in this file?
There was a problem hiding this comment.
do you mind to update the other functions in this file?
done, #3798
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| mList, SAI_OBJECT_TYPE_SWITCH, SAI_SWITCH_ATTR_PACKET_TRIM_QUEUE_RESOLUTION_MODE | ||
| ); | ||
| if (status != SAI_STATUS_SUCCESS) | ||
| if (status == SAI_STATUS_NOT_SUPPORTED) |
| if (status != SAI_STATUS_SUCCESS) | ||
| if (status == SAI_STATUS_NOT_SUPPORTED) | ||
| { | ||
| SWSS_LOG_NOTICE( |
There was a problem hiding this comment.
@adyeung @justin-wong-ce we also need to update the
There was a problem hiding this comment.
Will be addressing this in a separate PR.
(Someone else doing it since I don't have computer access for a bit soon).
There was a problem hiding this comment.
@kperumalbfn the next SAI 13.2.1 drop will pass the AttrSupported checks required by isSwitchTrimmingSupported(), no need for a change at the func from BRCM
| if (status == SAI_STATUS_NOT_SUPPORTED) | ||
| { | ||
| SWSS_LOG_NOTICE( | ||
| "Attribute not supported(%s)enum value capabilities", |
There was a problem hiding this comment.
| "Attribute not supported(%s)enum value capabilities", | |
| "Attribute not supported(%s) to query enum value capabilities", |
| if (status == SAI_STATUS_NOT_SUPPORTED) | ||
| { | ||
| SWSS_LOG_NOTICE( | ||
| "Attribute not supported(%s)enum value capabilities", |
There was a problem hiding this comment.
| "Attribute not supported(%s)enum value capabilities", | |
| "Attribute not supported(%s) to query attr vapabilities", |
There was a problem hiding this comment.
@dhanasekar-arista the new one is approved. Please close the original one
There was a problem hiding this comment.
thanks @nazariig , i wont have permissions to close this one, @justin-wong-ce will close this one once he is back.
Backport to msft-202412, msft-202503, 202505 <!-- Please make sure you have read and understood the contribution guildlines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md 1. Make sure your commit includes a signature generted with `git commit -s` 2. Make sure your commit title follows the correct format: [component]: description 3. Make sure your commit message contains enough details about the change and related tests 4. Make sure your pull request adds related reviewers, asignees, labels Please also provide the following information in this pull request: --> **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 sonic-net#3778
Backport to msft-202412, msft-202503, 202505 <!-- Please make sure you have read and understood the contribution guildlines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md 1. Make sure your commit includes a signature generted with `git commit -s` 2. Make sure your commit title follows the correct format: [component]: description 3. Make sure your commit message contains enough details about the change and related tests 4. Make sure your pull request adds related reviewers, asignees, labels Please also provide the following information in this pull request: --> **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
Backport to msft-202412, msft-202503, 202505 <!-- Please make sure you have read and understood the contribution guildlines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md 1. Make sure your commit includes a signature generted with `git commit -s` 2. Make sure your commit title follows the correct format: [component]: description 3. Make sure your commit message contains enough details about the change and related tests 4. Make sure your pull request adds related reviewers, asignees, labels Please also provide the following information in this pull request: --> **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 sonic-net/sonic-swss#3778
Backport to msft-202412, msft-202503, 202505 <!-- Please make sure you have read and understood the contribution guildlines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md 1. Make sure your commit includes a signature generted with `git commit -s` 2. Make sure your commit title follows the correct format: [component]: description 3. Make sure your commit message contains enough details about the change and related tests 4. Make sure your pull request adds related reviewers, asignees, labels Please also provide the following information in this pull request: --> **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 sonic-net/sonic-swss#3778
Backport to msft-202412, msft-202503, 202505 <!-- Please make sure you have read and understood the contribution guildlines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md 1. Make sure your commit includes a signature generted with `git commit -s` 2. Make sure your commit title follows the correct format: [component]: description 3. Make sure your commit message contains enough details about the change and related tests 4. Make sure your pull request adds related reviewers, asignees, labels Please also provide the following information in this pull request: --> **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 sonic-net/sonic-swss#3778
Backport to msft-202412, msft-202503, 202505 <!-- Please make sure you have read and understood the contribution guildlines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md 1. Make sure your commit includes a signature generted with `git commit -s` 2. Make sure your commit title follows the correct format: [component]: description 3. Make sure your commit message contains enough details about the change and related tests 4. Make sure your pull request adds related reviewers, asignees, labels Please also provide the following information in this pull request: --> **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 sonic-net/sonic-swss#3778
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
Tested with 7260CX3 on 202505, new log msg prints in place of previous ERR log
Details if related