Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified platform utils based on platform type and not SKU #4

Closed
wants to merge 290 commits into from

Conversation

madhanmellanox
Copy link
Owner

…onaries and functions in script files sfputil.py, chassis.py, fan.py, psu.py and thermal.py

- What I did
I moved all the SKU based variables (dictionaries), functions to Platform based variables and functions in scripts like sfputil.py, chassis.py, psu.py, fan.py and thermal.py

- How I did it
I eliminated almost all the references of SKU based dictionaries and functions from these files and instead used Platform based dictionaries and functions.

- How to verify it
Used the following commands to verify my changes are working:
sudo sfputil show presence
show platform psustatus
show interface transceiver eeprom Ethernet0
show platform temperature

- Description for the changelog

The changes are only in files sfputil.py, chassis.py, fan.py, psu.py and thermal.py and the changes are conversion of dictionaries and functions from SKU based to Platform based.

- A picture of a cute animal (not mandatory but encouraged)

# port_position_tuple = (PORT_START, QSFP_PORT_START, PORT_END, PORT_IN_BLOCK, EEPROM_OFFSET)
hwsku_dict = {'ACS-MSN2700': 0, 'Mellanox-SN2700': 0, 'Mellanox-SN2700-D48C8': 0, "LS-SN2700":0, 'ACS-MSN2740': 0, 'ACS-MSN2100': 1, 'ACS-MSN2410': 2, 'ACS-MSN2010': 3, 'ACS-MSN3700': 0, 'ACS-MSN3700C': 0, 'ACS-MSN3800': 4, 'Mellanox-SN3800-D112C8': 4}
platform_dict = {'x86_64-mlnx_msn2700-r0': 0, 'x86_64-mlnx_msn2740-r0': 0, 'x86_64-mlnx_msn2100-r0': 1, 'x86_64-mlnx_msn2410-r0': 2, 'x86_64-mlnx_msn2010-r0': 3, 'x86_64-mlnx_msn3700-r0': 0, 'x86_64-mlnx_msn3700c-r0': 0, 'x86_64-mlnx_msn3800-r0': 4}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing x86_64-mlnx_msn4700-r0 platform

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in the next commit. Thanks.

@@ -29,6 +29,7 @@
MLNX_NUM_PSU = 2

GET_HWSKU_CMD = "sonic-cfggen -d -v DEVICE_METADATA.localhost.hwsku"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this still needed and used?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still required to set the name of the chassis, as it is done in the below code:
mi = get_machine_info()
if mi is not None:
self.name = mi['onie_platform']
else:
self.name = self.sku_name

Stephen Sun and others added 11 commits April 17, 2020 04:51
The initialization of /dev/random (crng init) is responsible for
random number generation. On some devices, crng took very long to
finish.
Co-authored-by: Bing Sun <Bing_Sun@dell.com>
- create a file in files/image_config/ntp/ntp-systemd-wrapper to add mgmt vrf related start cmd for ntp service. So that the default /usr/lib/ntp/ntp-systemd-wrapper can be overriden during build time.

- modify build_debian.sh to cp files/image_config/ntp/ntp-systemd-wrapper to /usr/lib/ntp/ntp-systemd-wrapper during build time.

Co-authored-by: Bing Sun <Bing_Sun@dell.com>
in buster, by default, rsyslog service does not create pidfile which
breaks monit configuration

Signed-off-by: Guohan Lu <lguohan@gmail.com>
Signed-off-by: Guohan Lu <lguohan@gmail.com>
Signed-off-by: Guohan Lu <lguohan@gmail.com>
Signed-off-by: Guohan Lu <lguohan@gmail.com>
Signed-off-by: Guohan Lu <lguohan@gmail.com>
Copy link

@liat-grozovik liat-grozovik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@madhanmellanox can you please address my question if the SKU define is still needed?
also, can we add sn3420 and sn4600c to the list even if there are not fully supported? there are PRs in progress and not sure what will be merged first.

@liat-grozovik
Copy link

suggest also the rephrase the commit header.
it is too long. i think the idea is to have platform utils based on platform type and not SKU.

taocy001 and others added 2 commits April 17, 2020 00:38
from 3.7.3.3-3 to 3.7.3.3-4
Fixes for PFC WD

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@madhanmellanox madhanmellanox changed the title Modified SKU based dictionaries and functions to Platform based dicti… Modified platform utils based on platform type and not SKU Apr 17, 2020
@madhanmellanox
Copy link
Owner Author

@madhanmellanox can you please address my question if the SKU define is still needed?
also, can we add sn3420 and sn4600c to the list even if there are not fully supported? there are PRs in progress and not sure what will be merged first.

SKU defines is required in chassis.py, just to name the chassis, as mentioned in the above comment. Will add SN3420 and SN4600c in the next commit.

lguohan and others added 10 commits April 18, 2020 21:14
Signed-off-by: Guohan Lu <lguohan@gmail.com>
console means the vga port. this is mainly used for virtual environment such as hyper-v or virtualbox where you have the virtual vga port to display the boot up process.

Signed-off-by: Guohan Lu <lguohan@gmail.com>
add $(BLDENV) in cache flags for following targets:

- $(SONIC_MAKE_DEBS)
- $(SONIC_DPKG_DEBS)
- $(SONIC_ONLINE_DEBS)
- $(SONIC_COPY_DEBS)
- $(SONIC_MAKE_FILES)

This is because we could build a same package for both
base image and docker which can be different os distribution,
i.e., buster v.s. stretch.

- target/debs/buster/swig3.0_3.0.12-2_amd64.deb
- target/debs/stretch/swig3.0_3.0.12-2_amd64.deb

Signed-off-by: Guohan Lu <lguohan@gmail.com>
Added DPKG support for ICCPD package
Added warning support for missing dependency files that causes the incorrect SHA generation.
[baseimage]: upgrade base image to debian buster

bring up the base image to debian buster 4.19 kernel.

using the merge commits to preserve the individual commits to better track the history.
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
This patch set implements the following:
 - Fixes the conflicts in chassis.py / platform.py in sonic_platfrom
 - Consolidating the common library files in sonic_platform
 - Moving QFX5210 specific drivers to qfx5210/modules
 - Moving Juniper common fpga drivers to common/modules
 - Cleaning up the platform driver files
 - Bug fixes in QFX5210 platform monitor & initialiazation script
 - Fixing the bugs in QFX5210 eeprom parsing

Signed-off-by: Ciju Rajan K <crajank@juniper.net>
aravindmani-1 and others added 23 commits June 9, 2020 10:05
**How I did it**

- Modified port_config.ini, TD2 settings to bring the ports UP.

**How to verify it**

- Check LLDP neighbors,LLDP table, interface status,EEPROM and other show commands.
- Do OIR, LED, Traffic testings.
**Why I did it**

- Added support for S6000 new HWSKU-Q24S32

**How I did it**

- Modified port_config.ini, TD2 settings to bring the ports UP.

**How to verify it**

- Check LLDP neighbors,LLDP table, interface status,EEPROM and other show commands.
- Do OIR, LED, Traffic testings.
- Add .gitignore files in each subdirectory of src/, so as to reduce the size of the .gitignore file in the project root, and also make it easier to maintain (i.e., if a directory in src/ is removed, there will not be outdated entries in the root .gitignore file.

- Also add missing .gitignore entries and remove outdated entries and duplicates.
Signed-off-by: Danny Allen <daall@microsoft.com>
Found another syncd timing issue related to clock going backwards.
To be safe disable the ntp long jump.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
spytest requires higher paramiko version. Fix it to 2.7.1.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
The `-sv2` suffix was used to differentiate SNMP Dockers when we transitioned from "SONiCv1" to "SONiCv2", about four years ago. The old Docker materials were removed long ago; there is no need to keep this suffix. Removing it aligns the name with all the other Dockers.

Also edit Monit configuration to detect proper snmp-subagent command line in Buster, and make snmpd command line matching more robust.
Signed-off-by: Ying Xie <ying.xie@microsoft.com>
Signed-off-by: Andriy Kokhan <akokhan@barefootnetworks.com>
Signed-off-by: Shlomi Bitton <shlomibi@mellanox.com>
* Set radvd version to match buster version(2.17-2)

Signed-off-by: Joyas Joseph <joyas_joseph@dell.com>
**- Why I did it**
To ensure telemetry service is enabled by default after installing a fresh SONiC image

**- How I did it**
Set telemetry feature status to "enabled" when generating init_cfg.json file
Switching to Flannel from Calico which brings down the image size by around 500+MB.
* Support rw files allowlist for Sonic Secure Boot
* Improve the performance
* fix bug
* Move the config description into a md file
* Change to use a simple way to remove the blank line
* Support chmod a-x in rw folder
* Change function name
* Change some unnecessary words
* src/sonic-utilities 5765570...a21e01a (13):
  > [config] Don't attempt to restart disabled services (sonic-net#944)
  > [crm] Use swsssdk API instead of redis-cli for getting keys from redis DB (sonic-net#943)
  > Fixed fast-reboot for BFN platform (sonic-net#871)
  > [sfputil] Add support of platform.json (sonic-net#767)
  > [show] Add support for SONiC Gearbox Manager via new gearboxutil utility (sonic-net#931)
  > [warm-reboot]: added pre-check for ISSU file (sonic-net#915)
  > Add_intf_range (sonic-net#913)
  > add fec config/show option (sonic-net#764)
  > Make sure db_migrator is run after all config are loaded during (sonic-net#926)
  > Changes to make lldp show command for multi-npu platforms. (sonic-net#914)
  > [showtech]: add knet dump information in show tech (sonic-net#925)
  > Vnet alias mapping (sonic-net#924)
  > Revert the change to kdump reboot (sonic-net#916)
…onaries and functions in script files sfputil.py, chassis.py, fan.py, psu.py and thermal.py
Copy link

@liat-grozovik liat-grozovik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please create new PR as yours has 1006 files changed.
we need to be sure to review only relevant files.

and please make sure to test such before you are asking for review.

@madhanmellanox
Copy link
Owner Author

Since, the PR is polluted with 2 many files, I am closing this PR.

madhanmellanox pushed a commit that referenced this pull request Jan 17, 2021
This update brings in the following commits.

86c1108 Enable arm architecture to build in addition to amd64 (sonic-net#37)
4acb2c3 fix bugs and enhance Transformer (sonic-net#35)
49e5a22 ygot related enhancements and fixes (sonic-net#34)
51224de Fix ietf yang search path for cvl schema builds (sonic-net#32)
3c6cdb3 CVL Changes #8: 'must' and 'when' expression evaluation (sonic-net#31)
dabf231 CVL Changes #7: 'leafref' evaluation (sonic-net#28)
6f9535f CVL Changes #6: Customized Xpath Engine integration (sonic-net#27)
5e2466b DB-Layer fixes/enhancements (sonic-net#26)
9a27302 CVL Changes #4: Implementation of new CVL APIs (sonic-net#22)
dbf1093 Translib support for authorization, yang versioning and Delete flag (sonic-net#21)
80f369e CVL Changes #5: YParser enhancement (sonic-net#23)
904ce18 CVL Changes #3: Multi-db instance support (sonic-net#20)
9d24a34 CVL Changes #2:  YValidator infra changes for evaluating xpath expression (sonic-net#19)
f3fc40f CVL Changes #1: Initial CVL code reorganization and common infra changes (sonic-net#18)
4922601 Bulk and RPC API support in translib (#16)
1d730df RFC7895 yang module library implementation (#15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.