[rfc1213] Interface MIB add l3 vlan interfaces & aggregate rif counters#169
Conversation
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Signed-off-by: Mykola Faryma <[email protected]>
Fix for the following error in syslog: Oct 9 10:07:21.427210 mts-sonic-dut ERR snmp#snmp-subagent [ax_interface] ERROR: MIBUpdater.start() caught an unexpected exception during update_data()#012Traceback (most recent call last):sonic-net#12 File "/usr/local/lib/python3.7/dist-packa ges/ax_interface/mib.py", line 43, in start#012 self.update_data()sonic-net#12 File "/usr/local/lib/python3.7/dist-packages/sonic_ax_impl/mibs/ietf/rfc1213.py", line 245, in update_data#012 self.update_rif_counters()sonic-net#12 File "/usr/local /lib/python3.7/dist-packages/sonic_ax_impl/mibs/ietf/rfc1213.py", line 271, in update_rif_counters#012 for sai_id in rif_sai_ids}sonic-net#12 File "/usr/local/lib/python3.7/dist-packages/sonic_ax_impl/mibs/ietf/rfc1213.py", line 271, in <dic tcomp>sonic-net#12 for sai_id in rif_sai_ids}sonic-net#12 File "/usr/local/lib/python3.7/dist-packages/sonic_ax_impl/mibs/__init__.py", line 627, in dbs_get_all#012 ns_result = db_conn.get_all(db_name, _hash, *args, **tmp_kwargs)sonic-net#12 File "/usr/ local/lib/python3.7/dist-packages/swsssdk/dbconnector.py", line 295, in get_all#012 return self.dbintf.get_all(db_name, _hash, *args, **kwargs)sonic-net#12 File "/usr/local/lib/python3.7/dist-packages/swsssdk/interface.py", line 38, in wrapp ed#012 ret_data = f(inst, db_name, *args, **kwargs)sonic-net#12 File "/usr/local/lib/python3.7/dist-packages/swsssdk/interface.py", line 314, in get_all#012 raise UnavailableDataError(message, _hash)#012swsssdk.exceptions.UnavailableDataE rror: Key 'b'COUNTERS:oid:0x60000000005d3'' unavailable in database 'COUNTERS_DB' Signed-off-by: Stepan Blyshchak <[email protected]>
Signed-off-by: Stepan Blyshchak <[email protected]>
|
Please resolve the conflicts. #Closed |
| NEIGH_TABLE:device:ipv4_address | ||
| """ | ||
| _, device, ip = neigh_key.split(':') | ||
| return device, ip |
There was a problem hiding this comment.
de [](start = 11, length = 2)
If you merge latest master, you don't need to use byte array and just use string. #Closed
| self.mgmt_oid_name_map, \ | ||
| self.mgmt_alias_map = mibs.init_mgmt_interface_tables(self.db_conn[0]) | ||
|
|
||
| self.vlan_name_map, \ |
There was a problem hiding this comment.
bytes [](start = 29, length = 5)
If you merge latest master, you don't need to encoding to byte array.
| from bisect import bisect_right | ||
|
|
||
| from sonic_ax_impl import mibs | ||
| from sonic_ax_impl import logger |
There was a problem hiding this comment.
logger [](start = 26, length = 6)
Merge with above line #Closed
SuvarnaMeenakshi
left a comment
There was a problem hiding this comment.
similar to test_interfaces, can you add changes in tests/namespace/test_interfaces.
Also, mock_db changes for multi-asic mock-dbs as well.
Signed-off-by: Stepan Blyshchak <[email protected]>
Signed-off-by: Stepan Blyshchak <[email protected]>
Signed-off-by: Stepan Blyshchak <[email protected]>
|
This pull request introduces 1 alert when merging 144658f into 57e54d9 - view on LGTM.com new alerts:
|
|
Please resolve LGTM alert. Others look good to me. #Closed |
Signed-off-by: Stepan Blyshchak <[email protected]>
…an_counters Signed-off-by: Stepan Blyshchak <[email protected]>
|
Can one of the admins verify this patch? |
qiluo-msft
left a comment
There was a problem hiding this comment.
Please also check with other reviewers.
|
|
||
| def test_getnextpdu_first_bp_ifindex(self): | ||
| oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 1,1004)) | ||
| oid = ObjectIdentifier(11, 0, 0, 0, (1, 3, 6, 1, 2, 1, 2, 2, 1, 1, 8999)) |
There was a problem hiding this comment.
Is this change required? There is no new interface added in namespace mock_dbs, is that right? #Closed
There was a problem hiding this comment.
There was a problem hiding this comment.
I have added Ethernet16 https://github.com/Azure/sonic-snmpagent/pull/169/files/a00e69e25dfc7c17f2554a625b57c447aff477c0#diff-fe4c39c260164f04bfe84f3d68d6f6a5a28850a840667a26aaba67a9fc1afacbR48.
Now, different asic dbs have different port table.
Closed. |
|
@qiluo-msft can you please merge so we can proceed with the submodule update? |
| if port_sai_id in self.if_id_map: | ||
| port_idx = mibs.get_index_from_str(self.if_id_map[port_sai_id]) | ||
| for port_counter_name, rif_counter_name in mibs.RIF_DROPS_AGGR_MAP.items(): | ||
| self.if_counters[port_idx][port_counter_name] = \ |
There was a problem hiding this comment.
self.if_counters [](start = 20, length = 16)
I see you change self.if_counters[][] type from str to int.
Although this is working in python, however we are moving the library to sonic-swss-common SWIG wrapper, and this will make SWIG confused.
Please make type fixed. #Closed
…f counters (sonic-net#169)" This reverts commit e54036c.
…f counters (#169)" (#191) **- What I did** Revert all drop SNMP counters issue. Because it introduces inconsistency with RFC2863 **- How I did it** Revert 3 commits related to this feature. **- How to verify it** The RFC1213 MIB does not have VLAN interfaces and does not perform counters accumulation.
…egate rif counters (sonic-net#169)" (sonic-net#191)" This reverts commit dfde06e.
…egate rif counters (sonic-net#169)" (sonic-net#191)" This reverts commit dfde06e.
…for RFC2863 (#218) - What I did Restored snmp vlan support per RFC1213, which had been reverted due to inconsistency with RFC2863, and added the missing support for RFC2863. Added unit tests for RFC2863. - How I did it Reverted #191, which was itself a revert of #169. Then added code to support vlan in rfc2863.py and unit tests. Since a long time has elapsed since the original commit and other code has been pushed in the meantime, great care is needed in merging. Note in particular that mibs.init_sync_d_lag_tables now returns five parameters, the last two of which were added: lag_sai_map and sai_lap_map. This PR needs one of those maps, and a concurrent commit supporting RFC4363 needs the other, so all the callers were updated and use the one they need. - How to verify it Unit tests are run via make target/python-wheels/asyncsnmp-2.1.0-py3-none-any.whl. See also Azure#169. - Description for the changelog Restored support for aggregated router interface counters and L3 VLAN counters to RFC1213 MIB, and extended to RFC2863.
…for RFC2863 (sonic-net#218) - What I did Restored snmp vlan support per RFC1213, which had been reverted due to inconsistency with RFC2863, and added the missing support for RFC2863. Added unit tests for RFC2863. - How I did it Reverted sonic-net#191, which was itself a revert of sonic-net#169. Then added code to support vlan in rfc2863.py and unit tests. Since a long time has elapsed since the original commit and other code has been pushed in the meantime, great care is needed in merging. Note in particular that mibs.init_sync_d_lag_tables now returns five parameters, the last two of which were added: lag_sai_map and sai_lap_map. This PR needs one of those maps, and a concurrent commit supporting RFC4363 needs the other, so all the callers were updated and use the one they need. - How to verify it Unit tests are run via make target/python-wheels/asyncsnmp-2.1.0-py3-none-any.whl. See also Azure#169. - Description for the changelog Restored support for aggregated router interface counters and L3 VLAN counters to RFC1213 MIB, and extended to RFC2863. (cherry picked from commit 266bd15)
…for RFC2863 (sonic-net#218) - What I did Restored snmp vlan support per RFC1213, which had been reverted due to inconsistency with RFC2863, and added the missing support for RFC2863. Added unit tests for RFC2863. - How I did it Reverted sonic-net#191, which was itself a revert of sonic-net#169. Then added code to support vlan in rfc2863.py and unit tests. Since a long time has elapsed since the original commit and other code has been pushed in the meantime, great care is needed in merging. Note in particular that mibs.init_sync_d_lag_tables now returns five parameters, the last two of which were added: lag_sai_map and sai_lap_map. This PR needs one of those maps, and a concurrent commit supporting RFC4363 needs the other, so all the callers were updated and use the one they need. - How to verify it Unit tests are run via make target/python-wheels/asyncsnmp-2.1.0-py3-none-any.whl. See also Azure#169. - Description for the changelog Restored support for aggregated router interface counters and L3 VLAN counters to RFC1213 MIB, and extended to RFC2863. (cherry picked from commit 266bd15)
…rs (sonic-net#169) **- What I did** Rework based on sonic-net#133 and feedback sonic-net#148. **- How I did it** - merge sonic-net#133 with upstream master. - Fix UnavailableDataError when RIF counters are not enabled. - Make RIF keys in maps unique in multi asic env. **- How to verify it** - Disable rif counters - restart swss - snmpwalk - Verify no UnavailableDataError in logs - Verify port counters are returned - Enable rif counters - snmpwalk - Verify no error in logs - Verify error in/out counters are aggregated for rif ports and portchannels - Verify VLAN RIF counters are present in the MIB. **- Description for the changelog** Added support for aggregated router interface counters and L3 VLAN counters to RFC1213 MIB.
…f counters (sonic-net#169)" (sonic-net#191) **- What I did** Revert all drop SNMP counters issue. Because it introduces inconsistency with RFC2863 **- How I did it** Revert 3 commits related to this feature. **- How to verify it** The RFC1213 MIB does not have VLAN interfaces and does not perform counters accumulation.
…for RFC2863 (sonic-net#218) - What I did Restored snmp vlan support per RFC1213, which had been reverted due to inconsistency with RFC2863, and added the missing support for RFC2863. Added unit tests for RFC2863. - How I did it Reverted sonic-net#191, which was itself a revert of sonic-net#169. Then added code to support vlan in rfc2863.py and unit tests. Since a long time has elapsed since the original commit and other code has been pushed in the meantime, great care is needed in merging. Note in particular that mibs.init_sync_d_lag_tables now returns five parameters, the last two of which were added: lag_sai_map and sai_lap_map. This PR needs one of those maps, and a concurrent commit supporting RFC4363 needs the other, so all the callers were updated and use the one they need. - How to verify it Unit tests are run via make target/python-wheels/asyncsnmp-2.1.0-py3-none-any.whl. See also Azure#169. - Description for the changelog Restored support for aggregated router interface counters and L3 VLAN counters to RFC1213 MIB, and extended to RFC2863.
- What I did
Rework based on #133 and feedback #148.
- How I did it
- How to verify it
- Description for the changelog
Added support for aggregated router interface counters and L3 VLAN counters to RFC1213 MIB.