Skip to content

Comments

Fix ACL rule creation in packet trimming tests (Broadcom)#21448

Merged
bingwang-ms merged 1 commit intosonic-net:masterfrom
rgarofano-arista:fix-acl-rule-creation
Feb 16, 2026
Merged

Fix ACL rule creation in packet trimming tests (Broadcom)#21448
bingwang-ms merged 1 commit intosonic-net:masterfrom
rgarofano-arista:fix-acl-rule-creation

Conversation

@rgarofano-arista
Copy link
Contributor

@rgarofano-arista rgarofano-arista commented Nov 26, 2025

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Approach

What is the motivation for this PR?

Packet trimming tests use acl for verifying that the disable trim action works. We couldn't get this testcase to pass on Broadcom th5. One of the issues was that acl rules weren't being created.

How did you do it?

After inspecting the sairedis logs, it was discovered that it was trying and failing to create a counter for the acl rules the test is trying to create. This is because the action list specified in the configuration does not include a counter, but the orchagent seems to attempt to create one anyways. By adding a counter to the action list we no longer fail to create the ACL rule.

How did you verify/test it?

Confirmed test_acl_action_with_trimming testcase was passing with the change.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sdszhang
Copy link
Contributor

@rgarofano-arista pls fix the pr checker failure.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@github-actions github-actions bot requested a review from developfast December 1, 2025 17:44
Broadcom SAI will complain if this configuration isn't provided, leading
to no acl rules being created.

Signed-off-by: Ryan Garofano <rgarofano@arista.com>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@r12f
Copy link
Contributor

r12f commented Dec 11, 2025

the test change it not broadcom only, but seems to be reasonable. + @nazariig and @dgsudharsan to double confirm.

@nazariig
Copy link
Contributor

the test change it not broadcom only, but seems to be reasonable. + @nazariig and @dgsudharsan to double confirm.

@rgarofano-arista the change looks to me redundant: should be working without specifying action explicitly

Please double check:
https://github.com/sonic-net/sonic-swss/blob/master/orchagent/aclorch.cpp#L2559

bool AclTable::addMandatoryActions()
...
    sai_acl_action_type_t acl_action = SAI_ACL_ACTION_TYPE_COUNTER;
    if (m_pAclOrch->isAclActionSupported(stage, acl_action))
    {
        SWSS_LOG_INFO("Add counter acl action");
        type.addAction(acl_action);
    }
...

@davidm-arista davidm-arista added Request for msft-202412 Branch Request for 202511 branch Request to backport a change to 202511 branch labels Dec 18, 2025
@r12f
Copy link
Contributor

r12f commented Dec 27, 2025

Change to 202412: Azure/sonic-mgmt.msft#882

@r12f
Copy link
Contributor

r12f commented Dec 27, 2025

hey Ryan @rgarofano-arista do you mind to help check Nazarii's comment above? 202412 also has this change, so the ACL tables should be ok, but maybe something override this logic in swss?

image

@rgarofano-arista
Copy link
Contributor Author

Yes, SWSS is trying to create the counter without the config. However the SAI complains, failing to create the counter if the config is not present.

@StormLiangMS
Copy link
Collaborator

hi @nazariig what I heard is that this PR would cause failure on nVidia platform, could you confirm? @rgarofano-arista @r12f FYI.

@kperumalbfn
Copy link
Collaborator

@rgarofano-arista could you check if SAI capability query fails for ACL counter?

@sdszhang sdszhang self-requested a review February 10, 2026 00:51
@rgarofano-arista
Copy link
Contributor Author

hey Ryan @rgarofano-arista do you mind to help check Nazarii's comment above? 202412 also has this change, so the ACL tables should be ok, but maybe something override this logic in swss?
image

@r12f This function only adds the counter action if the action list is not empty (see https://github.com/sonic-net/sonic-swss/blob/0ad109f7e573f44e73bc80021efd9701440a06da/orchagent/aclorch.cpp#L2575). In the packet trimming test we are specifying the action list in the configuration, hence we need to add the counter to the action list in the config. How is this working for Mellanox without this change?

@nazariig
Copy link
Contributor

@rgarofano-arista we have tested this change. Looks good. No further concerns

@nazariig nazariig requested review from nhe-NV and roy-sror February 11, 2026 16:18
@bingwang-ms bingwang-ms merged commit d74cf05 into sonic-net:master Feb 16, 2026
18 checks passed
@bingwang-ms
Copy link
Collaborator

hey Ryan @rgarofano-arista do you mind to help check Nazarii's comment above? 202412 also has this change, so the ACL tables should be ok, but maybe something override this logic in swss?
image

@r12f This function only adds the counter action if the action list is not empty (see https://github.com/sonic-net/sonic-swss/blob/0ad109f7e573f44e73bc80021efd9701440a06da/orchagent/aclorch.cpp#L2575). In the packet trimming test we are specifying the action list in the configuration, hence we need to add the counter to the action list in the config. How is this working for Mellanox without this change?

@rgarofano-arista I think we may need to improve orchagent to handle this scenario. If counter is a mandatory and missing it leads to crash, it should be better to be handled in orchagent.

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202412: Azure/sonic-mgmt.msft#1029

@r12f
Copy link
Contributor

r12f commented Feb 19, 2026

Previous manual pick to 202412: Azure/sonic-mgmt.msft#882

anilal-amd pushed a commit to anilal-amd/anilal-forked-sonic-mgmt that referenced this pull request Feb 19, 2026
Broadcom SAI will complain if this configuration isn't provided, leading
to no acl rules being created.

Signed-off-by: Ryan Garofano <rgarofano@arista.com>
Signed-off-by: Zhuohui Tan <zhuohui.tan@amd.com>
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Feb 23, 2026
Broadcom SAI will complain if this configuration isn't provided, leading
to no acl rules being created.

Signed-off-by: Ryan Garofano <rgarofano@arista.com>
Signed-off-by: mssonicbld <sonicbld@microsoft.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202511: #22534

vmittal-msft pushed a commit that referenced this pull request Feb 23, 2026
Broadcom SAI will complain if this configuration isn't provided, leading
to no acl rules being created.

Signed-off-by: Ryan Garofano <rgarofano@arista.com>
Signed-off-by: mssonicbld <sonicbld@microsoft.com>
Co-authored-by: Ryan Garofano <rgarofano@arista.com>
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.

10 participants