[DASH] Validate ca to pa SAI attributes#4031
Conversation
Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR reorganizes the DASH vnet orchestration code to conditionally set SAI attributes for outbound CA to PA entries based on routing type (privatelink vs non-privatelink). This prevents crashes that occur when attempting to set attributes that are only valid for specific routing types, as enforced by the SAI metadata layer.
Key changes:
- Refactored attribute setting logic to separate privatelink-specific attributes from non-privatelink-specific attributes
- Improved test error messages to include operation type (SET/DEL)
- Added explicit return values to mock expectations in tests
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| orchagent/dash/dashvnetorch.cpp | Reorganizes CA to PA attribute setting based on routing type; moves encap_type and tunnel_key extraction to variables for conditional use |
| tests/mock_tests/mock_dash_orch_test.cpp | Changes op variable from auto to std::string and includes operation type in error messages |
| tests/mock_tests/dashvnetorch_ut.cpp | Adds explicit Return(SAI_STATUS_SUCCESS) to mock expectations for better test clarity |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
prabhataravind
left a comment
There was a problem hiding this comment.
lgtm. Please verify this on cisco SS as well.
|
/azp run |
|
@mukeshmv for vis |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
hi @mukeshmv - is this one ok with you? |
|
Default attribute is configured, even though it is not required: |
…c-swss into dash-sai-validation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 4031 in repo sonic-net/sonic-swss |
Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Cherry-pick PR to msft-202506: Azure/sonic-swss.msft#205 |
|
Cherry-pick PR to 202511: #4202 |
What I did Only set certain CA to PA attributes if they are valid for a given mapping type Why I did it Some SAI attributes are only valid for privatelink and some are only valid for non-privatelink. This is enforced by the SAI metadata layer, so add this check in orchagent to prevent crashes.
What I did Only set certain CA to PA attributes if they are valid for a given mapping type Why I did it Some SAI attributes are only valid for privatelink and some are only valid for non-privatelink. This is enforced by the SAI metadata layer, so add this check in orchagent to prevent crashes. Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
What I did
Only set certain CA to PA attributes if they are valid for a given mapping type
Why I did it
Some SAI attributes are only valid for privatelink and some are only valid for non-privatelink. This is enforced by the SAI metadata layer, so add this check in orchagent to prevent crashes.
How I verified it
Details if related