Commit Graph

31 Commits

Author SHA1 Message Date
Junchao-Mellanox
06b5ad02ac [Mellanox] Re-initialize SFP object when detecting a new SFP insertion (#5695)
When detecting a new SFP insertion, read its SFP type and DOM capability from EEPROM again.

SFP object will be initialized to a certain type even if no SFP present. A case could be:

1. A SFP object is initialized to QSFP type by default when there is no SFP present
2. User insert a SFP with an adapter to this QSFP port
3. The SFP object fail to read EEPROM because it still treats itself as QSFP.

This PR fixes this issue.
2020-10-30 09:04:26 -07:00
Kebo Liu
ae3f09246c [Mellanox] Optimize SFP Platform API implementation (#5476)
Each SFP object inside Chassis will open an SDK client, this is not necessary and SDK client can be shared between SFP objects.
2020-10-21 08:13:59 -07:00
Kebo Liu
ae3d458d48 [Mellanox] Refactor platform API to remove dependency on database (#5468)
**- Why I did it**
- Platform API implementation using sonic-cfggen to get platform name and SKU name, which will fail when the database is not available.
- Chassis name is not correctly assigned, it shall be assigned with EEPROM TLV "Product Name", instead of SKU name
- Chassis model is not implemented, it shall be assigned with EEPROM TLV "Part Number"

**- How I did it**

1. Chassis

> - Get platform name from /host/machine.conf
> - Remove get SKU name with sonic-cfggen
> - Get Chassis name and model from EEPROM TLV "Product Name" and "Part Number"
> - Add function to return model

2. EEPROM

> - Add function to return product name and part number

3. Platform

> - Init EEPROM on the host side, so also can get the Chassis name model from EEPROM on the host side.
2020-10-06 11:30:16 -07:00
Joe LeVeque
309a098b21
[201911][Python] Migrate applications/scripts to import sonic-py-common package (#5132)
As part of consolidating all common Python-based functionality into the new sonic-py-common package, this pull request:
1. Redirects all Python applications/scripts in sonic-buildimage repo which previously imported sonic_device_util or sonic_daemon_base to instead import sonic-py-common, which was added to the 201911 branch in https://github.com/Azure/sonic-buildimage/pull/5063
2. Replaces all calls to `sonic_device_util.get_platform_info()` to instead call `sonic_py_common.get_platform()` and removes any calls to `sonic_device_util.get_machine_info()` which are no longer necessary (i.e., those which were only used to pass the results to `sonic_device_util.get_platform_info()`.
3. Removes unused imports to the now-deprecated sonic-daemon-base package and sonic_device_util.py module

This is a step toward resolving https://github.com/Azure/sonic-buildimage/issues/4999
2020-08-13 16:35:53 -07:00
Nazarii Hnydyn
0ec979dd30
[Mellanox] Fix SN3700 platform string. (#5035)
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
2020-07-25 03:04:03 -07:00
Junchao-Mellanox
acafde1895 [Mellanox] Change port index in port_config.ini to 1-based (#4781)
* 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
2020-06-28 07:24:10 -07:00
madhanmellanox
337502c220
converting to Platform based utils (#4830)
Co-authored-by: Madhan Babu <madhan@arc-build-server.mtr.labs.mlnx>
2020-06-23 09:12:54 -07:00
Junchao-Mellanox
62690f504a
[Mellanox] Initialize system LED color to green for 201911 (#4743)
* [Mellanox] Initialize system LED color to green for 201911

* Rename variable to make it more readable
2020-06-16 15:38:17 +03:00
Nazarii Hnydyn
50f4e7de5f
[Mellanox] Add ONIE and SSD platform components. (#4764)
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
2020-06-15 13:04:44 +03:00
Junchao-Mellanox
0a70571011
[201911][thermal control] Backport feature from master branch (#4677)
Backport thermal control feature from master branch to 201911 branch by cherry-picking commits and manually resolving conflicts.
2020-06-08 11:20:43 -07:00
Nazarii Hnydyn
c266435d40
Revert "Add thermal control support for SONiC (#3949)" (#4527)
This reverts commit 109a13cc03.

Conflicts:
	dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2
2020-05-04 21:20:47 +03:00
Junchao-Mellanox
109a13cc03 Add thermal control support for SONiC (#3949) 2020-04-30 22:39:17 -07:00
shlomibitton
7709ff5228 [Mellanox] Add a new Mellanox platform x86_64-mlnx_msn4600c and new SKU ACS-MSN4600C (#4483)
* New SKU support for MSN4600C

Signed-off-by: Shlomi Bitton <shlomibi@mellanox.com>
2020-04-30 22:15:52 -07:00
shlomibitton
aa33a959dd [Mellanox] Add a new Mellanox platform x86_64-mlnx_msn3420 and new SKU ACS-MSN3420 (#4436)
* 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
2020-04-27 08:50:23 -07:00
Kebo Liu
e4bd7ab189 [Mellanox] Extend mellanox platform API to report SFP error event (#4365)
* extend mellanox platform API to report SFP error event
* remove unnecessary loop code
* install enum34 to pmon to support using Enum
2020-04-15 13:11:59 -07:00
Nazarii Hnydyn
da92d8f5c3 [mellanox]: Align platform API: change CPLD version representation (#4221) 2020-03-24 15:12:37 -07:00
Kebo Liu
ca8ac9d437 [Mellanox] Add a new Mellanox platform x86_64-mlnx_msn4700 and new SKU ACS-MSN4700 (#3901)
* add MSN4700 device files

* update ACS-MSN4700 sai profile

* update buffer pool size, headroom, sensor conf, port config and reboot scripts

* fix ident

* update sensor conf and buffer pool

* [sn4700] add sku 4700 to chassis.py

* [Mellanox-4700] Add 4700 info to psu and thermal platform API

* update buffer config file template to the latest.
update SAI profile to use 100G X 4lanes for now
update port_config.ini according to the SAI profile

* [Mellanox]Update the buffer configurations for 4700

* fix alignment in pg_profile_lookup.ini

* add platform components file for new sku

* Update device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/pg_profile_lookup.ini

Co-Authored-By: Nazarii Hnydyn <nazariig@mellanox.com>

* remove redundant line

* [Mellanox]Correct type, buffer size

Co-authored-by: Nazarii Hnydyn <nazariig@mellanox.com>
Co-authored-by: junchao <junchao@mellanox.com>
Co-authored-by: Stephen Sun <stephens@mellanox.com>
2020-03-24 15:11:34 -07:00
Stephen Sun
48f8a8d40e [Mellanox] platform api support firmware install (#3931)
support firmware install, including CPLD and BIOS.

CPLD: cpldupdate
BIOS: boot to onie and update BIOS in onie and then boot to SONiC
2020-02-24 10:14:52 -08:00
Nazarii Hnydyn
a4ca818ca9 [mellanox]: Add new Mellanox-SN3800-D112C8 sku. (#4085)
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
2020-02-03 15:39:14 -08:00
Stephen Sun
249e858926 [Mellanox] Support SN3800 in platform api (#3593)
* [sonic_platform]Support 3800
1. add port position tuple for 3800

* [sonic_platform/chassis] address comments
2019-10-16 18:31:27 +03:00
Stephen Sun
2e3fb905a3 [Mellanox]Correct reboot cause when reboot via power cycle (#3597)
* [sonic_platform]remove the handling of reset_sw_reset which indicates rebooted by software.

* [sonic_platform]Check "reset_sw_reset"
Also check reboot cause file "reset_sw_reset" which indicates the system was rebooted due to software requesting.
2019-10-15 11:46:09 -07:00
Stephen Sun
aea09ba1da [sonic_platform] Correct the wrong log identifiers (#3596) 2019-10-15 11:29:45 -07:00
Stephen Sun
576f0982d2 [Mellanox]Resolve chassis broken due to inconsistent with latest sonic_platform_common (#3569)
*Currently get_firmware_version implementated by using chassis.get_firmware_version and chassis._component_name_list which are not supported in the latest sonic_platform_common, causing chassis broken. Update this part so that it aligns to the latest sonic_platform_common
*Support component API
2019-10-09 11:07:30 -07:00
Stephen Sun
350d2c5d2b [chassis.py] Fix issue in get_change_event: the returned dictionary doesn't contain 'sfp' key. (#3568) 2019-10-08 09:26:35 -07:00
Stephen Sun
5c2d71138b [Mellanox] optimize new platform api (#3289)
optimize SFP module operations and fix issues.

- split initialization of variant categories of devices and initialize each category of devices only when needed, so that unnecessary dependencies can be avoided.
- update watchdog logic, only initializing watchdog when referenced.
- support platform.py and enable to initialize variant devices on a host/docker basis
- update init so that sonic_platform can be imported as a whole.
2019-08-28 11:59:37 -07:00
Stephen Sun
a5de31bf43 [Mellanox]new platform api -- support get_change_event (#3142)
* [Mellanox]refractor the sfp event change notification logic for new platform api
remove the standalong daemon which is in charge of polling sfp change event through sdk interface
and move the polling stuff to the event in the chassis daemon.

* rephase some comment

* fix typo in sfp_event.sfp_event.initialize
2019-07-28 15:18:39 +03:00
Stephen Sun
1d15022df7 [Mellanox] support new platform api, thermal and psu part (#3175)
* support new platform api, thermal and psu part
for psu, all APIs are supported.
for thermal, we support
  get_temperature,
  get_high_threshold
for the thermal sensors of cpu core, cpu pack, psu and sfp module
and get_temperature for the ambient thermal sensors around the asic, port, fan, comex and board.

* 1. address review comments
2. improve the handling of PSU inserting/removal
3. tolerance diverse psu thermal sensor file name conventions

* 1. adjust thermal code according to the latest version of hw-management
2. check power_good_status rather than whether file existing ahead of reading voltage, current and power of PSU
2019-07-22 07:59:48 -07:00
Stephen Sun
82fb3a099d [Mellanox]New platform api -- chassis part (#3082)
* new platform api, chassis part

* Inject mlnx mlx libs to platform monitor

* address the review comments

* remove some confusing naming.

* Adjust the minor cause to a more human-readable way when rebooted by firmware

* address review comments

* expose host dir /host/reboot-cause to pmon docker so that the reboot causing by user command can be identified

* 1. Revert "expose host dir /host/reboot-cause to pmon docker so that the reboot causing by user command can be identified"
Since the only hardware-causing reboot should be handled by get_reboot_cause and the logic of handling reboot cause is about to move to the host side, no need to mount this dir to pmon docker.
This reverts commit 3feb96869d.
2. adjust log output by using sonic_daemon_base.daemon_base.Logger.
3. remove the logic of verifying /host/reboot-cause/ files.
4. fix typo.

* implement get_firmware_version and adjust the interfaces regarding components' version retrieving according to the Azure/sonic-platform-common#34
2019-07-04 14:29:58 +03:00
txj36
22c0f4d877 [devices]: fix SFP initialization in the Chassis for mlnx-platform-api (#3012) 2019-07-02 11:39:24 -07:00
Kebo Liu
89ee636b99 [Mellanox] SFP new platform API implementation (#2944)
* add sfp new api

* fix get presence
2019-05-29 09:46:20 +03:00
Kebo Liu
818ba436a9 [Mellanox] Implement new fan platform API (#2747) 2019-04-21 14:34:28 -07:00