Skip to content

[HLD][Port Mirror] Add direction support, remove in-place update, and YANG model updates#2378

Open
Janetxxx wants to merge 1 commit into
sonic-net:masterfrom
Janetxxx:dev/janetcui/sampled-port-mirror-hld
Open

[HLD][Port Mirror] Add direction support, remove in-place update, and YANG model updates#2378
Janetxxx wants to merge 1 commit into
sonic-net:masterfrom
Janetxxx:dev/janetcui/sampled-port-mirror-hld

Conversation

@Janetxxx

Copy link
Copy Markdown
Contributor

Why I did it

Follow-up to #2296, this PR updates the design with refinements made as the feature was implemented:

  • Direction support (RX/TX/BOTH): extend from ingress-only to per-direction sampling; add the EGRESS_SAMPLEPACKET_ENABLE / EGRESS_SAMPLE_MIRROR_SESSION port attributes (RX = ingress pair, TX = egress pair, BOTH = both) and update the SAI call sequence.
  • Stricter configuration semantics: a SET on an existing session is rejected as a duplicate instead of updated in place (reconfigure = explicit delete + re-add), and a sampled session must specify a direction.
  • Fail-closed on unsupported platforms: reject the session when the required capability is missing, instead of silently downgrading to full mirroring.
  • Per-direction conflict detection (5.2.4): describe the symmetric, per-direction SamplePacket conflict between sampled mirroring and sFlow.
  • YANG: relax the sample_rate range to 2..max.
  • Flow diagram (Section 4): simplify to the create/delete workflow with the rejection path and per-direction bind/unbind steps.
  • Test plan (9.3.1 / 9.3.2): expand and renumber VS and system test cases (TX/BOTH/LAG, duplicate rejection, sFlow conflict, inactive/no-route, route withdraw–reactivate, truncate-without-rate default)

…eject duplicated entry and update test plan

Signed-off-by: Janetxxx <janet970527@gmail.com>
@Janetxxx Janetxxx requested a review from r12f June 10, 2026 13:56
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

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.

2 participants