-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Namespace]: Fix to reduce time and fix counters related MIB #139
Conversation
reduce the overall time taken. Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
unique across the device. The SAI object ID is unique for asic or within a namespace. Modify the existing code to make sure that data structures using SAI OID, it is not used as a key directly. Modify implementation for MIB tables using COUNTER_DB and ASIC_DB so that SAI OID is used to retrieve data only from a single namespace. Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
This pull request introduces 3 alerts when merging 389d92a into 253f58e - view on LGTM.com new alerts:
|
use sai oid as key. Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
|
||
self.if_bpid_map = Namespace.dbs_get_bridge_port_map(self.db_conn, mibs.ASIC_DB) | ||
self.if_bpid_map = Namespace.dbs_get_bridge_port_map(self.db_conn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we don't need second Argument Here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dbs_get_bridge_port_map() does not use the db name, the function only retrieves data from ASIC_DB, so did not have to use an argument to specify the db name.
if_idx = self.sai_oid_map[db_index][port_sai_id] | ||
else: | ||
continue | ||
rif_counters = self.db_conn[db_index].get_all(mibs.COUNTERS_DB, mibs.counter_table(rif_sai_id), blocking=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why blocking is True in this case ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous code did a get_all with blocking=true, so kept the same. should not cause an issue because we get based on rif_sai_id from the specific db instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but it will add to time taken ? same as original problem
@@ -1,11 +1,11 @@ | |||
{ | |||
"ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:{\"bridge_id\":\"oid:0x0\",\"bridge_type\":\"SAI_FDB_ENTRY_BRIDGE_TYPE_1Q\",\"mac\":\"7C:FE:90:80:9F:10\",\"switch_id\":\"oid:0x21000000000000\",\"vlan\":\"1000\"}": { | |||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a0000000006208", | |||
"SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID": "oid:0x3a000000000616", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what trigger all these below changes ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in mock tables are done so that the SAI ID for port and other objects are same in different namespace. Earlier, in the mock tables, it was unique across the device. To reflect the actual scenario where the same SAI Id can appear in a different namespace, the changes are made in asic_db and counter_db.
@@ -373,7 +376,7 @@ def init_sync_d_queue_tables(db_conn): | |||
|
|||
# Parse the queue_name_map and create the following maps: | |||
# port_queues_map -> {"if_index : queue_index" : sai_oid} | |||
# queue_stat_map -> {queue stat table name : {counter name : value}} | |||
# queue_stat_map -> {"if_index : queue stat table name" : {counter name : value}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some comment as why these changes are needed (OID overlap) in Multi-Asic platforms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as per comment.
for oid in self.vlan_oid_sai_map: | ||
if oid in self.vlan_oid_namespace: | ||
db_index = self.vlan_oid_namespace[oid] | ||
self.rif_counters[oid] = self.db_conn[db_index].get_all(mibs.COUNTERS_DB, mibs.counter_table(self.vlan_oid_sai_map[oid]), blocking=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the if condition will it not add to time taken ?
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Remove extra file |
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
- What I did
- How I did it
InterfacesMIB
InterfaceMIBObjects
cpfcIfTable
csqIfQosGroupStatsTable
- How to verify it
- Description for the changelog