Skip to content

Commit dd9bd68

Browse files
authored
[ACL] Record service ports individually and add them to the acl_table_ports (sonic-net#19080)
Description of PR Summary: Fixes # (issue) Record service ports individually and add them to the acl_table_ports
1 parent 70f0a9b commit dd9bd68

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

tests/acl/test_acl.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ def setup(duthosts, ptfhost, rand_selected_dut, rand_selected_front_end_dut, ran
367367
# Get the list of upstream/downstream ports
368368
downstream_ports = defaultdict(list)
369369
upstream_ports = defaultdict(list)
370+
upstream_service_ports = defaultdict(list)
370371
downstream_port_ids = []
371372
upstream_port_ids = []
372373
upstream_port_id_to_router_mac_map = {}
@@ -419,6 +420,8 @@ def setup(duthosts, ptfhost, rand_selected_dut, rand_selected_front_end_dut, ran
419420
upstream_ports[neighbor['namespace']].append(interface)
420421
upstream_port_ids.append(port_id)
421422
upstream_port_id_to_router_mac_map[port_id] = rand_selected_dut.facts["router_mac"]
423+
if neigh_type == "PT0":
424+
upstream_service_ports[neighbor['namespace']].append(interface)
422425

423426
# stop garp service for single tor
424427
if 'dualtor' not in tbinfo['topo']['name']:
@@ -466,9 +469,7 @@ def setup(duthosts, ptfhost, rand_selected_dut, rand_selected_front_end_dut, ran
466469
)
467470
or 't1-isolated' in tbinfo["topo"]["name"]
468471
)
469-
and not re.match(r"t0-.*s\d+", tbinfo["topo"]["name"])
470472
):
471-
472473
for k, v in list(port_channels.items()):
473474
acl_table_ports[v['namespace']].append(k)
474475
# In multi-asic we need config both in host and namespace.
@@ -483,6 +484,13 @@ def setup(duthosts, ptfhost, rand_selected_dut, rand_selected_front_end_dut, ran
483484
if namespace:
484485
acl_table_ports[''] += port
485486

487+
if re.match(r"t0-.*s\d+", tbinfo["topo"]["name"]):
488+
for namespace, port in list(upstream_service_ports.items()):
489+
acl_table_ports[namespace] += port
490+
# In multi-asic we need config both in host and namespace.
491+
if namespace:
492+
acl_table_ports[''] += port
493+
486494
dest_mac_mapping = {
487495
"downlink->uplink": downstream_port_id_to_router_mac_map,
488496
"uplink->downlink": upstream_port_id_to_router_mac_map

0 commit comments

Comments
 (0)