ossobv / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
0 stars 0 forks source link

runtime: Missing Accton port ASIC files #1

Closed wdoekes closed 1 day ago

wdoekes commented 3 days ago

In SONiC-OS-Edgecore-SONiC_20240425_054819_ec202111_819 there are these files:

# find /usr/share/sonic/device/x86_64-accton_as7326_56x-r0/ -type f | sort
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/buffers.json.j2
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/buffers_defaults_t0.j2
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/buffers_defaults_t1.j2
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/hwsku.json
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/port_config.ini
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/qos.json.j2
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/sai.profile
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/td3-as7326-48x25G+8x100G.config.bcm
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/an_support.json
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/custom_led.bin
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/default_sku
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/fast-reboot_plugin
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/installer.conf
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/led_proc_init.soc
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/linkscan_led_fw.bin
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/media_settings.json
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/pcie.yaml
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/pddf/pd-plugin.json
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/pddf/pddf-device.json
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/platform.json
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/platform_asic
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/platform_hw_reset
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/platform_update_hw_reset_cause
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/plugins/eeprom.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/plugins/psuutil.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/plugins/sfputil.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/pmon_daemon_control.json
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/sensors.conf
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/soft-reboot_plugin
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/sonic_platform/__init__.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/sonic_platform/chassis.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/sonic_platform/component.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/sonic_platform/eeprom.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/sonic_platform/event.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/sonic_platform/fan.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/sonic_platform/fan_drawer.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/sonic_platform/helper.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/sonic_platform/platform.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/sonic_platform/psu.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/sonic_platform/sfp.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/sonic_platform/thermal.py
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/system_health_monitoring_config.json
/usr/share/sonic/device/x86_64-accton_as7326_56x-r0/warm-reboot_plugin

And these files:

# find /usr/share/sonic/device/x86_64-accton_as9716_32d-r0/ -type f | sort
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D-100G/buffers.json.j2
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D-100G/buffers_defaults_t0.j2
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D-100G/buffers_defaults_t1.j2
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D-100G/hwsku.json
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D-100G/port_config.ini
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D-100G/qos.json.j2
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D-100G/sai.profile
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D-100G/th3-as9716-32x100G.config.bcm
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D/buffers.json.j2
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D/buffers_defaults_t0.j2
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D/buffers_defaults_t1.j2
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D/dpb_port_profile
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D/hwsku.json
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D/port_config.ini
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D/qos.json.j2
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D/sai.profile
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D/th3-as9716-32x400G-profile-0.config.bcm
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D/th3-as9716-32x400G-profile-1.config.bcm
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/an_support.json
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/custom_led.bin
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/default_sku
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/fast-reboot_plugin
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/installer.conf
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/led_proc_init.soc
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/media_settings.json
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pcie.yaml
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pddf/pd-plugin.json
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pddf/pddf-device.json
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/platform.json
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/platform.json.j2
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/platform_asic
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/plugins/eeprom.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/plugins/psuutil.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/plugins/sfputil.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pmon_daemon_control.json
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/sensors.conf
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/soft-reboot_plugin
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/sonic_platform-1.0-py3-none-any.whl
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/sonic_platform/__init__.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/sonic_platform/chassis.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/sonic_platform/component.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/sonic_platform/eeprom.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/sonic_platform/event.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/sonic_platform/fan.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/sonic_platform/fan_drawer.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/sonic_platform/helper.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/sonic_platform/platform.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/sonic_platform/psu.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/sonic_platform/sfp.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/sonic_platform/thermal.py
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/system_health_monitoring_config.json
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/warm-reboot_plugin

In the SONiC-OS-202405-osso.0-dirty-20241102.171738 image, they were not present.

This causes /usr/bin/pcie-check.sh to bail out without doing anything useful.

Copying the files from SONiC-OS-Edgecore-SONiC_20240425_054819_ec202111_819 helps. But we need to investigate why they are missing. They were both supposedly mostly 2017-02 something, so it's not that my build/branch was too old.

wdoekes commented 3 days ago

Check https://github.com/ossobv/sonic-buildimage/blob/master/src/sonic-device-data/Makefile

Which fetches data from https://github.com/ossobv/sonic-buildimage/blob/master/devices but not sure how yet.

Looks like the files indeed are not there, but only in proprietary land somewhere?

On the proprietary install we have this nice package:

# apt-cache show sonic-device-data
Package: sonic-device-data
Status: install ok installed
Priority: optional
Section: misc
Installed-Size: 75166
Maintainer: Joe LeVeque <jolevequ@microsoft.com>
Architecture: all
Version: 1.0-1
Description: Device-specific data files for SONiC
Description-md5: 71ac212b4d6f181dec14ec448f20f4b4

versus this bigger(!) one

# apt-cache show sonic-device-data
Package: sonic-device-data
Status: install ok installed
Priority: optional
Section: misc
Installed-Size: 139926
Maintainer: Joe LeVeque <jolevequ@microsoft.com>
Architecture: all
Version: 1.0-1
Description: Device-specific data files for SONiC
Description-md5: 71ac212b4d6f181dec14ec448f20f4b4
wdoekes commented 3 days ago

Also interesting to note that there are actually asic-specific packages:

Packages

root@leaf1:~# dpkg -l | grep sonic-platform
ii  sonic-platform-accton-as7326-56x      1.1                                     amd64        kernel modules for platform devices such as fan, led, sfp
ii  sonic-platform-pddf                   1.1                                     amd64        kernel modules for platform devices such as psu, fan, sfp, led
root@spine1:~# dpkg -l | grep sonic-platf
ii  sonic-platform-accton-as9716-32d      1.1                            amd64        kernel modules for platform devices such as fan, led, sfp
ii  sonic-platform-pddf                   1.1                            amd64        kernel modules for platform devices such as psu, fan, sfp, led

These were found auto-installed on the respective leaf/spine where they belong.

It looks buggy that both packages do contain some other files.

root@leaf1:~# dpkg-deb -c /host/image-202405-osso.0-dirty-20241102.171738/platform/common/sonic-platform-accton-as9716-32d_1.1_amd64.deb  | grep 7326
drwxr-xr-x root/root         0 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as7326_56x/
-rw-r--r-- root/root         0 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as7326_56x/__init__.py
drwxr-xr-x root/root         0 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as7326_56x/__pycache__/
-rw-r--r-- root/root       162 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as7326_56x/__pycache__/__init__.cpython-311.pyc
-rw-r--r-- root/root      9111 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as7326_56x/__pycache__/fanutil.cpython-311.pyc
-rw-r--r-- root/root      8135 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as7326_56x/__pycache__/thermalutil.cpython-311.pyc
-rw-r--r-- root/root      8835 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as7326_56x/fanutil.py
-rw-r--r-- root/root      6272 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as7326_56x/thermalutil.py

Also in the other image:

root@leaf1:~# dpkg-deb -c /host/image-4.4.0-Enterprise_Base/platform/x86_64-accton_as7326_56x-r0/sonic-platform-accton-as7326-56x_1.1_amd64.deb | grep 9716
drwxr-xr-x root/root         0 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as9716_32d/
-rw-r--r-- root/root         0 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as9716_32d/__init__.py
drwxr-xr-x root/root         0 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as9716_32d/__pycache__/
-rw-r--r-- root/root       144 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as9716_32d/__pycache__/__init__.cpython-39.pyc
-rw-r--r-- root/root      5469 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as9716_32d/__pycache__/fanutil.cpython-39.pyc
-rw-r--r-- root/root      2701 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as9716_32d/__pycache__/thermalutil.cpython-39.pyc
-rw-r--r-- root/root      7528 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as9716_32d/fanutil.py
-rw-r--r-- root/root      3748 2017-12-19 01:35 ./usr/lib/python3/dist-packages/as9716_32d/thermalutil.py

Not in the Edgecore though:

root@spine1:~# dpkg-deb -c /host/image-Edgecore-SONiC_20240425_054819_ec202111_819/platform/x86_64-accton_as7326_56x-r0/sonic-platform-accton-as7326-56x_1.1_amd64.deb | grep 9716
(empty)
wdoekes commented 1 day ago

Looks like things work.

We won't be touching these unless we have to.