Skip to content

Commit

Permalink
Add support to get fabric asic namespaces list. (#11793)
Browse files Browse the repository at this point in the history
Why I did it
VoQ chassis supervisor will have Fabric asics and the sub_role for fabric asics will be "Fabric".
The fabric asics namespaces are not being returned in get_all_namespaces() and is required in caclmgrd to add right cacl to allow internal docker traffic from fabric asic namespaces.
test_cacl_application fails on VoQ chassis Supervisor with the error:
Failed: Missing expected iptables rules: set(['-A INPUT -s 240.127.1.1/32 -d 240.127.1.1/32 -j ACCEPT', '-A INPUT -s 240.127.1.3/32 -d 240.127.1.1/32 -j ACCEPT', '-A INPUT -s 240.127.1.2/32 -d 240.127.1.1/32 -j ACCEPT'])

How I did it
Update get_all_namespaces to return fabric namespaces list.

How to verify it
Verified on VoQ chassis.
  • Loading branch information
SuvarnaMeenakshi authored and yxieca committed Aug 27, 2022
1 parent df36ef0 commit 3b04792
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sonic-py-common/sonic_py_common/multi_asic.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
ASIC_CONF_FILENAME = 'asic.conf'
FRONTEND_ASIC_SUB_ROLE = 'FrontEnd'
BACKEND_ASIC_SUB_ROLE = 'BackEnd'
FABRIC_ASIC_SUB_ROLE = 'Fabric'
EXTERNAL_PORT = 'Ext'
INTERNAL_PORT = 'Int'
PORT_CHANNEL_CFG_DB_TABLE = 'PORTCHANNEL'
Expand Down Expand Up @@ -208,6 +209,7 @@ def get_all_namespaces():
"""
front_ns = []
back_ns = []
fabric_ns = []
num_asics = get_num_asics()

if is_multi_asic():
Expand All @@ -222,8 +224,10 @@ def get_all_namespaces():
front_ns.append(namespace)
elif metadata['localhost']['sub_role'] == BACKEND_ASIC_SUB_ROLE:
back_ns.append(namespace)
elif metadata['localhost']['sub_role'] == FABRIC_ASIC_SUB_ROLE:
fabric_ns.append(namespace)

return {'front_ns': front_ns, 'back_ns': back_ns}
return {'front_ns': front_ns, 'back_ns': back_ns, 'fabric_ns': fabric_ns}


def get_namespace_list(namespace=None):
Expand Down

0 comments on commit 3b04792

Please sign in to comment.