[202511] BROADCOM_LEGACY_SAI_COMPAT: Allow platforms to disable sai_query_stats_st_capability at runtime#1795
Merged
vmittal-msft merged 1 commit intosonic-net:202511from Mar 17, 2026
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
9acdcc8 to
ed2765f
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
@lipxu please help fix conflicts |
…_st_capability at runtime Signed-off-by: Liping Xu <xuliping@microsoft.com>
ed2765f to
f290766
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Ryangwaite
approved these changes
Mar 17, 2026
vmittal-msft
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Backport of #1788 to 202511.
On Arista 7060cx (BCM56960/Tomahawk-1) running the broadcom-legacy image, syncd crashes with SIGSEGV inside
brcm_sai_st_pd_ctr_cap_list_getat startup. The legacy SAI binary does not initializep_pdapi_st->vtablefor TH1, so dereferencing it at offset +0x10 causes a segfault.Root cause: commit
4f1d7d99restoredsai_query_stats_st_capabilitytoAC_CHECK_FUNCS. Because XGS SAI headers are shared across all broadcom builds, the symbol is found at compile time and called at runtime on TH1 where it crashes.Fix
Add a runtime guard in
VendorSai::apiInitialize(): readSAI_STATS_ST_CAPABILITY_SUPPORTEDfromsai.profile. If set to0, null thequery_stats_st_capabilityfunction pointer before marking the API as initialized. The existing null-check inqueryStatsStCapability()then safely skips the call.This fix must be deployed together with the companion buildimage PR that adds
SAI_STATS_ST_CAPABILITY_SUPPORTED=0to the Arista 7060cxsai.profilefiles.Related