**- Why I did it**
PR https://github.com/Azure/sonic-platform-common/pull/102 modified the name of the SFF-8436 (QSFP) method to align the method name between all drivers, renaming it from `parse_qsfp_dom_capability` to `parse_dom_capability`. Once the submodule was updated, the callers using the old nomenclature broke. This PR updates all callers to use the new naming convention.
**- How I did it**
Update the name of the function globally for all calls into the SFF-8436 driver.
Note that the QSFP-DD driver still uses the old nomenclature and should be modified similarly. I will open a PR to handle this separately.
Submodule updates include the following commits:
* src/sonic-utilities 9dc58ea...f9eb739 (18):
> Remove unnecessary calls to str.encode() now that the package is Python 3; Fix deprecation warning (#1260)
> [generate_dump] Ignoring file/directory not found Errors (#1201)
> Fixed porstat rate and util issues (#1140)
> fix error: interface counters is mismatch after warm-reboot (#1099)
> Remove unnecessary calls to str.decode() now that the package is Python 3 (#1255)
> [acl-loader] Make list sorting compliant with Python 3 (#1257)
> Replace hard-coded fast-reboot with variable. And some typo corrections (#1254)
> [configlet][portconfig] Remove calls to dict.has_key() which is not available in Python 3 (#1247)
> Remove unnecessary conversions to list() and calls to dict.keys() (#1243)
> Clean up LGTM alerts (#1239)
> Add 'requests' as install dependency in setup.py (#1240)
> Convert to Python 3 (#1128)
> Fix mock SonicV2Connector in python3: use decode_responses mode so caller code will be the same as python2 (#1238)
> [tests] Do not trim from PATH if we did not append to it; Clean up/fix shebangs in scripts (#1233)
> Updates to bgp config and show commands with BGP_INTERNAL_NEIGHBOR table (#1224)
> [cli]: NAT show commands newline issue after migrated to Python3 (#1204)
> [doc]: Update Command-Reference.md (#1231)
> Added 'import sys' in feature.py file (#1232)
* src/sonic-py-swsssdk 9d9f0c6...1664be9 (2):
> Fix: no need to decode() after redis client scan, so it will work for both python2 and python3 (#96)
> FieldValueMap `contains`(`in`) will also work when migrated to libswsscommon(C++ with SWIG wrapper) (#94)
- Also fix Python 3-related issues:
- Use integer (floor) division in config_samples.py (sonic-config-engine)
- Replace print statement with print function in eeprom.py plugin for x86_64-kvm_x86_64-r0 platform
- Update all platform plugins to be compatible with both Python 2 and Python 3
- Remove shebangs from plugins files which are not intended to be executable
- Replace tabs with spaces in Python plugin files and fix alignment, because Python 3 is more strict
- Remove trailing whitespace from plugins files
Fix 259 alerts reported by the LGTM tool:
- 245 for Unused import
- 7 for Testing equality to None
- 5 for Duplicate key in dict literal
- 1 for Module is imported more than once
- 1 for Unused local variable
Align SFP key names with new standard defined in https://github.com/Azure/sonic-platform-common/pull/97
- hardwarerev -> hardware_rev
- serialnum -> serial
- manufacturename -> manufacturer
- modelname -> model
- Connector -> connector
* Change port index in port_config.ini to 1-based
* Add default port index to port_config.ini, change platform plugins to accept 1-based port index
* fix port index in sfp_event.py
* New SKU support for MSN3420
Signed-off-by: Shlomi Bitton <shlomibi@mellanox.com>
Conflicts:
device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py
* Add CPLD's
* Symlink fixes and semantics
* Adding new platform at end of lines
* [MultiDB] (except ./src and ./dockers dirs): replace redis-cli with sonic-db-cli and use new DBConnector
* update comment for a potential bug
* update comment
* add TODO maker as review reqirement
xcvrd is broken because a newly introduced interface get_transceiver_dom_threshold_info_dict in common code calls a unsupported interface _read_eeprom_specific_bytes.
Fix the issue by implement get_transceiver_dom_threshold_info_dict to avoid calling the unsupported interface.
* fix the issue Bug SW #1816356 which is due to failing to test whether dom supported prior to reading dom data
* use pre-defined variable to avoid magic number.
no need to read 16 bytes, 1 byte is enough since calibration and dom capability are all in bytes at offset 92
Variables SFP_VLOT_OFFSET and QSFP_VLOT_OFFSET containing the typo are originally defined in repo sonic-platform-common. The typo has been fixed in PR #33. However, some Mellanox-specific code hasn't updated correspondingly, which results in xcvrd fail to start.
This PR updates the variable name in Mellanox-specific code correspondingly to fix that.
* [sfputil]Remove the dependency on sysfs for sfputil, mainly get_presence and port_to_eeprom_mapping
Remove the dependency on sysfs, including:
1. rewrite get_presence by using ethtool;
2. remove interface port_to_eeprom_mapping which is no longer referenced;
3. remove code that references port_to_eeprom_mapping and _port_to_eeprom_mapping;
4. remove private member qsfp_sysfs_path which is no longer referenced.
* [sfputil.py]
minor adjustment: move the presence=False to the beginning of get_presence.
* [device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py]
purpose and restrictions
1. reading eeprom via ethtool.
2. avoid changing common codes shared by all the manufacture (sonic-platform-common), contrain all the modifications with Mellanox-specific code.
current implementation
A new class based on SfpUtilBase and a new method _read_eeprom_specific_bytes_via_ethtool have been introduced in order to change the way the eprom DOM data is read. Typically the best practice to do this kind of thing is to contrain the modification within the function which execute reading operations only and keep other stuffs (especially the interface) untouched. However, this can hardly be achieved since the original reading function takes the file object as input parameter to represent the port. It is done by having the file object to point to /var/run/hwmanagement files, which will not be maintained in the future. As a result, a new interface has to be introduced with a port number/name as input parameter in order to get rid of the dependency on the those files:
_read_eeprom_specific_bytes_via_ethtool
Since the interface changed, all methods that call the interface should also be overwritten in order to call the new interface, including:
_read_eeprom_devid
get_transceiver_info_dict
get_transceiver_dom_info_dict
Only interface used to read eeprom DOM has been replaced and the main logic has not been changed except the following mentioned.
1. reading DOM data for sfp port, which is implementioned in get_transceiver_dom_info_dict. In this case a "calibration" should be firstly read from eeprom before other values like temperature, voltage, rx/tx power, can be parsed. However, this has been ignored in the original code, resulting in that the data cann't be parsed.
2. In the original implemention the data area containing the data are read from DOM separatedly in order to avoid read uncessary data and achieve a better performance. Having used ethtool to read DOM data, the performance gap between reading all the area and reading the spot data separatedly has been narrowed to almost zero. To make the code neat and readable, we change the way to read this data.
* [sfputil] Returns dict with all data set to N/A for ports without dom support
Currently, the way in which dom data is read has been changed from using sysfs to using ethtool.
The ethtool returns None for ports without dom support, resulting in None being returned. However, this fails xcvrd to add the TRANSCEIVER_DOM_SENSOR table entry of associated port to CONFIG_DB and then causes SNMP fail.
To address this issue a default dict is initialized with all data set to 'N/A' and is returned is the above case.
BTW, in the original implementation which sysfs is used to read dom data, even though non-None data is returned for ports without dom support, it does not contain valid data. This can result in wrong data in TRANSCEIVER_DOM_SENSOR table.
* [sfputil]
removing unnecessary empty lines
removing redundent code
replacing hardcoding strings/numbers with predefined const variables
* Use default timeout value which will block the select function
* Submodule update for argument type issue in Select class
Submodule update sonic-swss-common:
e8caaea - Align the argument type with epoll_wait() (#255)
3ea133d - [selectable]: Update throw message (#253)
Signed-off-by: Kevin Wang <kevinw@mellanox.com>
Update the hw-mgmt to latest release V.2.0.0060.
Update the related files according to the latest hw-mgmt.
Signed-off-by: Kevin Wang <kevinw@mellanox.com>
* [mlnx-sfpplugin] enhancement to support tranceiver sensor monitoring
* Modify the eeprom folder to make it accessably from pmon container
* implement the get_transceiver_change_event API
file change list
modified: device/mellanox/x86_64-mlnx_lssn2700-r0/plugins/sfputil.py
modified: device/mellanox/x86_64-mlnx_msn2100-r0/plugins/sfputil.py
modified: device/mellanox/x86_64-mlnx_msn2410-r0/plugins/sfputil.py
modified: device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py
modified: device/mellanox/x86_64-mlnx_msn2740-r0/plugins/sfputil.py
signed-off-by Liu Kebo kebol@mellanox.com
* remove commented code
* revise the get_transceiver_change_event implementation and remove unused function
* remove blank
( All device-specific files now reside under /device directory in a <vendor-name>/<platform-string>/<hardware-SKU> directory structure in repo.
* Device-specific files are now packaged into a Debian package (sonic-device-data) and are now installed to /usr/share/sonic/device/<platform-string>/<hardware-SKU>/ directory on switch.