Skip to content

switch-trimming global config capability check#3730

Open
anilkpan wants to merge 5 commits intosonic-net:masterfrom
anilkpan:pkt-trimming
Open

switch-trimming global config capability check#3730
anilkpan wants to merge 5 commits intosonic-net:masterfrom
anilkpan:pkt-trimming

Conversation

@anilkpan
Copy link
Copy Markdown
Contributor

Allow switch trimming global config even when some parameters capabilities are not supported.

What I did
Included changes from the following PR:
#3594

  • Added support to allow switch trimming global config even when some parameters capabilities are not supported.
  • Pass down the configuration to SAI only if the capability is supported.

Allow switch trimming global config even when some parameters capabilities are not supported.
@anilkpan anilkpan requested a review from prsunny as a code owner June 27, 2025 00:17
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@adyeung
Copy link
Copy Markdown

adyeung commented Jun 27, 2025

@anilkpan pls regenerate a code PR, #3594 has merged

@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).

@r12f r12f requested review from developfast and kperumalbfn June 30, 2025 21:19
@prsunny prsunny requested a review from nazariig June 30, 2025 21:20
@prsunny
Copy link
Copy Markdown
Collaborator

prsunny commented Jun 30, 2025

can you check on coverage?

Copy link
Copy Markdown
Contributor

@developfast developfast left a comment

Choose a reason for hiding this comment

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

as comments


bool SwitchTrimmingCapabilities::isSwitchTrimmingQueueSetSupported() const
{
return capabilities.mode.isStaticModeSupported && capabilities.queue.isAttrSupported;
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.

why does queue index setting require static mode support specifically?

if (trimCap.isSwitchTrimmingSizeSetSupported())
{
if (!tObj.size.is_set || (tObj.size.value != trim.size.value))
if (trim.size.is_set)
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.

this doesn't handle the case where trim.queue.index.is_set is false but tObj.queue.index.is_set is true. possibly add an else block with appropriate error handling for consistency.

@nazariig
Copy link
Copy Markdown
Collaborator

nazariig commented Jul 1, 2025

These changes violate the original HLD proposal. I would prefer to avoid such a changes. In case some vendor needs to bypass it - we might need to think about the vendor specific capabilities check.

@nazariig
Copy link
Copy Markdown
Collaborator

nazariig commented Jul 1, 2025

Please rebase the PR on top of: #3705

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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.

6 participants