Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACL] Add default action_list for default ACL table type #2298

Merged
merged 6 commits into from
May 27, 2022

Conversation

bingwang-ms
Copy link
Contributor

@bingwang-ms bingwang-ms commented May 27, 2022

What I did
This PR is derived from #2205
Fix sonic-net/sonic-buildimage#10425

We were seeing ACL table creation failure on some platform because action_list is mandatory, while the action_list is not provided by aclorch.

Apr  1 01:24:11.702608 str2-7050cx3-acs-03 ERR swss#orchagent: :- validate: Action list for table DATAACL is mandatory
Apr  1 01:24:11.702608 str2-7050cx3-acs-03 ERR swss#orchagent: :- doAclTableTask: Failed to create ACL table DATAACL, invalid configuration
Apr  1 01:24:11.702741 str2-7050cx3-acs-03 ERR swss#orchagent: :- validate: Action list for table EVERFLOW is mandatory
Apr  1 01:24:11.702741 str2-7050cx3-acs-03 ERR swss#orchagent: :- doAclTableTask: Failed to create ACL table EVERFLOW, invalid configuration
Apr  1 01:24:11.702926 str2-7050cx3-acs-03 ERR swss#orchagent: :- validate: Action list for table EVERFLOWV6 is mandatory
Apr  1 01:24:11.702926 str2-7050cx3-acs-03 ERR swss#orchagent: :- doAclTableTask: Failed to create ACL table EVERFLOWV6, invalid configuration

This PR fixed the issue by adding default action_list to the default ACL table type if not present.

Why I did it
Fix the ACL table creation issue.

How I verified it
Verified by running test_acl and test_everflow on Broadcom TD3 platform

collected 200 items                                                                                                                                                                                                                                            

acl/test_acl.py::TestBasicAcl::test_ingress_unmatched_blocked[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                      [  0%]
acl/test_acl.py::TestBasicAcl::test_ingress_unmatched_blocked[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                      [  1%]
acl/test_acl.py::TestBasicAcl::test_egress_unmatched_forwarded[ipv4-ingress-downlink->uplink] SKIPPED                                                                                                                                                    [  1%]
acl/test_acl.py::TestBasicAcl::test_egress_unmatched_forwarded[ipv4-ingress-uplink->downlink] SKIPPED                                                                                                                                                    [  2%]
acl/test_acl.py::TestBasicAcl::test_source_ip_match_forwarded[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                      [  2%]
acl/test_acl.py::TestBasicAcl::test_source_ip_match_forwarded[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                      [  3%]
acl/test_acl.py::TestBasicAcl::test_rules_priority_forwarded[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                       [  3%]
acl/test_acl.py::TestBasicAcl::test_rules_priority_forwarded[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                       [  4%]
acl/test_acl.py::TestBasicAcl::test_rules_priority_dropped[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                         [  4%]
acl/test_acl.py::TestBasicAcl::test_rules_priority_dropped[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                         [  5%]
acl/test_acl.py::TestBasicAcl::test_dest_ip_match_forwarded[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                        [  5%]
acl/test_acl.py::TestBasicAcl::test_dest_ip_match_forwarded[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                        [  6%]
acl/test_acl.py::TestBasicAcl::test_dest_ip_match_dropped[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                          [  6%]
acl/test_acl.py::TestBasicAcl::test_dest_ip_match_dropped[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                          [  7%]
acl/test_acl.py::TestBasicAcl::test_source_ip_match_dropped[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                        [  7%]
acl/test_acl.py::TestBasicAcl::test_source_ip_match_dropped[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                        [  8%]
acl/test_acl.py::TestBasicAcl::test_udp_source_ip_match_forwarded[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                  [  8%]
acl/test_acl.py::TestBasicAcl::test_udp_source_ip_match_forwarded[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                  [  9%]
acl/test_acl.py::TestBasicAcl::test_udp_source_ip_match_dropped[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                    [  9%]
acl/test_acl.py::TestBasicAcl::test_udp_source_ip_match_dropped[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                    [ 10%]
acl/test_acl.py::TestBasicAcl::test_icmp_source_ip_match_dropped[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                   [ 10%]
acl/test_acl.py::TestBasicAcl::test_icmp_source_ip_match_dropped[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                   [ 11%]
acl/test_acl.py::TestBasicAcl::test_icmp_source_ip_match_forwarded[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                 [ 11%]
acl/test_acl.py::TestBasicAcl::test_icmp_source_ip_match_forwarded[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                 [ 12%]
acl/test_acl.py::TestBasicAcl::test_l4_dport_match_forwarded[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                       [ 12%]
acl/test_acl.py::TestBasicAcl::test_l4_dport_match_forwarded[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                       [ 13%]
acl/test_acl.py::TestBasicAcl::test_l4_sport_match_forwarded[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                       [ 13%]
acl/test_acl.py::TestBasicAcl::test_l4_sport_match_forwarded[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                       [ 14%]
acl/test_acl.py::TestBasicAcl::test_l4_dport_range_match_forwarded[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                 [ 14%]
acl/test_acl.py::TestBasicAcl::test_l4_dport_range_match_forwarded[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                 [ 15%]
acl/test_acl.py::TestBasicAcl::test_l4_sport_range_match_forwarded[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                 [ 15%]
acl/test_acl.py::TestBasicAcl::test_l4_sport_range_match_forwarded[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                 [ 16%]
acl/test_acl.py::TestBasicAcl::test_l4_dport_range_match_dropped[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                   [ 16%]
acl/test_acl.py::TestBasicAcl::test_l4_dport_range_match_dropped[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                   [ 17%]
acl/test_acl.py::TestBasicAcl::test_l4_sport_range_match_dropped[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                   [ 17%]
acl/test_acl.py::TestBasicAcl::test_l4_sport_range_match_dropped[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                   [ 18%]
acl/test_acl.py::TestBasicAcl::test_ip_proto_match_forwarded[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                       [ 18%]
acl/test_acl.py::TestBasicAcl::test_ip_proto_match_forwarded[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                       [ 19%]
acl/test_acl.py::TestBasicAcl::test_tcp_flags_match_forwarded[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                      [ 19%]
acl/test_acl.py::TestBasicAcl::test_tcp_flags_match_forwarded[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                      [ 20%]
acl/test_acl.py::TestBasicAcl::test_l4_dport_match_dropped[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                         [ 20%]
acl/test_acl.py::TestBasicAcl::test_l4_dport_match_dropped[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                         [ 21%]
acl/test_acl.py::TestBasicAcl::test_l4_sport_match_dropped[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                         [ 21%]
acl/test_acl.py::TestBasicAcl::test_l4_sport_match_dropped[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                         [ 22%]
acl/test_acl.py::TestBasicAcl::test_ip_proto_match_dropped[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                         [ 22%]
acl/test_acl.py::TestBasicAcl::test_ip_proto_match_dropped[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                         [ 23%]
acl/test_acl.py::TestBasicAcl::test_tcp_flags_match_dropped[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                        [ 23%]
acl/test_acl.py::TestBasicAcl::test_tcp_flags_match_dropped[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                        [ 24%]
acl/test_acl.py::TestBasicAcl::test_icmp_match_forwarded[ipv4-ingress-downlink->uplink] PASSED                                                                                                                                                           [ 24%]
acl/test_acl.py::TestBasicAcl::test_icmp_match_forwarded[ipv4-ingress-uplink->downlink] PASSED                                                                                                                                                           [ 25%]
acl/test_acl.py::TestBasicAcl::test_ingress_unmatched_blocked[ipv4-egress-downlink->uplink] SKIPPED                                                                                                                                                      [ 25%]
acl/test_acl.py::TestBasicAcl::test_ingress_unmatched_blocked[ipv4-egress-uplink->downlink] SKIPPED                                                                                                                                                      [ 26%]                                                                                                                                                      [ 99%]
acl/test_acl.py::TestBasicAcl::test_icmp_match_forwarded[ipv6-ingress-uplink->downlink] SKIPPED                                                                                                                                                          [100%] ^H ^H

===================================================================================================== 48 passed, 152 skipped, 1 warnings in 636.22 seconds =====================================================================================================
collected 10 items                                                                                                                                                                                                                                             

everflow/test_everflow_testbed.py::TestEverflowV4IngressAclIngressMirror::test_everflow_basic_forwarding[cli-downstream] PASSED                                                                                                                          [ 10%] 
everflow/test_everflow_testbed.py::TestEverflowV4IngressAclIngressMirror::test_everflow_basic_forwarding[cli-upstream] PASSED                                                                                                                            [ 20%]
everflow/test_everflow_testbed.py::TestEverflowV4IngressAclIngressMirror::test_everflow_neighbor_mac_change[cli-downstream] PASSED                                                                                                                       [ 30%]
everflow/test_everflow_testbed.py::TestEverflowV4IngressAclIngressMirror::test_everflow_neighbor_mac_change[cli-upstream] PASSED                                                                                                                         [ 40%]
everflow/test_everflow_testbed.py::TestEverflowV4IngressAclIngressMirror::test_everflow_remove_unused_ecmp_next_hop[cli-downstream] 
PASSED                                                                                                               [ 50%]
everflow/test_everflow_testbed.py::TestEverflowV4IngressAclIngressMirror::test_everflow_remove_unused_ecmp_next_hop[cli-upstream] PASSED                                                                                                                 [ 60%]
everflow/test_everflow_testbed.py::TestEverflowV4IngressAclIngressMirror::test_everflow_remove_used_ecmp_next_hop[cli-downstream] 
PASSED                                                                                                                 [ 70%]
everflow/test_everflow_testbed.py::TestEverflowV4IngressAclIngressMirror::test_everflow_remove_used_ecmp_next_hop[cli-upstream] PASSED                                                                                                                   [ 80%]
everflow/test_everflow_testbed.py::TestEverflowV4IngressAclIngressMirror::test_everflow_dscp_with_policer[cli-downstream] 
PASSED                                                                                                                         [ 90%]
everflow/test_everflow_testbed.py::TestEverflowV4IngressAclIngressMirror::test_everflow_dscp_with_policer[cli-upstream]  PASSED                                                                                                                           [100%]
=========================================================================================================== 10 passed, 1 warnings in 2438.15 seconds ===========================================================================================================

Details if related

@bingwang-ms bingwang-ms requested a review from prsunny as a code owner May 27, 2022 09:04
@bingwang-ms
Copy link
Contributor Author

@stepanblyschak @ysmanman Could you help take a look? Thanks

AclActionCapabilities
{
{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a redirect action used for L3, L3V6 tables

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. I added SAI_ACL_ACTION_TYPE_REDIRECT for L3 and L3V6. Thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

There's a redirect action used for L3, L3V6 tables

Redirect action should only be added for ingress and not egress. This is breaking other platforms.

{
SAI_ACL_ACTION_TYPE_PACKET_ACTION
},
false
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this boolean isn't used. Maybe you could create another type instead of using acl_capabilities_t

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I use the set<sai_acl_action_type_t> directly. Thanks

Signed-off-by: bingwang <wang.bing@microsoft.com>
@bingwang-ms bingwang-ms force-pushed the add_default_action_list branch from 17ba13c to 02e4439 Compare May 27, 2022 13:48
@yxieca yxieca merged commit 910bfd4 into sonic-net:master May 27, 2022
@prsunny
Copy link
Collaborator

prsunny commented May 27, 2022

@yxieca , @bingwang-ms , can you please check on the coverage? Can this be fixed?

@rck-innovium
Copy link
Contributor

@yxieca , @bingwang-ms , can you please check on the coverage? Can this be fixed?

This is needed in SONiC 202111 as well. Can this be ported there?

},
false
SAI_ACL_ACTION_TYPE_PACKET_ACTION,
SAI_ACL_ACTION_TYPE_REDIRECT
Copy link
Contributor

Choose a reason for hiding this comment

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

redirect action should be only for the ingress and not egress.

preetham-singh pushed a commit to preetham-singh/sonic-swss that referenced this pull request Aug 6, 2022
)

What I did
This PR is derived from sonic-net#2205
Fix sonic-net/sonic-buildimage#10425

We were seeing ACL table creation failure on some platform because action_list is mandatory, while the action_list is not provided by aclorch.

Apr  1 01:24:11.702608 str2-7050cx3-acs-03 ERR swss#orchagent: :- validate: Action list for table DATAACL is mandatory
Apr  1 01:24:11.702608 str2-7050cx3-acs-03 ERR swss#orchagent: :- doAclTableTask: Failed to create ACL table DATAACL, invalid configuration
Apr  1 01:24:11.702741 str2-7050cx3-acs-03 ERR swss#orchagent: :- validate: Action list for table EVERFLOW is mandatory
Apr  1 01:24:11.702741 str2-7050cx3-acs-03 ERR swss#orchagent: :- doAclTableTask: Failed to create ACL table EVERFLOW, invalid configuration
Apr  1 01:24:11.702926 str2-7050cx3-acs-03 ERR swss#orchagent: :- validate: Action list for table EVERFLOWV6 is mandatory
Apr  1 01:24:11.702926 str2-7050cx3-acs-03 ERR swss#orchagent: :- doAclTableTask: Failed to create ACL table EVERFLOWV6, invalid configuration
This PR fixed the issue by adding default action_list to the default ACL table type if not present.

Why I did it
Fix the ACL table creation issue.

How I verified it
Verified by running test_acl and test_everflow on Broadcom TD3 platform

Signed-off-by: bingwang <wang.bing@microsoft.com>
Co-authored-by: syuan <syuan@arista.com>
judyjoseph pushed a commit to judyjoseph/sonic-swss that referenced this pull request Oct 27, 2022
)

What I did
This PR is derived from sonic-net#2205
Fix sonic-net/sonic-buildimage#10425

We were seeing ACL table creation failure on some platform because action_list is mandatory, while the action_list is not provided by aclorch.

Apr  1 01:24:11.702608 str2-7050cx3-acs-03 ERR swss#orchagent: :- validate: Action list for table DATAACL is mandatory
Apr  1 01:24:11.702608 str2-7050cx3-acs-03 ERR swss#orchagent: :- doAclTableTask: Failed to create ACL table DATAACL, invalid configuration
Apr  1 01:24:11.702741 str2-7050cx3-acs-03 ERR swss#orchagent: :- validate: Action list for table EVERFLOW is mandatory
Apr  1 01:24:11.702741 str2-7050cx3-acs-03 ERR swss#orchagent: :- doAclTableTask: Failed to create ACL table EVERFLOW, invalid configuration
Apr  1 01:24:11.702926 str2-7050cx3-acs-03 ERR swss#orchagent: :- validate: Action list for table EVERFLOWV6 is mandatory
Apr  1 01:24:11.702926 str2-7050cx3-acs-03 ERR swss#orchagent: :- doAclTableTask: Failed to create ACL table EVERFLOWV6, invalid configuration
This PR fixed the issue by adding default action_list to the default ACL table type if not present.

Why I did it
Fix the ACL table creation issue.

How I verified it
Verified by running test_acl and test_everflow on Broadcom TD3 platform

Signed-off-by: bingwang <wang.bing@microsoft.com>
Co-authored-by: syuan <syuan@arista.com>
judyjoseph added a commit that referenced this pull request Oct 27, 2022
[ACL] Add default action_list for default ACL table type (#2298)
Create ACL table fails due to incorrect check for supported ACL actions #11235 (#2351)
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.

[ACL] Failed to create ACL table because Action list is mandatory
7 participants