Commit Graph

5811 Commits

Author SHA1 Message Date
xumia
280939b5c9 [Build] Support to use loosen version when failed to install python packages (#14013)
Why I did it
[Build] Support to use loosen version when failed to install python packages
It is to fix the issue #14012

How I did it
Try to use the installation command without constraint

How to verify it
2023-03-07 04:57:35 +00:00
mssonicbld
06be00525a
[ci/build]: Upgrade SONiC package versions (#14080) 2023-03-05 04:31:07 +08:00
Ikki Zhu
be46225033 [Seastone] fix dx010 qsfp eeprom data write issue (#13930)
Why I did it
Platform cases test_tx_disable, test_tx_disable_channel, test_power_override failed in dx010.

How I did it
Add i2c access algorithm for CPLD i2c adapters.

How to verify it
Verify it with platform_tests/api/test_sfp.py::TestSfpApi test cases.
2023-03-02 20:06:09 +00:00
Zain Budhwani
3776ddb7c8 Remove dialout as critical process (#14006)
#### Why I did it

Remove dialout as critical process as it is no longer used in prod. As part of future work, can remove dialout completely

#### How I did it

Remove from critical process list
2023-03-02 20:06:09 +00:00
jhli-cisco
b7ef7fce16
Update cisco-8000.ini (#14009)
#### Why I did it
Update cisco platform module to 202012-v0.2.6

#### How I did it
Update cisco-8000.ini
2023-03-01 16:05:11 -08:00
Saikrishna Arcot
26b0e7f709 Use tmpfs for /var/log on Arista 7050CX3-32S (#13805)
This is to reduce writes to the SSD on the device.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
2023-02-28 18:23:40 +00:00
Ikki Zhu
f47024cdfd add psu fans status led available config (#13926)
Why I did it
Seastone does not have the psu fans' status led, need to reflect it in platform.json.

How I did it
Set the psu fans status led available to false.

How to verify it
Verify it with platform_tests/api/test_psu_fans.py::TestPsuFans::test_set_fans_led case.
2023-02-28 08:18:28 +00:00
mssonicbld
cc17c7ac11
[ci/build]: Upgrade SONiC package versions (#13992) 2023-02-26 22:57:45 +08:00
Sudharsan Dhamal Gopalarathnam
ca17198f04
[202012][Mellanox] Change MFT version to 4.21.0-100 (#13956)
- Why I did it
Update MFT version to 4.21.0-100 to include a fix for an issue reported using mlxlink on qsfp-dd

- How I did it
Update mft.mk

- How to verify it
Run regression on Mellanox platforms
2023-02-26 09:42:52 +02:00
mssonicbld
7455c56024
[ci/build]: Upgrade SONiC package versions (#13985) 2023-02-25 14:57:37 +08:00
xumia
8636494c6d
[Build] Pin the toposort version to 1.7 in python2 (#13979)
Why I did it
Fix the docker-base-stretch build issue in nephos platform.

Collecting supervisord-dependent-startup==1.4.0
  Downloading d386c3d2cf/supervisord_dependent_startup-1.4.0-py2.py3-none-any.whl
Collecting toposort>=1.5 (from supervisord-dependent-startup==1.4.0)
  Downloading 44e51b4216/toposort-1.9.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    IOError: [Errno 2] No such file or directory: '/tmp/pip-build-LnROQE/toposort/setup.py'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-LnROQE/toposort/

The other platforms have been upgraded to docker-base-buster, not impacted.

How I did it
Pin the toposort version to 1.7, the package supervisord-dependent-startup has dependency on it.
The toposort>=1.8 only for python3, is not applicable to python2.
2023-02-25 07:33:23 +08:00
xumia
09ce5ec7b9
[Build] Clean up the debian preference config file (#13887) (#13976)
Why I did it
Support to upgrade packages, do better cleanup after the build.

How I did it
Remove the no use preference version control file after the build.

How to verify it
2023-02-24 13:08:29 -08:00
Junchao-Mellanox
0f47c5be59
[202012] [Mellanox] Fix issue: cannot lable port for logical port is logical port number larger than 64 (#13709)
- Why I did it
sfp_event.py gets a PMPE message when a cable event is available. In PMPE message, there is no label port available. Current sfp_event.py is using sx_api_port_device_get to get 64 logical ports attributes, and find the label port from those 64 attributes. However, if there are more than 64 ports, sfp_event.py might not be able to find the label port and drop the PMPE message.

- How I did it
Don't use hardcoded 64, get logical port number instead.

- How to verify it
Manual test
2023-02-23 08:27:21 +02:00
Stepan Blyshchak
73c7ced753
[202012][Mellanox] Place FW binaries under platform directory instead of squashfs (#13890)
Upgrade from old image always requires squashfs mount to get the next image FW binary. This can be avoided if we put FW binary under platform directory which is easily accessible after installation:

admin@r-spider-05:~$ ls /host/image-fw-new-loc.0-dirty-20230208.193534/platform/fw-SPC.mfa
/host/image-fw-new-loc.0-dirty-20230208.193534/platform/fw-SPC.mfa
admin@r-spider-05:~$ ls -al /tmp/image-fw-new-loc.0-dirty-20230208.193534-fs/etc/mlnx/fw-SPC.mfa
lrwxrwxrwx 1 root root 66 Feb  8 17:57 /tmp/image-fw-new-loc.0-dirty-20230208.193534-fs/etc/mlnx/fw-SPC.mfa -> /host/image-fw-new-loc.0-dirty-20230208.193534/platform/fw-SPC.mfa

- Why I did it
202211 and above uses different squashfs compression type that 201911 kernel can not handle. Therefore, we avoid mounting squashfs altogether with this change.

- How I did it
Place FW binary under /host/image-/platform/mlnx/, soft links in /etc/mlnx are created to avoid breaking existing scripts/automation.
/etc/mlnx/fw-SPCX.mfa is a soft link always pointing to the FW that should be used in current image
mlnx-fw-upgrade.sh is updated to prefer /host/image-/platform/mlnx location and fallback to /etc/mlnx in squashfs in case new location does not exist. This is necessary to do image downgrade.

- How to verify it
Upgrade from 201911 to 202012
202012 to 201911 downgrade
202012 -> 202012 reboot
ONIE -> 202012 boot (First FW burn)

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
2023-02-22 17:38:54 +02:00
Liu Shilong
0cc6f1ca82 [ci] Fix docker hang issue and change template reference branch (#13894)
Why I did it
Azure pipeline change.
Use common template to make it easy to change common steps.
Fix docker hang issue.

How I did it
2023-02-22 18:36:50 +08:00
mssonicbld
6230ced2b1
[ci/build]: Upgrade SONiC package versions (#13897) 2023-02-21 22:49:29 +08:00
Liu Shilong
d046712b25
[ci] Kill hanged docker build process to avoid build timeout issue. (#13726) (#13731)
Why I did it
Docker build has a low rate of hanging up.
It hangs on different steps. So, it looks like a bug in docker daemon.

How I did it
Start a daemon process to scan running time more than 1 hours, and kill the process.

How to verify it
2023-02-20 18:16:25 +08:00
Junchao-Mellanox
7543993af3
[202012] [Mellanox] Fix issue: SFP eeprom corrupted after replacing cable with different sfp type (#13543)
- Why I did it
There are 3 tasks in xcvrd:

main task, run a loop to recover missing SFP static information to DB every 1 minute
SFP state task, a process which listens cable plug in/out event, insert SFP static information to DB while a cable is inserted
SFP DOM update task, a thread which handles cable DOM information update every 1 minute
Let assume user replaces QSFP with QSFP-DD. There are two issues:

Only SFP state task listens cable plug in/out event, main task and SFP DOM update task does not know SFP type has changed, they still “think” the SFP type is QSFP. So, main task and SFP DOM update task uses QSFP standard to parse QSFP-DD EEPROM which causes corrupted data.
There is a race condition between main task and SFP state task. They both insert SFP static information to DB. Depends on timing, it is possible that main task using wrong SFP type to override SFP static information.
The PR is to fix these two issues.

There is no such issue on 202205 and above because there is a refactor for xcvrd:

SFP state task was changed from process to thread, so that all 3 tasks share the same memory space, they always have correct SFP type.
Recover missing SFP information logical was moved from main task to SFP state task. There is no race condition anymore.

- How I did it
It is difficult to back port latest xcvrd because there are many refactor/new features in xcvrd after 202012 release. It will be huge effort to do so. Based on that, we decided to fix the issue on Nvidia platform API side. The fix is that: refreshing SFP type before any SFP API which accessing SFP EEPROM. Refreshing SFP type before any SFP API would cause a small performance down: Due to my test on 202012 branch, accessing transceiver INFO and DOM INFO for 32 ports takes 1.7 seconds before the change. The number changes to 2.4 seconds after the change. I suppose the performance down is acceptable.

- How to verify it
Manual test
Regression
2023-02-19 09:47:32 +02:00
Lawrence Lee
5b889543ee
[202012][swss]: Submodule update (#13839)
Include following commit:

- 0d95f076 [202012]: Reduce log level when FDB cache lookup fails (#2667)
2023-02-17 10:46:33 -08:00
Hua Liu
2b39cd61fb
[202012] [sonic-swss-common] Update sonic-swss-common submodule (#13813)
#### Why I did it
Submodule update for sonic-swss-common with following change:
```
3e34309 2023-02-11 | RedisPipeline ignore flush when call dtor from another thread. (#736) [Hua Liu]
```
2023-02-17 10:41:25 -08:00
Samuel Angebault
e01e1860d4 [Arista] Disable ATA NCQ for a few products (#13739)
Why I did it
Some products might experience an occasional IO failure in the communication between CPU and SSD.
Based on some research it could be attributable to some device not handling ATA NCQ (Native Command Queue).

This issue currently affect 4 products:

DCS-7170-32C*
DCS-7170-64C
DCS-7060DX4-32
DCS-7260CX3-64

How I did it
This change disable NCQ on the affected drive for a small set of products.

How to verify it
When the fix is applied, these 2 patterns can be found in the dmesg.
ata1.00: FORCE: horkage modified (noncq)
NCQ (not used)

Test results using: fio --direct=1 --rw=randrw --bs=64k --ioengine=libaio --iodepth=64 --runtime=120 --numjobs=4

with NCQ (ata1.00: 61865984 sectors, multi 1: LBA48 NCQ (depth 32), AA)

   READ: bw=33.9MiB/s (35.6MB/s), 33.9MiB/s-33.9MiB/s (35.6MB/s-35.6MB/s), io=4073MiB (4270MB), run=120078-120078msec
  WRITE: bw=34.1MiB/s (35.8MB/s), 34.1MiB/s-34.1MiB/s (35.8MB/s-35.8MB/s), io=4100MiB (4300MB), run=120078-120078msec
without NCQ (ata1.00: 61865984 sectors, multi 1: LBA48 NCQ (not used))

   READ: bw=31.7MiB/s (33.3MB/s), 31.7MiB/s-31.7MiB/s (33.3MB/s-33.3MB/s), io=3808MiB (3993MB), run=120083-120083msec
  WRITE: bw=31.9MiB/s (33.4MB/s), 31.9MiB/s-31.9MiB/s (33.4MB/s-33.4MB/s), io=3830MiB (4016MB), run=120083-120083msec
Which release branch to backport (provide reason below if selected)
2023-02-16 17:54:16 +00:00
Ikki Zhu
2135c6eb2f [DX010 platform] fix dx010 platform testcase issues (#13595)
Why I did it
1. fix chassis test_set_fans_led case
2. fix chassis get_name case mismatch issue
3. fix fan_drawer test_set_fans_speed
4. fix component test_components test case

How I did it
Add corresponding configuration into chassis json file

How to verify it
Run platform tests cases to verify these failure cases
2023-02-16 17:52:12 +00:00
Qi Luo
9731aa36c2
[sonic-snmpagent] Update submodule (#13832)
#### Why I did it
Include below commits:
```
7147354 2023-02-14 | Fix: zero route may have empty nexthop (#276) [Qi Luo]
e60a64c 2022-11-30 | Use github code scanning instead of LGTM (#274) [Liu Shilong]
```
2023-02-16 09:04:36 -08:00
jhli-cisco
592ce16d05
Update cisco-8000.ini (#13793)
#### Why I did it
1.57.x SDK based incremental drop that addresses:
Fix for MIGSMSFT-158
Support for VxLAN and BFD Serviceability CLI
sfputil reset platform fix to handle 100G optics
Added thermal management feature for ZR optics sensors

#### How I did it
Update cisco-8000 submodule to v0.2.5
2023-02-14 11:05:09 -08:00
jcaiMR
936679ee47 Set 'origin' and 'AS Path' for T1 SLB routes (#13613)
* set origin and as-path prepend for routes from SLB
2023-02-10 18:38:16 +00:00
Lawrence Lee
4e70a2bfbc
[202012][swss]: Submodule update for SWSS (#13722)
Include following commits:
- c98b9f09 [202012][orchagent]: Get bridge port ID from FDBOrch cache instead of SAI API #2657 (#2658)
- 59886b8f [MuxOrch] Enabling neighbor when adding in active state (#2601)
2023-02-09 11:01:58 -08:00
jingwenxie
95893698e2
[202012][sonic-utilites] advance submodule (#13734)
```
39cdb49c7 [202012][show] Add bgpraw to show run all (#2639)
b3ebba2ca [202012][show] add new CLI to show tunnel route objects #2255 (#2659)
d08f59b9f Fixed a bug in "show vnet routes all" causing screen overrun. (#2644) (#2654)
a996abdb5 [202012][show] show logging CLI support for logs stored in tmpfs (#2652)
c60f771c0 [202012][show_bfd] add local discriminator in show bfd command (#2616)
```
2023-02-09 10:04:58 -08:00
xumia
8657fbac53
[Build]: fix some version info missing in version control files issue (#10211) (#13673)
#### Why I did it
Fix some version info missing in version control files issue

#### How I did it
Change to collect version before it cleaned up
2023-02-08 20:25:04 -08:00
xumia
f48734fe50
[Build]: Fix the bin image generated from raw image issue (#10083) (#13672)
#### Why I did it
Cherry pick from #10083
It is to fix the issue #10048
When building .raw image, for instance, target/sonic-broadcom.raw, it will generate a .bin image, target/sonic-broadcom.bin, as the intermediate file. The intermediate file is a build target which may contains different dependencies with the raw one.

#### How I did it
Rename the intermediate file.
2023-02-08 20:24:06 -08:00
andywongarista
ff5a703301
Fix content of platform.json for DCS-7050CX3-32S (#13659)
#### Why I did it
Some tests under platform_tests/api were failing on the 7050CX3 due to outdated facts in platform.json

#### How I did it
Updated platform.json facts with appropriate values

#### How to verify it
Run tests under platform_tests/api to verify no failures
2023-02-08 12:01:07 -08:00
Ikki Zhu
85ca3abc2f [Celestica DX010] fix fan drawer and watchdog platform testcase issues (#13426)
Why I did it
fix DX010 fan drawer and watchdog platform test case issues

How I did it
1. Add fan_drawer get_maximum_consumed_power support
2. Adjust maximum watchdog timeout value check

How to verify it
Run test_fan_drawer and test_watchdog test cases.
2023-02-08 04:59:20 +00:00
Longxiang Lyu
6b4a278378
[dualtor] Let T0 delay 10 seconds before sending BGP updates (#13701)
Cherry-pick PR #12996 into 202012 branch.

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
2023-02-07 17:49:20 -08:00
Jing Zhang
abbcda67d2
update submodule linkmgrd (#13589)
9551386 Jing Zhang      Mon Jan 23 15:49:52 2023 -0800  [202012] Update link prober stats post logic #159 (#162)
e54f289 Liu Shilong     Wed Nov 30 18:04:15 2022 +0800  Use github code scanning instead of LGTM (#157)
2023-02-07 16:18:28 -08:00
Saikrishna Arcot
d8a299781a
Use tmpfs for /var/log for Arista 7260 (#13587) (#13607)
This is to reduce writes to disk, which then can use the SSD to get worn
out faster.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
(cherry picked from commit ee1c32a802)
2023-02-06 17:09:55 -08:00
kellyyeh
9a26ed957c
Advance sonic-dhcp-relay (#13608)
Why I did it
Advance sonic-dhcp-relay submodule head on 202012 branch

How I did it
Added the following commits:
a4b15d8 jcaiMR Thu Dec 29 14:18:28 2022 +0800 fix relay-reply dhcpv6 packet counter issue (#29)
677543f jcaiMR Sat Dec 17 00:24:32 2022 +0800 fix handleSwssNotification crash in dhcp6relay (#28)
ed86546 jcaiMR Wed Dec 14 14:08:58 2022 +0800 Fix multiple vlan issue (#27)
5ec1f5b Vivek Thu Dec 8 09:44:15 2022 -0800 Made the Error log informative (#22)
063d41b jcaiMR Wed Nov 30 14:41:53 2022 +0800 disable cfg dynamic change (#25)
d4a51f6 kellyyeh Tue Jan 31 18:09:08 2023 -0800 Add unittest infrastructure (#5) (#31)

How to verify it
Ran full dhcpv6 test suite on lab device
2023-02-06 08:50:27 -08:00
Saikrishna Arcot
30fbc609c8 Use tmpfs for /var/log for Arista 7260 (#13587)
This is to reduce writes to disk, which then can use the SSD to get worn
out faster.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
2023-02-02 22:53:50 +00:00
Yoush
7adf2b1c05 [BugFix] Fix the bug that it gets error system-mac of centec platform (#12721)
Why I did it
When getting system mac of centec platform, it would increase by 1 the last byte of mac, but it could not consider the case of carry.

How I did it
Firstly, I would replace the ":" with "" of mac to a string.
And then, I would convert the mac from string to int and increase by 1, at last convert it to string with inserting ":".
2023-02-02 22:53:49 +00:00
Nazarii Hnydyn
83b6518ae2
[202012][mellanox]: Add BIOS upgrade infra (#13571)
- Why I did it
Added BIOS upgrade infra

- How I did it
Added new make target

- How to verify it
Copy msn3800_bios.tar.gz to platform/mellanox/bios
make configure PLATFORM=mellanox
make target/files/buster/msn3800_bios.tar.gz

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
2023-02-02 10:07:03 +02:00
kellyyeh
1354033f90
[dhcpmon] Fix dhcpmon socket filter and tx count issue (#13065) (#13441)
Why I did it
Fix issue caused by dualtor support PR [dhcpmon] Open different socket for dual tor to enable interface filtering #11201
Improve code
How I did it
On single ToR, packets received count was duplicated due to socket filter set to "inbound"
Tx count not increasing due to filter set to "inbound". Added an outbound socket to count tx packets
Added vlan member interface mapping for Ethernet interface to vlan interface lookup in reference to PR Fix multiple vlan issue sonic-dhcp-relay#27
Exit when socket fails to initialize to allow dhcp_relay docker to restart
How to verify it
Tested on vstestbed single tor and dual tor, sent packets and verify printed out dhcpmon rx and tx counters is correct

Correct number of tx increases
Tx does not increase when ToR is on standby
2023-01-30 09:51:06 -08:00
Prince Sunny
7448f7bc2d
[submodule] update for sonic-swss and sonic-restapi (#13531)
#### Why I did it

Update submodule for sonic-swss:

e739e6c - 2023-01-27 : custom advertised prefix for primary vxlan tunnel [202012]  (#2641) [siqbal1986]

sonic-restapi:
99c467d - 2023-01-24 : Add API support for adv prefix and custom monitoring (#133) [Prince Sunny]
347684a - 2022-11-30 : Use github code scanning instead of LGTM (#132) [Liu Shilong]
2023-01-27 16:27:55 -08:00
Ying Xie
467e01cbdb
[202012][swss] advance submodule head (#13519)
swss:
* f28d6622 2023-01-25 | [portinit] Do not call GET on SAI_PORT_ATTR_SPEED when AUTONEG is enabled (#2484) (#2639) (github/202012, 202012) [Ying Xie]
* 217f7f00 2023-01-21 | Cherry pick of https://github.com/sonic-net/sonic-swss/pull/2589 (#2627) [siqbal1986]

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
2023-01-26 02:49:50 +00:00
Lawrence Lee
6ff7c75597
[PATCH]: Update FRR patch 0009 to avoid inappropriate error messages (#12912) (#13423)
…(#12912)

Why I did it
As described in detail in #12753, the current FRR patch 0009-ignore-route-from-default-table.patch is causing unwanted FRR/zebra error logs. This change gets rid of the error messages for routes from kernel default table while these routes are ignored in prefix encoding.

How I did it
This fix updates the original 0009 patch by checking if the routes are from table default before printing the error logs. The original patch checks the same condition and ignores the routes from table default in prefix encoding.

How to verify it
Follow the steps to repro as described in #12753.
Also verify the test case ipfwd/test_nhop_count.py no longer fails due to the error messages.

#### Why I did it
Resolve cherry-pick conflict for https://github.com/sonic-net/sonic-buildimage/pull/12912
2023-01-25 15:24:11 -08:00
Richard.Yu
025e77bb5d
[202012] Update SAI version to 4.3.7.1-7 (#13431)
CS00012254651 (SONIC-66820) Fix missing break stmt

Verify

run case test_forward_ip_packet_with_0xffff_chksum_tolerant

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>
2023-01-19 11:30:40 -08:00
Ying Xie
027c831be7 [Arista] add support for hardware sku Arista-7260CX3-D92C16 (#13438)
Signed-off-by: Ying Xie <ying.xie@microsoft.com>

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
2023-01-19 19:19:30 +00:00
Ikki Zhu
607cbdefd3 [Celestica Seastone] fix multi sonic platform issues (#13356)
Why I did it
Fix the following issues for Seastone platform:

- system-health issue: show system-health detail will not complete #9530, Celestica Seastone DX010-C32: show system-health detail fails with 'Chassis' object has no attribute 'initizalize_system_led' #11322
- show platform firmware updates issue: Celestica Seastone DX010-C32: show platform firmware updates #11317
- other platform optimization

How I did it
Modify and optimize the platform implememtation.

How to verify it
Manual run the test commands described in these issues.
2023-01-19 19:18:21 +00:00
jhli-cisco
2357eeef46
[cisco]: Update cisco-8000.ini (#13425)
1.57.x SDK based incremental drop that addresses: 
1) orchagent crash
2) Port LED issue
3) Tunnel endpoint stats
4) test_warm_reboot issue
5) nhop test failure
6) "show platform versions' CLI
2023-01-19 09:13:51 -08:00
Junchao-Mellanox
46a774e294
[202012] [Mellanox] Fix select timeout in sfp event (#13347)
- Why I did it
Backport #9795
Python select.select accept a optional timeout value in seconds, however, the value passes to it is a value in millisecond.

- How I did it
Transfer the value to millisecond.

- How to verify it
Manual test
2023-01-19 17:29:41 +02:00
Prince Sunny
21ad9876a3
[Submodule] Update swss-common (#13406)
Swss-common submodule update:
c5ed58a - 2023-01-17 : 202012 cast of PR sonic-net/sonic-swss-common#725 (#738) [siqbal1986]
fe28725 - 2022-11-30 : Use github code scanning instead of LGTM (#718) [Liu Shilong]
2023-01-18 11:10:28 -08:00
Prince Sunny
b500e0ef5a
[Submodule] Update for sonic-swss (#13405)
#### Why I did it

Update for following swss commits:

96180bf - 2023-01-13 : [202012] Bfd default multiplier change  (#2615) [siqbal1986]
07506ac - 2023-01-11 : Add missing parameter to on_switch_shutdown_request method. (#2567) [Hua Liu]
3253cc8 - 2022-11-30 : Use github code scanning instead of LGTM (#2546) [Liu Shilong]
f4df524 - 2023-01-11 : [orchagent]:add local_discriminator to state_db (#2587) [Baorong Liu]
f3cd02d - 2022-12-05 : [202012][muxorch] Adding case for maintaining current state (#2500) [Nikola Dancejic]
2023-01-17 16:37:19 -08:00
Kebo Liu
a569bfc9eb
skip hw reboot cause if warm/fast reboot found from the proc cmdline (#13378)
#### Why I did it
Backport https://github.com/sonic-net/sonic-buildimage/pull/13246 to 202012 branch.

In case of warm/fast reboot, the hardware reboot cause will NOT be cleared because CPLD will not be touched in this flow. To not confuse the reboot cause determine logic, the leftover hardware reboot cause shall be skipped by the platform API, platform API will return the 'REBOOT_CAUSE_NON_HARDWARE' instead of the "hardware" reboot cause.

#### How I did it

Check the proc cmdline to see whether the last reboot is a warm or fast reboot, if yes skip checking the leftover hardware reboot cause.

#### How to verify it

a. Manual test:
> 1. Perform a power loss
> 2. Perform a warm/fast reboot
> 3. check the reboot cause should be "warm-reboot" or "fast-reboot" instead of "power loss"

b. Run reboot cause related regression test.
2023-01-17 13:21:31 -08:00