Commit Graph

5998 Commits

Author SHA1 Message Date
Yakiv Huryk
d9117d9411
[Mellanox][asan] add address sanitizer support for syncd (#10266)
Why I did it
To support address sanitizer for Mellanox syncd

How I did it
/var/log/asan is mapped for syncd container (the same as for swss)
container stop() has a timeout (60s) for syncd (the same as for swss)
This is so libasan has enough time to generate a report.
added ASAN's log path to Mellanox syncd supervisord.conf
added "asan: yes" to sonic_version.yml
How to verify it
Added artificial memory leaks
Compiled with ENABLE_ASAN=y
Installed the image on DUT
Rebooted the DUT
Verified that /var/log/asan/syncd-asan.log contains the leaks

Signed-off-by: Yakiv Huryk <yhuryk@nvidia.com>
2022-04-14 15:00:32 -07:00
Junchao-Mellanox
0191300b96
[Mellanox] Auto correct PSU voltage threshold (WA) (#10394)
- Why I did it
There is a hardware bug that PSU voltage threshold sysfs returns incorrect value. The workaround is to call "sensor -s" to refresh it.

- How I did it
Call "sensor -s" when the threshold value is not incorrect and PSU is "DELTA 1100"

- How to verify it
Unit test and Manual test
2022-04-14 08:14:40 +03:00
Longxiang Lyu
812f17d6f1
Add libgmock package for linkmgrd (#10294)
Why I did it
Add libgmock-dev to the package list required by linkmgrd unittests.
Required by PR: Azure/sonic-linkmgrd#45

How I did it
Add the package to the package list.

How to verify it
Build docker-mux with KEEP_SLAVE_ON=yes and verify libgmock-dev is present.

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
2022-04-14 08:59:54 +08:00
Oleksandr Kozodoi
8c10c01bd8
Updated format of generating BUFFER_QUEUE in buffers_defaults templates (#9850)
This PR includes necessary changes for correct generating BUFFER_QUEUE values in DB. Changes are based on the schema.md

Why I did it
Change format of generating BUFFER_QUEUE in DB according to schema.md and yang-model.

Old format:
    "BUFFER_QUEUE": {
        "Ethernet0,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet12,Ethernet120,Ethernet124,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet4,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet8,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96|queue": {
            "profile": "profile"
        },
        "Ethernet0,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet12,Ethernet120,Ethernet124,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet4,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet8,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96|queue": {
            "profile": "profile"
        }
    },
New format:
    "BUFFER_QUEUE": {
        "Ethernet0|queue": {
            "profile": "profile"
        },
        "Ethernet0|queue": {
            "profile": "profile"
        },
        "Ethernet4|queue": {
            "profile": "profile"
        },
        "Ethernet4|queue": {
            "profile": "profile"
        },
        "Ethernet8|queue": {
            "profile": "profile"
        },
        "Ethernet8|queue": {
            "profile": "profile"
        },
        ...
    }
How I did it
Updated structure of buffers_defaults jinja templates.

Signed-off-by: Oleksandr Kozodoi <oleksandrx.kozodoi@intel.com>
2022-04-13 09:11:01 -07:00
Kebo Liu
fb25f13ee8
[submodule] Advance sonic-platform-common pointer (#10538)
b70e759 support new reboot-cause #277

Signed-off-by: Kebo Liu <kebol@nvidia.com>
2022-04-13 07:18:29 +03:00
xumia
e6aa3b8751
[Build]: Fix pip version constraint conflict issue (#10525)
Why I did it
[Build]: Fix pip version constraint conflict issue
When a version is specified in the constraint file, if upgrading the version in build script, it will have conflict issue.

How I did it
If a specified version has specified in pip command line, then the version constraint will be skipped.
2022-04-13 11:40:06 +08:00
Zhaohui Sun
44cf773a96
Revert "[docker-ptf]: Upgrade scapy to 2.4.5 in docker-ptf (#10507)" (#10537)
It upgraded scapy to 2.4.5 in docker-ptf container, after this upgrade, all scripts under ansible/roles/test/files/ptftests will import scapy 2.4.5, some test cases will fail because they are not upgraded accordingly.

Reverts #10507 to avoid breaking regression test.

This reverts commit 92efc01270.
2022-04-13 08:57:10 +08:00
Saikrishna Arcot
12ebe3ffa0
Run tune2fs during initramfs instead of image install (#10536)
If it is run during image install, it's not guaranteed that the
installation environment will have tune2fs available. Therefore, run it
during initramfs instead.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
2022-04-12 16:24:13 -07:00
byu343
da43edcf3e
[arista] Update serdes tuning values for 7800r3_48cqm2 (#9967)
This update the serdes tuning values for Arista 7800r3_48cqm2. The values are for the optical transceivers.
2022-04-12 15:53:35 -07:00
Nikola Dancejic
f2acf952fb
[device config] Adding configuration for default route fallback (#10465)
* [device config] Adding configuration for default route fallback
* Set sai_tunnel_underlay_route_mode attribute to fallback to default route if more specific route is unavailable.
2022-04-12 14:43:03 -07:00
kellyyeh
396a92cb2e
[dhcp_relay] Remove dhcp6mon (#10467) 2022-04-12 10:44:17 -07:00
xumia
5242a4bc7a
Upgrade pip3 package docker to 5.0.3 (#10523)
Why I did it
In sonic-utilities repo, it is required to install docker>=4.4.4
f70dc27827/setup.py (L187)
2022-04-12 10:52:44 +08:00
jingwenxie
cd330f0e70
[sonic-cfggen] make minigraph parser fail when speed and lanes are not in PORT table (#10228)
Why I did it
Config db schema generated by minigraph can’t pass yang validation, PORT table does not have 'lanes' and 'speed' field.

How I did it
Make cfggen command fail when 'lanes' and 'speed' are not provided

How to verify it
Run 'sonic-cfggen -m xxx.xml --print-data' to make sure command fail when 'lanes' and 'speed' not in PORT table
2022-04-11 09:56:58 +08:00
Junchao-Mellanox
011c21d8f5
[submodule] Advance sonic-swss-common pointer (#10505)
a7118f2 Add a ctor for IpPrefix to accept ip structure and mask (#593)
34f3f61 Add MACSEC_SA_PLUGIN_FIELD (#597)
2022-04-10 07:55:40 +03:00
Ashwin Srinivasan
b4f8f1dd22
Removed python2 dependency for sonic-pcied in sonic-platform-daemons (#10421)
Removed python2 support for sonic-platform-daemons that was causing unit
test errors in sonic_pcied.
* Removed config from docker supervisord jinja templates per VD review comment
* Removed space and python3 per QL comments
2022-04-09 13:16:50 -07:00
brandonchuang
2116f62978
[AS9716-32D] Support i2c mux reset (#10492)
Why I did it
    Prevent from i2c bus to get locked.

How I did it
    Add sysfs driver to access ioport.
    Command to reset i2c mux:
    echo 1 > /sys/devices/platform/as9716_32d_ioport/i2c_mux_rst
    Command to bring i2c mux out of reset:
    echo 0 > /sys/devices/platform/as9716_32d_ioport/i2c_mux_rst

Signed-off-by: Brandon Chuang <brandon_chuang@edge-core.com>
2022-04-09 10:51:49 -07:00
roman_savchuk
81ac482e5a
[BFN] updated SDE packages for BFN platforms (#10512)
Updated SDE packages for bfn platform

- introduced X6 profile
- fixes for drop counters
- fixes for platform part
2022-04-09 10:47:55 -07:00
byu343
f7a6553933
[docker-syncd]: Add optional shm-size to syncd container (#10516)
Why I did it
In the bringup of tomahawk4/trident4, we realized that such chips need a larger size of /dev/shm in syncd container, so we added the option --shm-size to the docker create for syncd. The default value for shm-size is 64m; after this change, people can add SYNCD_SHM_SIZE=128m to platform_env.conf to change it to 128m.

How to verify it
We verified that after this change, 1) on existing platforms without platform_env.conf, the size of /dev/shm in syncd container (df -h | grep shm) is still the default 64M; 2) after we add SYNCD_SHM_SIZE=128m to platform_env.conf, /dev/shm in syncd becomes 128M.
2022-04-09 10:47:18 -07:00
Kamil Cudnik
7d9a346e10
[submodule] Update sonic-sairedis (#10515)
To add new acl priority attribute CL improvement
2022-04-09 10:46:25 -07:00
byu343
6581decf38
[saibcm-modules]: Add linux_ngknet for trident4/tomahawk4 chips (#10517)
Why I did it
For trident4/tomahawk4, linux_ngknet.ko and linux_ngknetcb.ko have to be installed. Also, the kernel modules to load on such chips are different from existing ones, so we add an option is_ltsw_chip to determine the kernel modules to load. The option is_ltsw_chip is controlled by adding 'is_ltsw_chip=1' to platform_env.conf or not.

How to verify it
We verified that existing platforms still work after this change; and for platforms with trident4/tomahawk4, we can load the different kernel modules as expected after adding 'is_ltsw_chip=1' to platform_env.conf
2022-04-09 10:46:09 -07:00
Ze Gan
92efc01270
[docker-ptf]: Upgrade scapy to 2.4.5 in docker-ptf (#10507)
Why I did it
Existing dataplane tests cannot be tested under MACsec environment due to the traffic under MACsec link is encrypted. So, I will override the dp_poll of ptf to MACsec dp_poll to decrypt the MACsec packets on injected ports (PR: Azure/sonic-mgmt#5490). MACsec decryption library depends on scapy 2.4.5.

How I did it
Upgrade scapy library to 2.4.5 by pip.

How to verify it
Check the scapy version in docker-ptf by

python -c "import scapy; print(scapy.__version__)"
2.4.5

Signed-off-by: Ze Gan <ganze718@gmail.com>
2022-04-08 22:26:40 -07:00
Marty Y. Lok
487a29a43b
Update Nokia sonic-platform submodule (#10437)
b67d479 Fixed the sfp refactor issue
827c5a6 Added nokia_cmd command nokia_common grpc support for power down/up SFM module
aeb7f56 Added the nokia cli commands for midplane
c57d083 Fix the get_my_module issue and the thermal_infos exception issue.
0536293 Change the output of "show chassis module status"
63212d7 Enhance the help display for nokia_cmd command
e8d2599 Fix the sonic_install_ndk_service script issue
d52bdcf Add command nokia_cmd show sfm-eeprom support

Signed-off-by: mlok <marty.lok@nokia.com>
2022-04-08 10:33:02 -07:00
kellyyeh
330d11a128
Add EPMS and MgmtTsToR (#10478) 2022-04-07 21:49:42 -07:00
xumia
f24a04fa3d
[Ci]: check if there is a sonic dirty version issue (#10445)
Why I did it
[Ci]: check if there is a sonic dirty version issue
If there is a dirty version issue in PR build, the build will be failed.
2022-04-08 10:49:21 +08:00
Shilong Liu
51e4e8068e
[ci] Fix a docker-sonic-slave pipeline format in variable reference. (#10494)
this issue affect official amd64 docker-sonic-slave build.
2022-04-08 10:46:59 +08:00
ganglv
39e1e92c08
[yang]: Add support for BmcMgmtToRRouter (#10488)
Why I did it
minigraph parser has introduced new type.

How I did it
Update yang models to support BmcMgmtToRRouter.

How to verify it
Run unit test for sonic-yang-models

Signed-off-by: Gang Lv ganglv@microsoft.com
2022-04-08 07:48:01 +08:00
Alexander Allen
47db2b2993
[hostcfgd] Move hostcfgd back to ConfigDBConnector for subscribing to updates (#10168)
#### Why I did it

As of https://github.com/Azure/sonic-swss-common/pull/587 the blackout issue in ConfigDBConnector has been resolved. 

In the past hostcfgd was refactored to use SubscriberStateTable instead of ConfigDBConnector for subscribing to CONFIG_DB updates due to a "blackout" period between hostcfgd pulling the table data down and running the initialization and actually calling `listen()` on ConfigDBConnector which starts the update handler. 

However SusbscriberStateTable creates many file descriptors against the redis DB which is inefficient compared to ConfigDBConnector which only opens a single file descriptor. 

With the new fix to ConfigDBConnector I refactored hostcfgd to take advantage of these updates.

#### How I did it

Replaced SubscriberStateTable with ConfigDBConnector

#### How to verify it

The functionality of hostcfgd can be verified by booting the switch and verifying that NTP is properly configured.

To check the blackout period you can add a delay in the hostcfgd `load()` function and also add a print statement before and after the load so you know when it occurs. Then restart hostcfgd and wait for the load to start, then during the load push a partial change to the FEATURE table and verify that the change is picked up and the feature is enabled after the load period finishes. 

#### Description for the changelog
[hostcfgd] Move hostcfgd back to ConfigDBConnector for subscribing to updates
2022-04-07 14:56:52 -07:00
saksarav-nokia
f311947cfa
[Nokia][device] Updated the BCM config file to reduce the CPU usage (#10485)
Signed-off-by: Sakthivadivu Saravanaraj <sakthivadivu.saravanaraj@nokia.com>
2022-04-07 14:34:32 -07:00
dflynn-Nokia
e348dff77a
[Nokia ixs7215] Platform API temperature threshold value fixes (#10372)
Incorrect high-threshold and critical-high-threshold values are displayed for
some of the temperature sensors. This commit fixes that.
2022-04-07 22:44:31 +08:00
Rajkumar-Marvell
faabf00f82
[Marvell] Update armhf sai deb (#10403)
1) DHCP trap for IPV4 and IPV6
2) Interface ACL's (Ingress Everflow support)
3) 1G Autoneg support

Signed-off-by: Rajkumar Pennadam Ramamoorthy <rpennadamram@marvell.com>
2022-04-07 22:32:31 +08:00
Kebo Liu
07fad261dc
[submodule] Advance sonic-platform-common pointer (#10469)
Update sonic-platform-common submodule to pickup new commits:
01512ec [SSD]Enhance ssd_generic with more error handling to avoid python crash Azure/sonic-platform-common#271
ac3e7f1 [y_cable][Broadcom] update the BRCM y_cable driver to release 2.0 Azure/sonic-platform-common#263
573717a [Credo][Ycable] Fix Credo firmware download API download_firmware flag Azure/sonic-platform-common#269
a844f18 [xcvr] Add get_module_fw_info method to XcvrApi class. Azure/sonic-platform-common#267
35bad16 [sfputil]Refactoring read_porttab_mappings Azure/sonic-platform-common#264
83c4345 [SSD Generic] Add support for parsing nvme ssd model, health and temperature Azure/sonic-platform-common#265
5da31e1 [ycable][credo] Fix the is_link_active API for Credo Ycable Azure/sonic-platform-common#260
931c6ea [Y-Cable][Credo] add theading locker to support thread-safe calling, add SKU check for download_firmware API. Azure/sonic-platform-common#222
ff3aa75 Fix SFF8472 Enhanced Options Azure/sonic-platform-common#259
a8a83e9 [ssd] Allow individual vendor parsers to handle errors Azure/sonic-platform-common#252

Signed-off-by: Kebo Liu <kebol@nvidia.com>
2022-04-07 15:39:46 +03:00
xumia
baa24b3cb1
[Ci]: exclude innovium build and increase broadcom build timeout (#10482)
Why I did it
Exclude the innovium build in upgrading version build, currently, the builds are always failed, exclude the build temporarily.
Increase the broadcom build timeout.
2022-04-07 20:04:43 +08:00
Stepan Blyshchak
4426f7715f
[scapy] update scapy to 2.4.5 and patch it (#10457)
Why I did it
Running warm-reboot in a loop for 500 times leads to this error on 318-th iteration:

Apr  2 15:56:27.346747 sonic INFO swss#/supervisord: restore_neighbors Traceback (most recent call last):
Apr  2 15:56:27.346747 sonic INFO swss#/supervisord: restore_neighbors   File "/usr/bin/restore_neighbors.py", line 24, in <module>
Apr  2 15:56:27.346747 sonic INFO swss#/supervisord: restore_neighbors     from scapy.all import conf, in6_getnsma, inet_pton, inet_ntop, in6_getnsmac, get_if_hwaddr, Ether, ARP, IPv6, ICMPv6ND_NS, ICMPv6NDOptSrcLLAddr
Apr  2 15:56:27.346795 sonic INFO swss#/supervisord: restore_neighbors   File "/usr/local/lib/python3.7/dist-packages/scapy/all.py", line 25, in <module>
Apr  2 15:56:27.346956 sonic INFO swss#/supervisord: restore_neighbors     from scapy.route import *
Apr  2 15:56:27.346995 sonic INFO swss#/supervisord: restore_neighbors   File "/usr/local/lib/python3.7/dist-packages/scapy/route.py", line 205, in <module>
Apr  2 15:56:27.347089 sonic INFO swss#/supervisord: restore_neighbors     conf.iface = get_working_if()
Apr  2 15:56:27.347129 sonic INFO swss#/supervisord: restore_neighbors   File "/usr/local/lib/python3.7/dist-packages/scapy/arch/linux.py", line 128, in get_working_if
Apr  2 15:56:27.347213 sonic INFO swss#/supervisord: restore_neighbors     ifflags = struct.unpack("16xH14x", get_if(i, SIOCGIFFLAGS))[0]
Apr  2 15:56:27.347250 sonic INFO swss#/supervisord: restore_neighbors   File "/usr/local/lib/python3.7/dist-packages/scapy/arch/common.py", line 31, in get_if
Apr  2 15:56:27.347345 sonic INFO swss#/supervisord: restore_neighbors     return ioctl(sck, cmd, struct.pack("16s16x", iff.encode("utf8")))
Apr  2 15:56:27.347365 sonic INFO swss#/supervisord: restore_neighbors OSError: [Errno 19] No such device
The issue was reported to scapy devs secdev/scapy#3369, the fix is secdev/scapy#3371, however there is no released scapy version with this fix right now, thus decided to build scapy v2.4.5 from sources and apply the fix in a form of a patch.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
2022-04-07 14:23:35 +03:00
Nazarii Hnydyn
16717d2dc5
[submodule] Advance sonic-swss submodule. (#10404)
In order to include the following commit:
0f06910 [PBH] Implement Edit Flows (Azure/sonic-swss#2169)

sonic-swss

50d5be2 Make changes to support compiling on Bullseye with GCC 10 (#2216)
0870cf5 [mirrororch]: Implement HW resources availability validation for SPAN/ERSPAN (#2187)
f4ec565 [vlanmgrd] fix use-after-free memory issue (#2211)
c2de7fc [QosOrch] The notifications cannot be drained in QosOrch in case the first one needs to retry (#2206)
5575935 [neighsyncd] increase neighsyncd timeout (#2209)
0f06910 [PBH] Implement Edit Flows (#2169)
6241bbf Remove redundant and problematic code to skip "pool" field in buffer profile handling (#2197)
a55343c [azp]: Set diff coverage threshhold to 80% (#2188)
390cae1 [portsorch]: Prevent LAG member configuration when port has active ACL binding (#2165)
c1d47e6 [VNET]Fixing nexthop group delete during route change (#2198)
8941cc0 [BFD]Registering BFD state change callback during session creation (#2202)
680c539 [vxlan] Remove tunnel map objects on VNET tunnel removal (#2150)
20dde0c Fix for handling broadcom DNX ASIC to have ipv4 and ipv6 ACL rules in separate tables. (#2178)
5b7c949 [FdbOrch] SAI_FDB_EVENT_MOVE generates update with empty update.entry.port_name (#2200)
7350d49 [Vxlanmgr] vnet netdev cleanup during config reload fix (#2191)
2bef62b Validate LAG has members before mirror session create (#2130)
1e4d4ce [VS test] Increase VS test time, skip dpb flaky test (#2195)
6eda965 [vstest]Migrating vs tests from using click commands to direct DB access (#2179)

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
2022-04-07 10:41:42 +03:00
ganglv
3046c798a1
[sonic-cfggen]: Add port speed for UT (#10483)
Why I did it
Need to run yang validation for sonic-cfggen unit test, and many unit test does not provide speed for port table.

How I did it
Update minigraph xml.

How to verify it
Run sonic-cfggen unit test.

Signed-off-by: Gang Lv ganglv@microsoft.com
2022-04-07 13:50:07 +08:00
Shilong Liu
0330253fd7
[ci] Fix issues in docker-slave official build. (#10477)
only push latest tag on master build
2022-04-07 13:02:35 +08:00
jingwenxie
d83ae1e3dc
[yang] Fix yang validation failure when table contains empty value (#10431)
Why I did it
Fix #9746

How I did it
Split the check condition based on non-exist and zero length.

How to verify it
Run verification script when table contains empty value
2022-04-07 08:46:41 +08:00
kellyyeh
8cd346d80b
Update docker-router-advertiser.supervisord.conf.j2 (#10375) 2022-04-06 09:44:21 -07:00
Vivek R
614d14e8a0
[submodule] update sonic-snmpagent pointer (#10461)
890f32f  LLDPLocalSystemDataUpdater Exception Log Handled (#249)
2151731 Handle error seen on system where vlan interface map is not present (#246)
c6141c7 [build] use Azure.sonic-buildimage.official.vs pipeline as artifact source (#248)

Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
2022-04-06 17:05:05 +03:00
Vivek R
ed14eb5263
[interfaces-config] "main exception: cannot find interfaces: eth0" error log avoided (#10463)
- Why I did it
Fixes #9628
During bootup, this error log is seen

Dec 22 04:26:29 sonic interfaces-config.sh[2546]: error: main exception: cannot find interfaces: eth0 (interface was probably never up ?)
This is of non-functional nature and doesn't affect the flow.

- How I did it
Dont take the ifdown if not needed

- How to verify it
Verified during reboot. Log did not appear and IP was acquired on eth0 as expected

Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
2022-04-06 16:59:47 +03:00
ganglv
b152f2a0fc
[sonic-cfggen]: Update unit test to remove asn 0 (#10454)
Why I did it
ASN range is from 1 to 4294967295, need to remove invalid ASN.

How I did it
Update unit test and replace ASN 0.

How to verify it
Run unit test for sonic-config-engine.

Signed-off-by: Gang Lv ganglv@microsoft.com
2022-04-06 14:33:26 +08:00
xumia
ce26c04a09
[Build]: fix debian package not found issue (#10447)
Why I did it
[Build]: fix debian package not found issue
2022-04-06 13:51:41 +08:00
xumia
3391969d2e
[Ci]: Fix the docker slave azp template issue (#10453)
Why I did it
[Ci]: Fix the docker slave azp template issue
2022-04-06 11:34:02 +08:00
Taras Keryk
bfe5835650
[BFN] Fix exception when fwutil run without sudo (#10335)
* [BFN] Fix for run fwutil without sudo
            SONiC has a concept of "platform components"
            this may include - CPLD, FPGA, BIOS, BMC, etc.

            These changes are needed to read the version of the BIOS and BMC component.

            What I did
                    The previous implementaion of component.py expect fwutil run with sudo.
	       When fwutil run without sudo, there are an exception:
```
Traceback (most recent call last):
  File "/usr/local/bin/fwutil", line 5, in <module>
    from fwutil.main import cli
  File "/usr/local/lib/python3.9/dist-packages/fwutil/__init__.py", line 3, in <module>
    from . import main
  File "/usr/local/lib/python3.9/dist-packages/fwutil/main.py", line 40, in <module>
    pdp = PlatformDataProvider()
  File "/usr/local/lib/python3.9/dist-packages/fwutil/lib.py", line 159, in __init__
    self.__platform = Platform()
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/platform.py", line 21, in __init__
    self._chassis = Chassis()
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 48, in __init__
    self.__initialize_components()
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 136, in __initialize_components
    component = Components(index)
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/component.py", line 184, in __init__
    self.version = get_bios_version()
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/component.py", line 19, in get_bios_version
    return subprocess.check_output(['dmidecode', '-s', 'bios-version']).strip().decode()
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dmidecode'

```
           How I did it
                    Modification of dmidecode command

           How to verify it
                    Run manually 'fwutil' (without sudo)

	   Previous command output had exception

	   New command output:
		Root privileges are required

Signed-off-by: Taras Keryk <tarasx.keryk@intel.com>

* Why I did it
The previous implementaion of component.py expect fwutil run with sudo.
When fwutil run without sudo, there are an exception:

Traceback (most recent call last):
  File "/usr/local/bin/fwutil", line 5, in <module>
    from fwutil.main import cli
  File "/usr/local/lib/python3.9/dist-packages/fwutil/__init__.py", line 3, in <module>
    from . import main
  File "/usr/local/lib/python3.9/dist-packages/fwutil/main.py", line 40, in <module>
    pdp = PlatformDataProvider()
  File "/usr/local/lib/python3.9/dist-packages/fwutil/lib.py", line 159, in __init__
    self.__platform = Platform()
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/platform.py", line 21, in __init__
    self._chassis = Chassis()
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 48, in __init__
    self.__initialize_components()
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 136, in __initialize_components
    component = Components(index)
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/component.py", line 184, in __init__
    self.version = get_bios_version()
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/component.py", line 19, in get_bios_version
    return subprocess.check_output(['dmidecode', '-s', 'bios-version']).strip().decode()
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dmidecode'

How I did it
Modification of dmidecode command

How to verify it
Run manually 'fwutil' (without sudo)
Previous command output had exception

New command output:
Root privileges are required

Signed-off-by: Taras Keryk tarasx.keryk@intel.com

Signed-off-by: Taras Keryk <tarasx.keryk@intel.com>

* rewrite a call of dmidecode, when run without sudo

Signed-off-by: Taras Keryk <tarasx.keryk@intel.com>

* Why I did it
The previous implementaion of component.py expect fwutil run with sudo.
When fwutil run without sudo, there are an exception:

Traceback (most recent call last):
  File "/usr/local/bin/fwutil", line 5, in <module>
    from fwutil.main import cli
  File "/usr/local/lib/python3.9/dist-packages/fwutil/__init__.py", line 3, in <module>
    from . import main
  File "/usr/local/lib/python3.9/dist-packages/fwutil/main.py", line 40, in <module>
    pdp = PlatformDataProvider()
  File "/usr/local/lib/python3.9/dist-packages/fwutil/lib.py", line 159, in __init__
    self.__platform = Platform()
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/platform.py", line 21, in __init__
    self._chassis = Chassis()
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 48, in __init__
    self.__initialize_components()
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 136, in __initialize_components
    component = Components(index)
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/component.py", line 184, in __init__
    self.version = get_bios_version()
  File "/usr/local/lib/python3.9/dist-packages/sonic_platform/component.py", line 19, in get_bios_version
    return subprocess.check_output(['dmidecode', '-s', 'bios-version']).strip().decode()
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dmidecode'

The previous implementaion of eeprom.py expect fwutil run with sudo.
When fwutil run without sudo, there are an exception:

Traceback (most recent call last):
File "/usr/lib/python3.9/logging/config.py", line 564, in configure
handler = self.configure_handler(handlers[name])
File "/usr/lib/python3.9/logging/config.py", line 745, in configure_handler
result = factory(**kwargs)
File "/usr/lib/python3.9/logging/handlers.py", line 153, in init
BaseRotatingHandler.init(self, filename, mode, encoding=encoding,
File "/usr/lib/python3.9/logging/handlers.py", line 58, in init
logging.FileHandler.init(self, filename, mode=mode,
File "/usr/lib/python3.9/logging/init.py", line 1142, in init
StreamHandler.init(self, self._open())
File "/usr/lib/python3.9/logging/init.py", line 1171, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding,
PermissionError: [Errno 13] Permission denied: '/var/log/platform.log'
The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/bin/fwutil", line 5, in
from fwutil.main import cli
File "/usr/local/lib/python3.9/dist-packages/fwutil/init.py", line 3, in
from . import main
File "/usr/local/lib/python3.9/dist-packages/fwutil/main.py", line 41, in
pdp = PlatformDataProvider()
File "/usr/local/lib/python3.9/dist-packages/fwutil/lib.py", line 162, in init
self.chassis_component_map = self.__get_chassis_component_map()
File "/usr/local/lib/python3.9/dist-packages/fwutil/lib.py", line 168, in __get_chassis_component_map
chassis_name = self.__chassis.get_name()
File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 146, in get_name
return self._eeprom.modelstr()
File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 54, in _eeprom
self.__eeprom = Eeprom()
File "/usr/local/lib/python3.9/dist-packages/sonic_platform/eeprom.py", line 50, in init
logging.config.dictConfig(config_dict)
File "/usr/lib/python3.9/logging/config.py", line 809, in dictConfig
dictConfigClass(config).configure()
File "/usr/lib/python3.9/logging/config.py", line 571, in configure
raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'file'

How I did it
Modification call of dmidecode command.
Added modification of log files access attributes before file open operations.

How to verify it
Run manually 'fwutil' (without sudo)

New command output have no exception.

Signed-off-by: Taras Keryk <tarasx.keryk@intel.com>

* Added file_check for checking access to log files for eeprom.py

Signed-off-by: Taras Keryk <tarasx.keryk@intel.com>

* Removed unused import

* Added logfile_create to eeprom.py and chassis.py

Signed-off-by: Taras Keryk <tarasx.keryk@intel.com>

* Created platform_utils.py

Signed-off-by: Taras Keryk <tarasx.keryk@intel.com>

* Added interpreter  string to  platform_utils.py

Signed-off-by: Taras Keryk <tarasx.keryk@intel.com>
2022-04-05 11:33:51 -07:00
byu343
58df23e1d7
[arista] Update serdes tuning values for 7280cr3 (#9966) 2022-04-05 09:49:26 -07:00
Vadym Yashchenko
8e616c153b
[BFN] Refactoring and adding some functions of Thermal class (set and get thresholds and etc.) (#10205)
* Revised set_high_thershold and set_low_thershold methobs in the thermal.py

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised set_low_thershold and set_high_thershold

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Added separated files with thermal thresholds, changed platform.json and
thermal.py

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised on code revieww

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Reverted thermal.py

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised ther python.py

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised due to code review

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Added fucntion for fix the problem of tofino sensor high critical threshold

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised due to code review

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised due to code review

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised due to code review

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised only for cab18-4

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised default thresholds

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised ther def thresholds

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised on code review

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised platform.json and thermal_thresholds.json

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Code review in PR to azure (trigger CI)

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Added handle of exception

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Revised exception handler

* Added psu-1 thermal names to platfrom.json

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Changed platform.json and thermal_thresholds.json in
x86_64-acton_as9516_32d-r0

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>

* Removed indentation from json file

Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>
2022-04-05 09:13:08 -07:00
Andriy Kokhan
31be203af6
[BFN] Updated x86_64-accton_as9516_32d-r0/platform.json (#10368)
Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com>
2022-04-05 09:11:38 -07:00
bingwang-ms
b9dd1df372
Update qos config to clear queues for bounced back traffic (#10176)
* Update qos config to clear queues for bounced back traffic

Signed-off-by: bingwang <bingwang@microsoft.com>
2022-04-05 22:32:25 +08:00
Nazarii Hnydyn
64dc08a372
[submodule] Advance sonic-utilities submodule. (#10405)
In order to include the following commit:
c752457 [PBH] Implement Edit Flows (Azure/sonic-utilities#2093)

sonic-utilities
f70dc27 [techsupport] Handle minor fixes of TS Lock and update auto-TS (#2114)
51d3550 Fix issues in clear_qos (#2122)
6d3aa1e [GCU] Optimizing moves by adding generators for keys/tables (#2120)
65a5a6b Fixing get port speed when oper status is down (#2123)
c752457 [PBH] Implement Edit Flows (#2093)
827358f [debug dump] dump interface module added (#2070)

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
2022-04-04 16:07:48 +03:00
bingwang-ms
470d73585a
[YANG] Update YANG model for pfcwd_sw_enable (#10444)
* Update YANG for pfcwd_sw_enable

Signed-off-by: bingwang <wang.bing@microsoft.com>
2022-04-04 17:10:06 +08:00