Skip to content

Conversation

@stephenxs
Copy link
Collaborator

@stephenxs stephenxs commented Oct 20, 2025

Check mirror capability before configuring it or 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.
  3. CLI checks the capability in PORT_INGRESS_MIRROR_CAPABLE and PORT_EGRESS_MIRROR_CAPABLE in STATE_DB table SWITCH_CAPABILITY before conifiguring CONFIG_DB

Implementation PRs

Module PR title state
sonic-swss Support checking capabilities of the mirror GitHub issue/pull request detail
sonic-utilities Fetch capability of mirror before configuring it GitHub issue/pull request detail

Signed-off-by: Stephen Sun [email protected]

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@stephenxs stephenxs changed the title Check mirror capability before configuring it or setting it to SAI Check mirror ingress/egress capability before configuring it or setting it to SAI Oct 20, 2025
Signed-off-by: Stephen Sun <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@bingwang-ms
Copy link
Contributor

@stephenxs Can you help me understand why do we need this change since we already have switch level capability check?

redis-cli -n 6 hgetall "ACL_STAGE_CAPABILITY_TABLE|EGRESS"
1) "is_action_list_mandatory"
2) "false"
3) "action_list"
4) "PACKET_ACTION,MIRROR_EGRESS_ACTION"
5) "supported_L3V4V6"
6) "false"

@stephenxs
Copy link
Collaborator Author

@stephenxs Can you help me understand why do we need this change since we already have switch level capability check?


redis-cli -n 6 hgetall "ACL_STAGE_CAPABILITY_TABLE|EGRESS"

1) "is_action_list_mandatory"

2) "false"

3) "action_list"

4) "PACKET_ACTION,MIRROR_EGRESS_ACTION"

5) "supported_L3V4V6"

6) "false"

Hi @bingwang-ms
This is ACL based mirror
What we did is for the port mirror

@stephenxs stephenxs requested a review from bingwang-ms October 24, 2025 06:08
@liat-grozovik
Copy link
Collaborator

@bingwang-ms , @prsunny are we good to go?
Will you be able to provide feedback on the PRs as well or can you assign someone on your behalf?

2. **CLI Validation**: Early validation checks are performed
3. **Capability Check**: System queries STATE_DB for mirror capabilities
4. **Decision Point**:
- If supported: Proceed to OrchAgent
Copy link
Contributor

Choose a reason for hiding this comment

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

Will the configuration be written into config_db if not supported?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, it won't.

Copy link
Collaborator

Choose a reason for hiding this comment

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

why it should? this was not done to other capabilities check. this is not the actual arch for other features.

@stephenxs
Copy link
Collaborator Author

/easycla

@liat-grozovik
Copy link
Collaborator

@prsunny @bingwang-ms any further comments? if not, this should be merged and PRs should be reviewed as well

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.

5 participants