Skip to content

[vslib][HFT] Advertise SAI_TAM_TEL_TYPE_ATTR_MODE capability#1969

Open
DavidZagury wants to merge 2 commits into
sonic-net:masterfrom
DavidZagury:master_hft_mixed_mode
Open

[vslib][HFT] Advertise SAI_TAM_TEL_TYPE_ATTR_MODE capability#1969
DavidZagury wants to merge 2 commits into
sonic-net:masterfrom
DavidZagury:master_hft_mixed_mode

Conversation

@DavidZagury

Copy link
Copy Markdown
Contributor

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

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation update
  • Test improvement

Approach

What is the motivation for this PR?

The orchagent in sonic-swss now queries the SAI_TAM_TEL_TYPE_ATTR_MODE
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. Advertising 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.

Work item tracking
  • Microsoft ADO (number only):

How did you do it?

Added SwitchStateBase::queryTamTelTypeModeCapability that returns both
SAI_TAM_TEL_TYPE_MODE_SINGLE_TYPE and SAI_TAM_TEL_TYPE_MODE_MIXED_TYPE,
and dispatched 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,
including the same SAI_STATUS_BUFFER_OVERFLOW pre-flight behavior for
zero-count probe calls.

How did you verify/test it?

  • Local build of saivs (make) succeeds; no other vslib callers depend
    on the new method signature.
  • Ran the sonic-swss DVS suite against a build that includes both this
    change and the companion orchagent PR — the new HFT MIXED
    capability-query test in tests/test_hft.py exercises this code path
    and passes.
  • Verified the buffer-overflow handling follows the same pattern as the
    sibling helpers, so callers that pre-flight with count = 0 get the
    required 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".

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
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
DavidZagury force-pushed the master_hft_mixed_mode branch from b5b0482 to b76773f Compare July 2, 2026 22:49
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@r12f
r12f requested a review from Pterosaur July 9, 2026 16:30
@Pterosaur

Pterosaur commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@DavidZagury Please add some tests to pass the coverage check.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
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>
@DavidZagury

Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1162818:

✅Stage TestAsan:

  • Job vstest: retried.

✅Stage Test:

  • Job vstest: retried.
  • Job vstest: retried.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants