Skip to content

Commit

Permalink
Add support for multi-asic
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidZagury committed Dec 28, 2023
1 parent f45e746 commit aecfeb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/sonic_ax_impl/mibs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ def init_sync_d_queue_tables(db_conn):
port_index = get_index_from_str(port_name)
key = queue_key(port_index, queue_index)
port_queues_map[key] = sai_id

queue_stat_name = queue_table(sai_id)
queue_stat = db_conn.get_all(COUNTERS_DB, queue_stat_name, blocking=False)
if queue_stat is not None:
Expand Down
11 changes: 5 additions & 6 deletions src/sonic_ax_impl/mibs/vendor/cisco/ciscoSwitchQosMIB.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def __init__(self):
"""
super().__init__()
self.db_conn = Namespace.init_namespace_dbs()
# establish connection to state database.
Namespace.connect_all_dbs(self.db_conn, mibs.STATE_DB)

self.lag_name_if_name_map = {}
self.if_name_lag_name_map = {}
self.oid_lag_name_map = {}
Expand All @@ -67,10 +70,6 @@ def __init__(self):
self.port_index_namespace = {}
self.namespace_db_map = Namespace.get_namespace_db_map(self.db_conn)

self.statedb = mibs.init_db()
self.statedb.connect(self.statedb.STATE_DB)


def reinit_connection(self):
Namespace.connect_namespace_dbs(self.db_conn)

Expand Down Expand Up @@ -137,8 +136,8 @@ def update_stats(self):

# The first half of queue id is for ucast, and second half is for mcast
# To simulate vendor OID, we wrap queues by max priority groups
port_max_queues = self.statedb.get_all(self.statedb.STATE_DB,
mibs.buffer_max_parm_table(self.oid_name_map[if_index]))['max_queues']
port_max_queues = Namespace.dbs_get_all(self.db_conn, mibs.STATE_DB,
mibs.buffer_max_parm_table(self.oid_name_map[if_index]))['max_queues']
pq_count = math.ceil(int(port_max_queues) / 2)

for queue in if_queues:
Expand Down

0 comments on commit aecfeb0

Please sign in to comment.