Skip to content

Support checking capabilities of the mirror#3934

Merged
prsunny merged 4 commits intosonic-net:masterfrom
stephenxs:mirror_capability_check
Nov 21, 2025
Merged

Support checking capabilities of the mirror#3934
prsunny merged 4 commits intosonic-net:masterfrom
stephenxs:mirror_capability_check

Conversation

@stephenxs
Copy link
Copy Markdown
Collaborator

@stephenxs stephenxs commented Oct 11, 2025

What I did

Support checking the capabilities of ingress/egress mirror before setting it to SAI.

  1. Switch orchagent fetches the mirror capabilities from SAI during initialization and exposes to field PORT_INGRESS_MIRROR_CAPABLE and PORT_EGRESS_MIRROR_CAPABLE in STATE_DB table SWITCH_CAPABILITY.
  2. Mirror orchagent check whether the direction is supported before calling the corresponding SAI API.

Why I did it

This is to avoid SAI returning error on the platforms that the mirror is not supported on a direction.
It will collect SAI SDK dump on receiving a SAI error message, which is unnecessary.

How I verified it

Mock test + manual test

Details if related

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@stephenxs
Copy link
Copy Markdown
Collaborator Author

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@stephenxs
Copy link
Copy Markdown
Collaborator Author

the failure is not relevant to the change. retrying.

@stephenxs
Copy link
Copy Markdown
Collaborator Author

The vs test failure should be fixed by #3931

@stephenxs stephenxs force-pushed the mirror_capability_check branch from f4d25d4 to ef57314 Compare October 13, 2025 22:08
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@stephenxs stephenxs force-pushed the mirror_capability_check branch from ef57314 to 4eee38e Compare October 20, 2025 00:00
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@stephenxs
Copy link
Copy Markdown
Collaborator Author

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@stephenxs stephenxs requested a review from bingwang-ms October 24, 2025 06:06
@stephenxs stephenxs force-pushed the mirror_capability_check branch from cd56ff7 to 5c86377 Compare October 27, 2025 01:34
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@stephenxs stephenxs force-pushed the mirror_capability_check branch from 253b309 to 21a7e15 Compare November 19, 2025 01:11
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

1 similar comment
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@vmittal-msft
Copy link
Copy Markdown
Contributor

@stephenxs can you please rebase ? we need this for updating sonic-utilities submodule in master.

@stephenxs stephenxs force-pushed the mirror_capability_check branch from 21a7e15 to d20faae Compare November 20, 2025 23:05
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@stephenxs
Copy link
Copy Markdown
Collaborator Author

@stephenxs can you please rebase ? we need this for updating sonic-utilities submodule in master.

@vmittal-msft @prsunny @bingwang-ms all test passed. could you please merge it? thanks

@prsunny prsunny merged commit b426b2b into sonic-net:master Nov 21, 2025
15 checks passed
@stephenxs stephenxs deleted the mirror_capability_check branch November 21, 2025 02:41
kalash-nexthop pushed a commit to kalash-nexthop/sonic-swss that referenced this pull request Dec 16, 2025
What I did

Support checking the capabilities of ingress/egress mirror before setting it to SAI.

Switch orchagent fetches the mirror capabilities from SAI during initialization and exposes to field PORT_INGRESS_MIRROR_CAPABLE and PORT_EGRESS_MIRROR_CAPABLE in STATE_DB table SWITCH_CAPABILITY.
Mirror orchagent check whether the direction is supported before calling the corresponding SAI API.
Why I did it

This is to avoid SAI returning error on the platforms that the mirror is not supported on a direction.
It will collect SAI SDK dump on receiving a SAI error message, which is unnecessary.

Signed-off-by: Kalash Nainwal <[email protected]>
Pterosaur pushed a commit to Janetxxx/sonic-swss that referenced this pull request Jan 6, 2026
What I did

Support checking the capabilities of ingress/egress mirror before setting it to SAI.

Switch orchagent fetches the mirror capabilities from SAI during initialization and exposes to field PORT_INGRESS_MIRROR_CAPABLE and PORT_EGRESS_MIRROR_CAPABLE in STATE_DB table SWITCH_CAPABILITY.
Mirror orchagent check whether the direction is supported before calling the corresponding SAI API.
Why I did it

This is to avoid SAI returning error on the platforms that the mirror is not supported on a direction.
It will collect SAI SDK dump on receiving a SAI error message, which is unnecessary.
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202511: #4137

theasianpianist pushed a commit to theasianpianist/sonic-swss that referenced this pull request Feb 4, 2026
What I did

Support checking the capabilities of ingress/egress mirror before setting it to SAI.

Switch orchagent fetches the mirror capabilities from SAI during initialization and exposes to field PORT_INGRESS_MIRROR_CAPABLE and PORT_EGRESS_MIRROR_CAPABLE in STATE_DB table SWITCH_CAPABILITY.
Mirror orchagent check whether the direction is supported before calling the corresponding SAI API.
Why I did it

This is to avoid SAI returning error on the platforms that the mirror is not supported on a direction.
It will collect SAI SDK dump on receiving a SAI error message, which is unnecessary.

Signed-off-by: Lawrence Lee <[email protected]>
baorliu pushed a commit to baorliu/sonic-swss that referenced this pull request Feb 23, 2026
What I did

Support checking the capabilities of ingress/egress mirror before setting it to SAI.

Switch orchagent fetches the mirror capabilities from SAI during initialization and exposes to field PORT_INGRESS_MIRROR_CAPABLE and PORT_EGRESS_MIRROR_CAPABLE in STATE_DB table SWITCH_CAPABILITY.
Mirror orchagent check whether the direction is supported before calling the corresponding SAI API.
Why I did it

This is to avoid SAI returning error on the platforms that the mirror is not supported on a direction.
It will collect SAI SDK dump on receiving a SAI error message, which is unnecessary.

Signed-off-by: Baorong Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants