[vslib][HFT] Advertise SAI_TAM_TEL_TYPE_ATTR_MODE capability#1969
Open
DavidZagury wants to merge 2 commits into
Open
[vslib][HFT] Advertise SAI_TAM_TEL_TYPE_ATTR_MODE capability#1969DavidZagury wants to merge 2 commits into
DavidZagury wants to merge 2 commits into
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
What I did Add SwitchStateBase::queryTamTelTypeModeCapability that returns both SAI_TAM_TEL_TYPE_MODE_SINGLE_TYPE and SAI_TAM_TEL_TYPE_MODE_MIXED_TYPE, and dispatch SAI_OBJECT_TYPE_TAM_TEL_TYPE / SAI_TAM_TEL_TYPE_ATTR_MODE in queryAttrEnumValuesCapability through it. Mirrors the existing queryTamTransportTypeCapability and queryTamBindPointTypeCapability helpers and their dispatch branches. Why I did it The orchagent in sonic-swss now queries this enum capability when selecting between SAI_TAM_TEL_TYPE_MODE_SINGLE_TYPE (current default) and SAI_TAM_TEL_TYPE_MODE_MIXED_TYPE on platforms that only support the latter. Previously saivs returned SAI_STATUS_NOT_SUPPORTED for this query, forcing orchagent into a spec-default fallback. Returning both modes lets DVS exercise the orchagent's capability-query path end-to-end; the orchagent's selection rule still picks SINGLE_TYPE when both are advertised, so existing DVS tests that assert SAI_TAM_TEL_TYPE_ATTR_MODE=SAI_TAM_TEL_TYPE_MODE_SINGLE_TYPE continue to pass. Signed-off-by: david.zagury <davidza@nvidia.com>
DavidZagury
force-pushed
the
master_hft_mixed_mode
branch
from
July 2, 2026 22:49
b5b0482 to
b76773f
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
@DavidZagury Please add some tests to pass the coverage check. |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
What I did
Add SwitchStateBaseTest::tamTelTypeModeCapabilitiesGet, a gtest case
that calls queryAttrEnumValuesCapability(TAM_TEL_TYPE, ATTR_MODE)
twice: first with a zero-sized buffer to exercise the BUFFER_OVERFLOW
branch and confirm the reported size, then with an adequately sized
buffer to exercise the SUCCESS branch and verify the returned enum
set equals {SAI_TAM_TEL_TYPE_MODE_SINGLE_TYPE,
SAI_TAM_TEL_TYPE_MODE_MIXED_TYPE}. The test is placed next to the
sibling tamTransportTypeCapabilitiesGet and
tamBindPointTypeCapabilitiesGet cases and follows the same pattern.
Why I did it
The coverage.Azure.sonic-sairedis.amd64 check for PR sonic-net#1969 reported
8% diff coverage (11 of 12 new lines uncovered) against the 80%
threshold because the vstest suite never invoked
queryTamTelTypeModeCapability or the corresponding dispatch branch in
queryAttrEnumValuesCapability. The new test drives both branches of
the helper and the dispatch, bringing diff coverage on the added
lines to 100% and clearing the gate.
Signed-off-by: david.zagury <davidza@nvidia.com>
Contributor
Author
|
/azpw run Azure.sonic-buildimage |
Collaborator
|
Retrying failed(or canceled) jobs... |
Collaborator
|
Retrying failed(or canceled) stages in build 1162818: ✅Stage TestAsan:
✅Stage Test:
|
Pterosaur
approved these changes
Jul 14, 2026
Yakiv-Huryk
approved these changes
Jul 14, 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.
What I did
Add SwitchStateBase::queryTamTelTypeModeCapability that returns both SAI_TAM_TEL_TYPE_MODE_SINGLE_TYPE and SAI_TAM_TEL_TYPE_MODE_MIXED_TYPE, and dispatch SAI_OBJECT_TYPE_TAM_TEL_TYPE / SAI_TAM_TEL_TYPE_ATTR_MODE in queryAttrEnumValuesCapability through it. Mirrors the existing queryTamTransportTypeCapability and queryTamBindPointTypeCapability helpers and their dispatch branches.
Why I did it
The orchagent in sonic-swss now queries this enum capability when selecting between SAI_TAM_TEL_TYPE_MODE_SINGLE_TYPE (current default) and SAI_TAM_TEL_TYPE_MODE_MIXED_TYPE on platforms that only support the latter. Previously saivs returned SAI_STATUS_NOT_SUPPORTED for this query, forcing orchagent into a spec-default fallback. Returning both modes lets DVS exercise the orchagent's capability-query path end-to-end; the orchagent's selection rule still picks SINGLE_TYPE when both are advertised, so existing DVS tests that assert SAI_TAM_TEL_TYPE_ATTR_MODE=SAI_TAM_TEL_TYPE_MODE_SINGLE_TYPE continue to pass.
Description of PR
Summary:
Fixes # (issue)
Type of change
Approach
What is the motivation for this PR?
The orchagent in sonic-swss now queries the
SAI_TAM_TEL_TYPE_ATTR_MODEenum capability when selecting between
SAI_TAM_TEL_TYPE_MODE_SINGLE_TYPE(current default) and
SAI_TAM_TEL_TYPE_MODE_MIXED_TYPEon platformsthat only support the latter. Previously saivs returned
SAI_STATUS_NOT_SUPPORTEDfor this query, forcing orchagent into aspec-default fallback. Advertising both modes lets DVS exercise the
orchagent's capability-query path end-to-end. The orchagent's selection
rule still picks
SINGLE_TYPEwhen both are advertised, so existing DVStests that assert
SAI_TAM_TEL_TYPE_ATTR_MODE = SAI_TAM_TEL_TYPE_MODE_SINGLE_TYPEcontinue to pass.
Work item tracking
How did you do it?
Added
SwitchStateBase::queryTamTelTypeModeCapabilitythat returns bothSAI_TAM_TEL_TYPE_MODE_SINGLE_TYPEandSAI_TAM_TEL_TYPE_MODE_MIXED_TYPE,and dispatched
SAI_OBJECT_TYPE_TAM_TEL_TYPE/SAI_TAM_TEL_TYPE_ATTR_MODEinqueryAttrEnumValuesCapabilitythroughit. Mirrors the existing
queryTamTransportTypeCapabilityandqueryTamBindPointTypeCapabilityhelpers and their dispatch branches,including the same
SAI_STATUS_BUFFER_OVERFLOWpre-flight behavior forzero-count probe calls.
How did you verify/test it?
make) succeeds; no other vslib callers dependon the new method signature.
change and the companion orchagent PR — the new HFT MIXED
capability-query test in
tests/test_hft.pyexercises this code pathand passes.
sibling helpers, so callers that pre-flight with
count = 0get therequired size back as expected.
Any platform specific information?
None. Change is contained to the saivs virtual-switch SAI; physical
platforms continue to report their own mode capability through their
vendor SAI.
Documentation
HLD: sonic-net/SONiC#2379
— "High frequency telemetry support of MIXED tam tel type mode".