Fixes#6126.
There is a bug in getting the path of voltage, current and power. The
list object is directly converted to string to format the file path. As
a result, read_txt_file will get None value and a WARNING will be
recorded. This commit fix the issue.
Signed-off-by: bingwang <bingwang@microsoft.com>
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
Treat devices that are ToRRouters (ToRRouters and BackEndToRRouters) the same when rendering templates
Except for BackEndToRRouters belonging to a storage cluster, since these devices have extra sub-interfaces created
Treat devices that are LeafRouters (LeafRouters and BackEndLeafRouters) the same when rendering templates
Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
The `get_serial_number()` method in the ChassisBase and ModuleBase classes was redundant, as the `get_serial()` method is inherited from the DeviceBase class. This method was removed from the base classes in sonic-platform-common and the submodule was updated in https://github.com/Azure/sonic-buildimage/pull/5625.
This PR aligns the existing vendor platform API implementations to remove the `get_serial_number()` methods and ensure the `get_serial()` methods are implemented, if they weren't previously.
Note that this PR does not modify the Dell platform API implementations, as this will be handled as part of https://github.com/Azure/sonic-buildimage/pull/5609
However in SAI 3.7 default behaviout got changes to 128 Group and 128
Memeber each.
This change is to make sure we are using same ECMP Group/Memeber Per
Group for 3.7 also so that behaviour is consistent.
Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
This include the platform.json for Seastone platform and
individual hwsku.json for each HWSKU
port_config.ini will be removed once the CLI/parser library etc changes are merged
**- What I did**
On boarding DPB feature to Seastone HWSKUs
**- How I did it**
Add platform.json for Seastone and hwsku.json files to relevant HWSKUs.
**- How to verify it**
```
sudo sonic-cfggen -H -k Seastone-DX010 --preset=t1 > config_db.json
sudo config reload config_db.json -y
show interface status:
admin@lnos-x1-a-csw03:~$ show interfaces status
Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC
----------- --------------- ------- ----- ----- ------- ------ ------ ------- ------ ----------
Ethernet0 65,66,67,68 100G 9100 N/A Eth1/1 routed down up N/A N/A
Ethernet4 69,70,71,72 100G 9100 N/A Eth2/1 routed down up N/A N/A
Ethernet8 73,74,75,76 100G 9100 N/A Eth3/1 routed down up N/A N/A
Ethernet12 77,78,79,80 100G 9100 N/A Eth4/1 routed down up N/A N/A
Ethernet16 33,34,35,36 100G 9100 N/A Eth5/1 routed down up N/A N/A
Ethernet20 37,38,39,40 100G 9100 N/A Eth6/1 routed down up N/A N/A
Ethernet24 41,42,43,44 100G 9100 N/A Eth7/1 routed down up N/A N/A
Ethernet28 45,46,47,48 100G 9100 N/A Eth8/1 routed down up N/A N/A
Ethernet32 49,50,51,52 100G 9100 N/A Eth9/1 routed down up N/A N/A
Ethernet36 53,54,55,56 100G 9100 N/A Eth10/1 routed down up N/A N/A
Ethernet40 57,58,59,60 100G 9100 N/A Eth11/1 routed down up N/A N/A
Ethernet44 61,62,63,64 100G 9100 N/A Eth12/1 routed down up N/A N/A
Ethernet48 81,82,83,84 100G 9100 N/A Eth13/1 routed down up N/A N/A
Ethernet52 85,86,87,88 100G 9100 N/A Eth14/1 routed down up N/A N/A
Ethernet56 89,90,91,92 100G 9100 N/A Eth15/1 routed down up N/A N/A
Ethernet60 93,94,95,96 100G 9100 N/A Eth16/1 routed down up N/A N/A
Ethernet64 97,98,99,100 100G 9100 N/A Eth17/1 routed down up N/A N/A
Ethernet68 101,102,103,104 100G 9100 N/A Eth18/1 routed down up N/A N/A
Ethernet72 105,106,107,108 100G 9100 N/A Eth19/1 routed up up N/A N/A
Ethernet76 109,110,111,112 100G 9100 N/A Eth20/1 routed down up N/A N/A
Ethernet80 1,2,3,4 100G 9100 N/A Eth21/1 routed down up N/A N/A
Ethernet84 5,6,7,8 100G 9100 N/A Eth22/1 routed down up N/A N/A
Ethernet88 9,10,11,12 100G 9100 N/A Eth23/1 routed down up N/A N/A
Ethernet92 13,14,15,16 100G 9100 N/A Eth24/1 routed down up N/A N/A
Ethernet96 17,18,19,20 100G 9100 N/A Eth25/1 routed down up N/A N/A
Ethernet100 21,22,23,24 100G 9100 N/A Eth26/1 routed down up N/A N/A
Ethernet104 25,26,27,28 100G 9100 N/A Eth27/1 routed down up N/A N/A
Ethernet108 29,30,31,32 100G 9100 N/A Eth28/1 routed down up N/A N/A
Ethernet112 113,114,115,116 100G 9100 N/A Eth29/1 routed down up N/A N/A
Ethernet116 117,118,119,120 100G 9100 N/A Eth30/1 routed down up N/A N/A
Ethernet120 121,122,123,124 100G 9100 N/A Eth31/1 routed down up N/A N/A
Ethernet124 125,126,127,128 100G 9100 N/A Eth32/1 routed down up N/A N/A
```
**Breakout to 2x50G:**
```
admin@lnos-x1-a-csw03:~$ sudo config interface breakout Ethernet0 2x50G -y -f
Running Breakout Mode : 1x100G[40G]
Target Breakout Mode : 2x50G
Ports to be deleted :
{
"Ethernet0": "100000"
}
Ports to be added :
{
"Ethernet2": "50000",
"Ethernet0": "50000"
}
After running Logic to limit the impact
Final list of ports to be deleted :
{
"Ethernet0": "100000"
}
Final list of ports to be added :
{
"Ethernet2": "50000",
"Ethernet0": "50000"
}
Loaded below Yang Models
['sonic-acl', 'sonic-extension', 'sonic-interface', 'sonic-loopback-interface', 'sonic-port', 'sonic-portchannel', 'sonic-types', 'sonic-vlan']
Note: Below table(s) have no YANG models:
CONTAINER_FEATURE, BGP_NEIGHBOR, VERSIONS, DEVICE_METADATA, FEATURE, LOCK, BREAKOUT_CFG, CRM,
Below Config can not be verified, It may cause harm to the system
{
"BREAKOUT_CFG": {
"Ethernet0": {
"brkout_mode": "1x100G[40G]"
}
}
}
Do you wish to Continue? [y/N]: y
Breakout process got successfully completed.
Please note loaded setting will be lost after system reboot. To preserve setting, run `config save`.
admin@lnos-x1-a-csw03:~$
admin@lnos-x1-a-csw03:~$
admin@lnos-x1-a-csw03:~$ show interfaces status
Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC
----------- --------------- ------- ----- ----- ------- ------ ------ ------- ------ ----------
Ethernet0 65,66 50G N/A N/A Eth1/1 routed down up N/A N/A
Ethernet2 67,68 50G 9100 N/A Eth1/3 routed down up N/A N/A
admin@lnos-x1-a-csw03:~$ bcmcmd ps
ps
ena/ speed/ link auto STP lrn inter max cut loop
port link Lns duplex scan neg? state pause discrd ops face frame thru? back
xe0( 68) down 2 50G FD SW No Forward None FA KR2 9412 No
xe1( 69) !ena 1 - SW No Forward None FA None 9122 No
```
**Breakout to 4x25G[10G]:**
```
admin@lnos-x1-a-csw03:~$ sudo config interface breakout Ethernet0 4x25G[10G] -y -f
Running Breakout Mode : 2x50G
Target Breakout Mode : 4x25G[10G]
Ports to be deleted :
{
"Ethernet2": "50000",
"Ethernet0": "50000"
}
Ports to be added :
{
"Ethernet2": "25000",
"Ethernet3": "25000",
"Ethernet0": "25000",
"Ethernet1": "25000"
}
After running Logic to limit the impact
Final list of ports to be deleted :
{
"Ethernet2": "50000",
"Ethernet0": "50000"
}
Final list of ports to be added :
{
"Ethernet2": "25000",
"Ethernet3": "25000",
"Ethernet0": "25000",
"Ethernet1": "25000"
}
Loaded below Yang Models
['sonic-acl', 'sonic-extension', 'sonic-interface', 'sonic-loopback-interface', 'sonic-port', 'sonic-portchannel', 'sonic-types', 'sonic-vlan']
Note: Below table(s) have no YANG models:
CONTAINER_FEATURE, BGP_NEIGHBOR, VERSIONS, DEVICE_METADATA, FEATURE, LOCK, BREAKOUT_CFG, CRM,
Below Config can not be verified, It may cause harm to the system
{
"BREAKOUT_CFG": {
"Ethernet0": {
"brkout_mode": "2x50G"
}
}
}
Do you wish to Continue? [y/N]: y
Breakout process got successfully completed.
Please note loaded setting will be lost after system reboot. To preserve setting, run `config save`.
admin@lnos-x1-a-csw03:~$ show interfaces status
Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC
----------- --------------- ------- ----- ----- ------- ------ ------ ------- ------ ----------
Ethernet0 65 25G N/A N/A Eth1/1 routed down up N/A N/A
Ethernet1 66 25G 9100 N/A Eth1/2 routed down up N/A N/A
Ethernet2 67 25G N/A N/A Eth1/3 routed down up N/A N/A
Ethernet3 68 25G 9100 N/A Eth1/4 routed down up N/A N/A
admin@lnos-x1-a-csw03:~$ bcmcmd ps
ps
ena/ speed/ link auto STP lrn inter max cut loop
port link Lns duplex scan neg? state pause discrd ops face frame thru? back
xe0( 68) down 1 25G FD SW No Forward None FA KR 9412 No
xe1( 69) down 1 25G FD SW No Forward None FA KR 9122 No
xe2( 70) down 1 25G FD SW No Forward None FA KR 9412 No
xe3( 71) down 1 25G FD SW No Forward None FA KR 9122 No
```
**Breakin back to 1x100G[40G]:**
```
admin@lnos-x1-a-csw03:~$ sudo config interface breakout Ethernet0 1x10G[40G] -y -f
[ERROR] Target mode 1x10G[40G] is not available for the port Ethernet0
Aborted!
admin@lnos-x1-a-csw03:~$ sudo config interface breakout Ethernet0 1x100G[40G] -y -f
Running Breakout Mode : 4x25G[10G]
Target Breakout Mode : 1x100G[40G]
Ports to be deleted :
{
"Ethernet2": "25000",
"Ethernet3": "25000",
"Ethernet0": "25000",
"Ethernet1": "25000"
}
Ports to be added :
{
"Ethernet0": "100000"
}
After running Logic to limit the impact
Final list of ports to be deleted :
{
"Ethernet2": "25000",
"Ethernet3": "25000",
"Ethernet0": "25000",
"Ethernet1": "25000"
}
Final list of ports to be added :
{
"Ethernet0": "100000"
}
Loaded below Yang Models
['sonic-acl', 'sonic-extension', 'sonic-interface', 'sonic-loopback-interface', 'sonic-port', 'sonic-portchannel', 'sonic-types', 'sonic-vlan']
Note: Below table(s) have no YANG models:
CONTAINER_FEATURE, BGP_NEIGHBOR, VERSIONS, DEVICE_METADATA, FEATURE, LOCK, FLEX_COUNTER_TABLE, BREAKOUT_CFG, CRM,
Below Config can not be verified, It may cause harm to the system
{
"BREAKOUT_CFG": {
"Ethernet0": {
"brkout_mode": "4x25G[10G]"
}
}
}
Do you wish to Continue? [y/N]: y
Breakout process got successfully completed.
Please note loaded setting will be lost after system reboot. To preserve setting, run `config save`.
admin@lnos-x1-a-csw03:~$ show interfaces status
Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC
----------- --------------- ------- ----- ----- ------- ------ ------ ------- ------ ----------
Ethernet0 65,66,67,68 100G N/A N/A Eth1/1 routed down up N/A N/A
admin@lnos-x1-a-csw03:~$ bcmcmd ps
ps
ena/ speed/ link auto STP lrn inter max cut loop
port link Lns duplex scan neg? state pause discrd ops face frame thru? back
ce0( 68) down 4 100G FD SW No Forward None FA KR4 9412 No
xe0( 69) !ena 1 - SW No Forward None FA None 9122 No
xe1( 70) !ena 2 - SW No Forward None FA None 9412 No
xe2( 71) !ena 1 - SW No Forward None FA None 9122 No
```
Signed-off-by: Zhenggen Xu <zxu@linkedin.com>
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 in https://github.com/Azure/sonic-buildimage/pull/5003
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 the next step toward resolving https://github.com/Azure/sonic-buildimage/issues/4999
Also reverted my previous change in which device_info.get_platform() would first try obtaining the platform ID string from Config DB and fall back to gathering it from machine.conf upon failure because this function is called by sonic-cfggen before the data is in the DB, in which case, the db_connect() call will hang indefinitely, which was not the behavior I expected. As of now, the function will always reference machine.conf.
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
Dynamic threshold setting changed to 0 and WRED profile green min threshold set to 250000 for Tomahawk devices
Changed the dynamic threshold settings in pg_profile_lookup.ini
Added a macro for WRED profiles in qos.json.j2 for Tomahawk devices
Necessary changes made in qos.config.j2 to use the macro if present
Signed-off-by: Neetha John <nejo@microsoft.com>
Implement part of the Chassis and Fan related APIs.
Psu APIs
get_voltage()
get_current()
get_power()
get_powergood_status()
set_status_led()
get_status_led()
Update Fan APIs to support PSU FAN
get_direction()
get_speed()
get_target_speed()
get_speed_tolerance()
get_target_speed()
PSU APIs base on Device API
get_name()
get_presence()
get_model()
get_serial()
get_status()
- How I did it
Implement PSU APIs
Update FAN API to support PSU Fans
Add PSU object to Chassis API
Implement part of the Chassis and Fan related APIs.
- Chassis APIs
get_base_mac()
get_serial_number()
get_serial_number()
get_system_eeprom_info()
get_reboot_cause()
- Fan APIs
get_direction()
get_speed()
get_target_speed()
get_speed_tolerance()
set_speed()
set_status_led()
get_target_speed()
- Fan APIs base on Device API
get_name()
get_presence()
get_model()
get_serial()
get_status()
Signed-off-by: Wirut Getbamrung wgetbumr@celestica.com
* Remove the divide by 4 operation to the under the hood SAI
This is to avoid the need and thus the confusion for application program to know
the mmu internal architecture
This change must have support from SAI change to reach the correct
config
Signed-off-by: Wenda <wenni@microsoft.com>
* Relegate the divide by 4 operation to the under the hood SAI for egress
lossless pool
Extend to 7060 and 6100
Signed-off-by: Wenda <wenni@microsoft.com>
* Add more TH/TH2 hwskus
Signed-off-by: Wenda Ni <wenni@microsoft.com>
* Update config test
Signed-off-by: Wenda Ni <wenni@microsoft.com>
* Add TH2 ingress lossy profile
Signed-off-by: Wenda Ni <wenni@microsoft.com>
* Move the divide by 4 operation to SAI internal
Signed-off-by: Wenda Ni <wenni@microsoft.com>
* [bcm SAI] Upgrade Broadcom SAI to version 3.5.3.1-15
- Broadcom SAI 3.5 GA release 20190924.
Signed-off-by: Ying Xie <ying.xie@microsoft.com>
* add config.bcm for hlx
* modify config.bcm path for hlx
* Delete hx4-cel-hbtn-48x1G+4x10G.config.bcm
* add config.bcm and path
* update led for cxp
* Add new device data for dx010
* Utilize the same sai.profile and config.bcm file
Signed-off-by: Zhenggen Xu <zxu@linkedin.com>
* Fix the index issues for HWSKU: Seastone-DX010-25-50 and Seastone-DX010-50-40
Signed-off-by: Zhenggen Xu <zxu@linkedin.com>
* Update sonic-swss submodule
* src/sonic-swss 63afbd5...5be3963 (11):
> Remove the platform check for remove/add port action at init phase. (#1006)
> [test]: Add Class object in each test script file (#992)
> [vstest]: add --imgname option to specify vs image to test (#996)
> [qosorch]: Add cir and pir parameters for scheduler (#991)
> [vstest]: report error when team kernel module is not available (#994)
> Support per buffer pool watermark polling mode (#973)
> [test]: Update test_vlan to use dvs functions (#986)
> Add synchronous switch to orch agent (#987)
> ARM32 bit fixes, for 64bit printf format specifier (#989)
> [portsorch]: Rename function isPortReady() to allPortsReady() (#990)
> [routeorch]: Fix observer detaching procedure for next hop observers (#985)
Signed-off-by: Zhenggen Xu <zxu@linkedin.com>
* [platform/cel] Implement FAN APIs based on the new platform API
* [platform/cel] Move platform api to under device platform
* [platform/cel] Remove rule to build platform api python wheel
The sai profile itself can support 32x50G+16x100G/40G while
the initial port_config.ini uses 40G speeds for port 17-32.
Signed-off-by: Zhenggen Xu <zxu@linkedin.com>
* [updategraph] add support to use preset config instead of default minigraph
* Fix variable case
* Remove default minigraph case
* Remove default minigraphs and add default_sku files
* [platform/haliburton] Fix kernel panic when remove smc module.
* [platform/haliburton] Chanage sysfs to support module interrupt
* [device/haliburton] Update sfputil to use new sysfs.
* [device/haliburton] sfputil to support xcvrd monitoring.
* update sfputil, port indext start from 1
* DX010 update SKUs port config index
Port index in port_config.ini now start from 1.
* Seastone-DX010-10-50 port config update
* Seastone-DX010-50 port config update
* Seastone-DX010 port config update
* Update dx010 sfputil plugin
* Implement lpmode set function.
* Implement transceiver reset function.
* Python code style format.
* Remove new line at the end of port_config.ini
*New line cause parsing error in sfputilbase.
* Add get_transceiver_change_event method
*This needed by new sfputilbase implement.
* Fix unintended line breaks
* ASIC part support for Celestica DX010 platform.
It includes:
*Three different configurations: 32x100G, 64x50G, 96x10G+16x50G.(Script to be includd in the platform directory).
*Data port LED
Also from vendor:
*fancontrol configuration
*eeprom.py/sfpulti.py plugins
*sensor configuration
* Typo fix
* Add the port configuration change script
* move the script to sonic-utilities repo