From 2f5d2d99dfae506333bddda9de2f289f92bb889b Mon Sep 17 00:00:00 2001 From: Danny Allen Date: Fri, 18 Sep 2020 23:31:35 -0700 Subject: [PATCH] [acl] Remove Ethertype from L3V6 qualifiers (#1433) This change was already done for MIRRORV6 tables a while back. ETHER_TYPE is unnecessary for V6 tables as the ethertype should always be the same (86DD) for IPv6 traffic. Additionally, this qualifier breaks IPv6 support on some platforms (e.g. Mellanox). Signed-off-by: Danny Allen --- orchagent/aclorch.cpp | 8 +++++++- tests/mock_tests/aclorch_ut.cpp | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/orchagent/aclorch.cpp b/orchagent/aclorch.cpp index 4d5d39e017fe..3f47cb38730b 100644 --- a/orchagent/aclorch.cpp +++ b/orchagent/aclorch.cpp @@ -1036,6 +1036,12 @@ bool AclRuleL3V6::validateAddMatch(string attr_name, string attr_value) return false; } + if (attr_name == MATCH_ETHER_TYPE) + { + SWSS_LOG_ERROR("Ethertype match is not supported for table type L3V6"); + return false; + } + return AclRule::validateAddMatch(attr_name, attr_value); } @@ -1356,7 +1362,7 @@ bool AclTable::create() return status == SAI_STATUS_SUCCESS; } - if (type != ACL_TABLE_MIRRORV6) + if (type != ACL_TABLE_MIRRORV6 && type != ACL_TABLE_L3V6) { attr.id = SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE; attr.value.booldata = true; diff --git a/tests/mock_tests/aclorch_ut.cpp b/tests/mock_tests/aclorch_ut.cpp index 65c1862e8c35..cc0ca8941f68 100644 --- a/tests/mock_tests/aclorch_ut.cpp +++ b/tests/mock_tests/aclorch_ut.cpp @@ -388,7 +388,6 @@ namespace aclorch_test vector fields; fields.push_back({ "SAI_ACL_TABLE_ATTR_ACL_BIND_POINT_TYPE_LIST", "2:SAI_ACL_BIND_POINT_TYPE_PORT,SAI_ACL_BIND_POINT_TYPE_LAG" }); - fields.push_back({ "SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE", "true" }); fields.push_back({ "SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE", "true" }); fields.push_back({ "SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL", "true" }); @@ -400,6 +399,7 @@ namespace aclorch_test switch (acl_table.type) { case ACL_TABLE_L3: + fields.push_back({ "SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE", "true" }); fields.push_back({ "SAI_ACL_TABLE_ATTR_FIELD_SRC_IP", "true" }); fields.push_back({ "SAI_ACL_TABLE_ATTR_FIELD_DST_IP", "true" }); break; @@ -898,7 +898,7 @@ namespace aclorch_test // // Using fixed ports = {"1,2"} for now. // The bind operations will be another separately test cases. - TEST_F(AclOrchTest, ACL_Creation_and_Destorying) + TEST_F(AclOrchTest, ACL_Creation_and_Destruction) { auto orch = createAclOrch();