From 20cd3243c07b384b31a32fe324258aabb765dab0 Mon Sep 17 00:00:00 2001 From: SuvarnaMeenakshi Date: Thu, 23 Jul 2020 15:03:26 -0700 Subject: [PATCH 1/2] [LLDP]: LLDPRemTableUpdater index in OID is a tuple of (if index, remote time mark, remote device index). In case of multi-asic platform, when querying this MIB it can happen that same if index result is seen in SNMP walk, with a different remote time mark. To avoid showing same if index result in the result, set remote time mark to 0. Signed-off-by: SuvarnaMeenakshi --- src/sonic_ax_impl/mibs/ieee802_1ab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic_ax_impl/mibs/ieee802_1ab.py b/src/sonic_ax_impl/mibs/ieee802_1ab.py index 6b36ff866..574b7267d 100644 --- a/src/sonic_ax_impl/mibs/ieee802_1ab.py +++ b/src/sonic_ax_impl/mibs/ieee802_1ab.py @@ -430,7 +430,7 @@ def update_data(self): if not lldp_kvs: continue try: - time_mark = int(lldp_kvs[b'lldp_rem_time_mark']) + time_mark = 0 remote_index = int(lldp_kvs[b'lldp_rem_index']) self.if_range.append((time_mark, if_oid, From 6e4e2266d0e66679892856c2af5258bfe8cd7aee Mon Sep 17 00:00:00 2001 From: SuvarnaMeenakshi Date: Wed, 29 Jul 2020 11:13:28 -0700 Subject: [PATCH 2/2] Add code comment. Signed-off-by: SuvarnaMeenakshi --- src/sonic_ax_impl/mibs/ieee802_1ab.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sonic_ax_impl/mibs/ieee802_1ab.py b/src/sonic_ax_impl/mibs/ieee802_1ab.py index 574b7267d..7d628949e 100644 --- a/src/sonic_ax_impl/mibs/ieee802_1ab.py +++ b/src/sonic_ax_impl/mibs/ieee802_1ab.py @@ -430,6 +430,11 @@ def update_data(self): if not lldp_kvs: continue try: + # OID index for this MIB consists of remote time mark, if_oid, remote_index. + # For multi-asic platform, it can happen that same interface index result + # is seen in SNMP walk, with a different remote time mark. + # To avoid repeating the data of same interface index with different remote + # time mark, remote time mark is made as 0 in the OID indexing. time_mark = 0 remote_index = int(lldp_kvs[b'lldp_rem_index']) self.if_range.append((time_mark,