Skip to content

Commit

Permalink
[acl] Remove Ethertype from L3V6 qualifiers (#1433)
Browse files Browse the repository at this point in the history
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 <daall@microsoft.com>
  • Loading branch information
daall committed Sep 19, 2020
1 parent f7b974f commit 2f5d2d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tests/mock_tests/aclorch_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ namespace aclorch_test
vector<swss::FieldValueTuple> 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" });

Expand All @@ -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;
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 2f5d2d9

Please sign in to comment.