Skip to content

[packet_trimming] Enable packet-trimming PTF coverage on the vpp platform - #26743

Draft
aaronber0614 wants to merge 2 commits into
sonic-net:masterfrom
aaronber0614:vpp-packet-trimming
Draft

[packet_trimming] Enable packet-trimming PTF coverage on the vpp platform#26743
aaronber0614 wants to merge 2 commits into
sonic-net:masterfrom
aaronber0614:vpp-packet-trimming

Conversation

@aaronber0614

@aaronber0614 aaronber0614 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What / Why

Enables the existing packet_trimming test suite on the VPP platform and
extends the shared helper/fixtures for the SONiC-VPP datapath.

Part of the SONiC packet-trimming enablement tracked in
sonic-net/sonic-buildimage#25789.

Changes

  • tests/packet_trimming/packet_trimming_helper.py and conftest.py:
    platform-aware helper/fixture support for the VPP admission datapath.
  • ansible/.../conditional_mark/tests_mark_conditions.yaml: mark the cases
    not yet supported on VPP (deferred trim features) as skipped so the supported
    stages run cleanly.

Testing

  • Packet-trimming PTF stages 1–2 pass on a t1-lag-vpp testbed; deferred cases
    remain skipped via conditional marks.

Draft: opened for review only; depends on the companion
sonic-platform-vpp and sonic-sairedis PRs.


🤖 Co-authored with GitHub Copilot.

aaronber0614 and others added 2 commits July 30, 2026 20:05
…icient

- packet_trimming_helper.py: create queue{1,3}_{uplink,downlink}_lossy_profile
  BUFFER_PROFILEs when absent (they ship only in real SN5640/7060X6 QoS
  templates), so block-queue setup works on the VPP Force10-S6000 config; add
  delete_buffer_queue_for_trim_queue to remove test-created BUFFER_QUEUE
  trim-queue references.
- conftest.py: call delete_buffer_queue_for_trim_queue in teardown before
  deleting trim_queue_test_profile, so `config load` (a merge) does not leave a
  dangling BUFFER_QUEUE -> BUFFER_PROFILE leafref that fails post-test YANG
  validation on platforms whose base config lacks the trim queue (VPP).
- tests_mark_conditions.yaml: exempt asic_type == 'vpp' from the hwsku skip and
  add asic_type in ['vpp'] skips for the deferred asymmetric module and
  symmetric cases (ACL, SRv6, counters x2, mirror, reload/reboot, stability and
  port-admin toggles), so only the three in-scope symmetric cases run on VPP.

Validated on vms-kvm-vpp-t1-lag: the three in-scope cases pass with zero
setup/teardown errors and no manual redis-cli.

Tracking: sonic-net/sonic-buildimage#25789

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Aaron Bernardino <aaronber@microsoft.com>
…ardown

Address code-review gaps M3 and M4 in the packet-trimming suite:

- M3 (conditional_mark): add file-level "asic_type in ['vpp']" skips for
  test_packet_trimming_config_asymmetric.py and
  test_packet_trimming_config_symmetric.py so the config variants are
  skipped on sonic-vpp the same way the folder-level rule already skips
  the rest of the suite. A longer file-level key whose condition is false
  does not shadow the shorter folder-level rule, so non-VPP platforms are
  unaffected.

- M4 (teardown cleanup): setup_trimming now records the blocking-queue
  BUFFER_QUEUE bindings it adds and the buffer profiles it creates on
  demand, and teardown removes the bindings unconditionally and deletes
  only the profiles it created. config load merges rather than replaces,
  so without this the added keys dangled on platforms (e.g. the VPP vs
  on the shared Force10-S6000 hwsku) whose base config lacks them.
  set_buffer_profile_for_block_queue / ensure_block_queue_buffer_profile
  now return whether they created the profile to drive this.

Validated on the dev-VM: conditional_mark decisions correct across four
platform scenarios (no shadowing regression); teardown leaves no leftover
trim/block profiles or BUFFER_QUEUE bindings.

Tracking: sonic-net/sonic-buildimage#25789

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Aaron Bernardino <aaronber@microsoft.com>
Copilot AI review requested due to automatic review settings August 3, 2026 18:51
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

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

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

@StormLiangMS @wangxin @yxieca A user wants to merge changes to the conditional mark files into master. Please review.

@aaronber0614

Copy link
Copy Markdown
Contributor Author

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enable the existing packet_trimming PTF test suite to run on the SONiC-VPP platform by making buffer/queue setup and teardown resilient to minimal VPP buffer configs, and by conditionally skipping VPP-deferred cases so supported stages can run cleanly.

Changes:

  • Add on-demand creation and explicit teardown of missing blocking-queue buffer profiles and BUFFER_QUEUE keys to keep CONFIG_DB YANG-valid (notably on VPP minimal configs).
  • Add explicit teardown cleanup for trimming-queue BUFFER_QUEUE keys to avoid dangling BUFFER_QUEUE -> BUFFER_PROFILE leafrefs after config load.
  • Update conditional marks to allow packet_trimming on asic_type == 'vpp' while skipping deferred VPP cases.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/packet_trimming/packet_trimming_helper.py Adds helpers to create missing blocking-queue buffer profiles and delete BUFFER_QUEUE/BUFFER_PROFILE keys during teardown; adds trim-queue BUFFER_QUEUE deletion helper.
tests/packet_trimming/conftest.py Tracks and tears down buffer profiles/bindings created by the fixture to keep VPP CONFIG_DB clean after tests.
tests/common/plugins/conditional_mark/tests_mark_conditions.yaml Adjusts skip gating to permit VPP runs and adds per-test skips for VPP-deferred scenarios.
Suppressed comments (1)

tests/common/plugins/conditional_mark/tests_mark_conditions.yaml:3997

  • Spelling: “persistance” should be “persistence” in the skip reason.
    reason: "TH5 clears trim counters when packet trimming is turned off, skipping until trim counter persistance is supported. Trim counters are also deferred on sonic-vpp (tracking sonic-net/sonic-buildimage#25789)."

packet_trimming:
skip:
reason: "Packet trimming is not supported on 202505. Packet trimming cases require PR https://github.com/sonic-net/sonic-buildimage/pull/22869, but KVM does not support it, so skip trimming case on KVM. Packet-trimming tests are only supported on certain Mellanox SN5640 and Arista 7060X6 SKUs."
reason: "Packet trimming is not supported on 202505. Packet trimming cases require PR https://github.com/sonic-net/sonic-buildimage/pull/22869, but KVM does not support it, so skip trimming case on KVM. Packet-trimming tests are only supported on certain Mellanox SN5640 and Arista 7060X6 SKUs. On sonic-vpp (asic_type 'vpp') the symmetric core trimming cases are enabled; deferred cases are skipped per-test (tracking sonic-net/sonic-buildimage#25789)."
Comment on lines +1603 to +1605
pool = TRIM_QUEUE_PROFILE_CONFIG["pool"]
fields = f"pool {pool} size 1518 dynamic_th {DYNAMIC_TH}"
duthost.shell(f"redis-cli -n 4 hset 'BUFFER_PROFILE|{block_queue_profile}' {fields}")
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.

3 participants