Skip to content

Commit

Permalink
Remove ACL tags from BM (#425)
Browse files Browse the repository at this point in the history
Signed-off-by: Marian Pritsak <[email protected]>
  • Loading branch information
marian-pritsak authored Sep 1, 2023
1 parent 3e9d07c commit 654b357
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 116 deletions.
2 changes: 0 additions & 2 deletions dash-pipeline/bmv2/dash_acl.p4
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ match_kind {
key = { \
meta. ## table_name ##_dash_acl_group_id : exact @name("meta.dash_acl_group_id:dash_acl_group_id") \
@Sai[type="sai_object_id_t", isresourcetype="true", objects="SAI_OBJECT_TYPE_DASH_ACL_GROUP"]; \
meta.dst_tag_map : ternary @name("meta.dst_tag_map:dst_tag"); \
meta.src_tag_map : ternary @name("meta.src_tag_map:src_tag"); \
meta.dst_ip_addr : LIST_MATCH @name("meta.dst_ip_addr:dip"); \
meta.src_ip_addr : LIST_MATCH @name("meta.src_ip_addr:sip"); \
meta.ip_protocol : LIST_MATCH @name("meta.ip_protocol:protocol"); \
Expand Down
4 changes: 0 additions & 4 deletions dash-pipeline/bmv2/dash_metadata.p4
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#include "dash_headers.p4"

typedef bit<32> tag_map_t;

struct encap_data_t {
bit<24> vni;
bit<24> dest_vnet_vni;
Expand Down Expand Up @@ -70,8 +68,6 @@ struct metadata_t {
bit<16> mapping_meter_class;
bit<16> meter_class;
bit<32> meter_bucket_index;
tag_map_t src_tag_map;
tag_map_t dst_tag_map;
}

#endif /* _SIRIUS_METADATA_P4_ */
31 changes: 0 additions & 31 deletions dash-pipeline/bmv2/dash_pipeline.p4
Original file line number Diff line number Diff line change
Expand Up @@ -345,34 +345,6 @@ control dash_ingress(
}
}

action set_src_tag(tag_map_t tag_map) {
meta.src_tag_map = tag_map;
}

@name("src_tag|dash_tag")
table src_tag {
key = {
meta.src_ip_addr : lpm @name("meta.src_ip_addr:sip");
}
actions = {
set_src_tag;
}
}

action set_dst_tag(tag_map_t tag_map) {
meta.dst_tag_map = tag_map;
}

@name("dst_tag|dash_tag")
table dst_tag {
key = {
meta.dst_ip_addr : lpm @name("meta.dst_ip_addr:dip");
}
actions = {
set_dst_tag;
}
}

apply {

#ifdef TARGET_DPDK_PNA
Expand Down Expand Up @@ -450,9 +422,6 @@ control dash_ingress(
}
acl_group.apply();

src_tag.apply();
dst_tag.apply();


if (meta.direction == dash_direction_t.OUTBOUND) {
outbound.apply(hdr, meta);
Expand Down
77 changes: 0 additions & 77 deletions test/test-cases/functional/ptf/saidashacl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,11 @@
from sai_dash_utils import VnetAPI


class Tag(object):
def __init__(self, saithrift, ip, mask, tag):
self.saithrift = saithrift
self.ip = ip
self.mask = mask
self.tag = tag
self.prefix = sai_thrift_ip_prefix_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4,
addr=sai_thrift_ip_addr_t(ip4=self.ip),
mask=sai_thrift_ip_addr_t(ip4=self.mask))
self.src_tag_entry = sai_thrift_src_tag_entry_t(switch_id=self.saithrift.switch_id, sip=self.prefix)
self.saithrift.create_entry(sai_thrift_create_src_tag_entry,
sai_thrift_remove_src_tag_entry, self.src_tag_entry, tag_map=self.tag)
self.dst_tag_entry = sai_thrift_dst_tag_entry_t(switch_id=self.saithrift.switch_id, dip=self.prefix)
self.saithrift.create_entry(sai_thrift_create_dst_tag_entry,
sai_thrift_remove_dst_tag_entry, self.dst_tag_entry, tag_map=self.tag)


class AclRuleTest(object):
def __init__(self,
saithrift,
acl_group,
protocol = 17,
stag = None,
dtag = None,
sip = None,
dip = None,
src_port = 1234,
Expand All @@ -47,8 +28,6 @@ def __init__(self,
self.priority = priority
self.action = action
self.exp_receive = exp_receive
self.stag = stag
self.dtag = dtag
self.src_port = src_port
self.dst_port = dst_port
if self.dip:
Expand All @@ -62,10 +41,6 @@ def __init__(self,
sai_thrift_remove_dash_acl_rule,
dash_acl_group_id=self.acl_group,
protocol=self.protocol,
src_tag=self.stag,
src_tag_mask=self.stag,
dst_tag=self.dtag,
dst_tag_mask=self.dtag,
sip=sip,
dip=dip,
src_port = self.src_port,
Expand Down Expand Up @@ -278,58 +253,6 @@ def setupTest(self):
action=SAI_DASH_ACL_RULE_ACTION_DENY,
exp_receive=False))

self.tag1 = Tag(self, ip = "10.1.2.4", mask = "255.255.255.254", tag = 0x11)
self.tests.append(AclRuleTest(self,
acl_group=self.out_v4_stage1_acl_group_id,
protocol=17,
stag = 0x1,
priority=3,
src_port=1234,
action=SAI_DASH_ACL_RULE_ACTION_PERMIT,
exp_receive=True,
test_sip = "10.1.2.4",
test_dip = self.dst_ca_ip))
self.tests.append(AclRuleTest(self,
acl_group=None,
exp_receive=True,
src_port=1234,
test_sip = "10.1.2.5",
test_dip = self.dst_ca_ip))
self.tests.append(AclRuleTest(self,
acl_group=self.out_v4_stage1_acl_group_id,
protocol=17,
stag = 0x10,
priority=3,
src_port=4321,
action=SAI_DASH_ACL_RULE_ACTION_DENY,
exp_receive=False,
test_sip = "10.1.2.4",
test_dip = self.dst_ca_ip))
self.tests.append(AclRuleTest(self,
acl_group=None,
exp_receive=False,
src_port=4321,
test_sip = "10.1.2.5",
test_dip = self.dst_ca_ip))
self.tests.append(AclRuleTest(self,
acl_group=None,
exp_receive=False,
src_port=1111,
test_sip = "10.1.2.4",
test_dip = self.dst_ca_ip))

self.tag2 = Tag(self, ip = self.dst_ca_ip, mask = "255.255.255.255", tag = 0x100)
self.tests.append(AclRuleTest(self,
acl_group=self.out_v4_stage1_acl_group_id,
protocol=17,
dtag = 0x100,
priority=3,
src_port=2222,
action=SAI_DASH_ACL_RULE_ACTION_PERMIT,
exp_receive=True,
test_sip = "10.1.2.6",
test_dip = self.dst_ca_ip))

def setUp(self):
super(SaiThriftDashAclTest, self).setUp()
self.cleaned_up = False
Expand Down
2 changes: 0 additions & 2 deletions test/test-cases/scale/saic/test_sai_vnet_outbound_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ def test_vnet_inbound_simple_create(self, dpu):
def test_vnet_inbound_simple_packet_modification(self, dpu, dataplane):
"""Verify proper packet transformation."""

dataplane.set_config()

SRC_VM_IP = "10.1.1.10"
OUTER_SMAC = "00:00:05:06:06:06"
OUR_MAC = "00:00:02:03:04:05"
Expand Down

0 comments on commit 654b357

Please sign in to comment.