Skip to content

vpp: support ACL attached to LAG and UDP in ACE#1718

Merged
yue-fred-gao merged 11 commits intosonic-net:masterfrom
yue-fred-gao:acl_lag_udp
Dec 19, 2025
Merged

vpp: support ACL attached to LAG and UDP in ACE#1718
yue-fred-gao merged 11 commits intosonic-net:masterfrom
yue-fred-gao:acl_lag_udp

Conversation

@yue-fred-gao
Copy link
Copy Markdown
Contributor

why

  1. vpp doesn't support ACL attached to LAG
  2. in ACE, if protocol is not specified but port/port-range is, it is default to TCP. This is not correct. It should match both UDP and TCP.

what this PR does

  1. Handle ACL attachment to LAG
  2. If protocol is not specified but port/port-range is, creates 2 ACL rules in vpp because it doesn't allow wildcard protocol: one with proto UDP and one with proto TCP
  3. Because one ACE can map to multiple vpp ACL rules, we need to remember the starting index of vpp ACL rule and the number of rules for each ACE. This is needed in stats retrieval.

Signed-off-by: Yue Gao <yuega2@cisco.com>
Signed-off-by: Yue Gao <yuega2@cisco.com>
Signed-off-by: Yue Gao <yuega2@cisco.com>
 - if protocol is not specified but port or port-range is
   create 2 rules with proto UDP and TCP. vpp requires proto
   to be set if port or port-range is used

Signed-off-by: Yue Gao <yuega2@cisco.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Yue Gao <yuega2@cisco.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Yue Gao <yuega2@cisco.com>
@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).

return set_internal(SAI_OBJECT_TYPE_PORT, sid, attr);
}

sai_status_t SwitchVpp::setLag(
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.

setLagACL may be more clear

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The function handles set on LAG object. ACL is only one of the attributes so we shouldn't change it to setLagAcl.

Signed-off-by: Yue Gao <yuega2@cisco.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@yue-fred-gao yue-fred-gao requested a review from dypet December 11, 2025 14:48
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@yue-fred-gao
Copy link
Copy Markdown
Contributor 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).

@yue-fred-gao
Copy link
Copy Markdown
Contributor 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).

Copy link
Copy Markdown
Contributor

@lolyu lolyu left a comment

Choose a reason for hiding this comment

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

Hi @yue-fred-gao, could you please provide any HLD here or the vpp project progress if possible?
Thanks

@yue-fred-gao
Copy link
Copy Markdown
Contributor Author

Hi @yue-fred-gao, could you please provide any HLD here or the vpp project progress if possible? Thanks

Hi @lolyu , you can find sonic-vpp HLD at here: https://github.com/sonic-net/sonic-platform-vpp/blob/master/docs/HLD/SONICVPP-HLD.md. In the same directory, you can find other HLDs as well. If you are interested, you are welcome to join the working group: https://lists.sonicfoundation.dev/g/virtual-data-plane. We have weekly meetings, where you can find the latest update. Thanks!

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@yue-fred-gao
Copy link
Copy Markdown
Contributor Author

@saiarcot895 and @lolyu , can you please review the PR? I need one approval with write access.

@yue-fred-gao
Copy link
Copy Markdown
Contributor 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).

@yue-fred-gao
Copy link
Copy Markdown
Contributor 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).

@yue-fred-gao
Copy link
Copy Markdown
Contributor 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).

@yue-fred-gao
Copy link
Copy Markdown
Contributor 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).

@yue-fred-gao yue-fred-gao merged commit b9e389f into sonic-net:master Dec 19, 2025
16 checks passed
croos12 pushed a commit to croos12/sonic-sairedis that referenced this pull request Jan 14, 2026
* Handle acl attachment through LAG update
* Add default permit-all rules
* Support ACL with UDP protocol
* if protocol is not specified but port or port-range is
   create 2 rules with proto UDP and TCP. vpp requires proto
   to be set if port or port-range is used
* realign ace stats index because each ace can map to multiple acl rules

Signed-off-by: Yue Gao <yuega2@cisco.com>
yue-fred-gao added a commit to yue-fred-gao/sonic-sairedis that referenced this pull request Mar 3, 2026
* Handle acl attachment through LAG update
* Add default permit-all rules
* Support ACL with UDP protocol
* if protocol is not specified but port or port-range is
   create 2 rules with proto UDP and TCP. vpp requires proto
   to be set if port or port-range is used
* realign ace stats index because each ace can map to multiple acl rules

Signed-off-by: Yue Gao <yuega2@cisco.com>
yue-fred-gao added a commit that referenced this pull request Mar 3, 2026
* Handle acl attachment through LAG update
* Add default permit-all rules
* Support ACL with UDP protocol
* if protocol is not specified but port or port-range is
   create 2 rules with proto UDP and TCP. vpp requires proto
   to be set if port or port-range is used
* realign ace stats index because each ace can map to multiple acl rules

Signed-off-by: Yue Gao <yuega2@cisco.com>
vmittal-msft pushed a commit that referenced this pull request Mar 9, 2026
* Support for sonic-mgmt ACL testing on VPP (#1599)

* Enabling sonic-mgmt ACL testing for Sonic-VPP

* Use retval in debugs

* Graceful shutdown vpp to avoid core dump (#1714)

Signed-off-by: Yue Gao <yuega2@cisco.com>

* vpp: support ACL attached to LAG and UDP in ACE (#1718)

* Handle acl attachment through LAG update
* Add default permit-all rules
* Support ACL with UDP protocol
* if protocol is not specified but port or port-range is
   create 2 rules with proto UDP and TCP. vpp requires proto
   to be set if port or port-range is used
* realign ace stats index because each ace can map to multiple acl rules

Signed-off-by: Yue Gao <yuega2@cisco.com>

* vpp: support binding multiple ACL tables by priority (#1732)

why
currently vpp doesn't support binding multiple ACL tables. Each table is appended with default permit-all rules. With multiple tables, this may cause acl matched by such rules and skip the actual rule to make in the tables after this one.

what this PR does
remove the default permit-all rules for each table
If a table is empty, create a dummy rule that won't match any traffic because vpp doesn't allow empty table. The dummy rule matches dest-ip to 0.0.0.0/32
sort all the tables by priority in the table group. vpp doesn't support parallel matching
added catch-all acl group to the end. vpp default behavior of no match is drop but sonic is accept.
Fix sonic-vpp crashing due to race condition during stats pull. If the interface to get stats has been removed, stat_segment_ls_r returns null.

Signed-off-by: Yue Gao <yuega2@cisco.com>

* changes for vpp release 202510

---------

Signed-off-by: Yue Gao <yuega2@cisco.com>
Co-authored-by: AkeelAli <701916+AkeelAli@users.noreply.github.com>
Co-authored-by: Mihut Aronovici <aronovic@cisco.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.

5 participants