From 721c2844d8d3e58932fa1d279949523f45580362 Mon Sep 17 00:00:00 2001 From: marif-nexthop Date: Wed, 14 Jan 2026 22:25:42 -0800 Subject: [PATCH 1/5] PR813 [Nexthop] Upgrade FBOSS Distro to support systemd services --- .../bin/build_image_in_container.sh | 4 +++ .../templates/centos-09.0/config.sh | 24 +++++++++---- .../system/data_corral_service.service | 33 ++++++++++++++++++ .../lib/systemd/system/fan_service.service | 29 ++++++++++++++++ .../usr/lib/systemd/system/fsdb.service | 28 +++++++++++++++ .../systemd/system/platform_manager.service | 34 +++++++++++++++++++ .../lib/systemd/system/qsfp_service.service | 31 +++++++++++++++++ .../lib/systemd/system/sensor_service.service | 29 ++++++++++++++++ .../lib/systemd/system/wedge_agent.service | 32 +++++++++++++++++ 9 files changed, 237 insertions(+), 7 deletions(-) create mode 100644 fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/data_corral_service.service create mode 100644 fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fan_service.service create mode 100644 fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fsdb.service create mode 100644 fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/platform_manager.service create mode 100644 fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/qsfp_service.service create mode 100644 fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/sensor_service.service create mode 100644 fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/wedge_agent.service diff --git a/fboss-image/image_builder/bin/build_image_in_container.sh b/fboss-image/image_builder/bin/build_image_in_container.sh index 31e46f8156f5c..fb9742b95c3de 100755 --- a/fboss-image/image_builder/bin/build_image_in_container.sh +++ b/fboss-image/image_builder/bin/build_image_in_container.sh @@ -156,6 +156,10 @@ cp /etc/resolv.conf "${DESCRIPTION_DIR}/root/etc/" # Add build timestamp to the image echo "Built on: $(date -u)" >"$DESCRIPTION_DIR/root/etc/build-info" +# Copy rootfs template files to overlay +dprint "Copying rootfs files to overlay..." +cp -R ${DESCRIPTION_DIR}/root_files/* ${DESCRIPTION_DIR}/root/ + # Generate the images dprint "Generating PXE and USB bootable image, this will take few minutes..." kiwi-ng-3 \ diff --git a/fboss-image/image_builder/templates/centos-09.0/config.sh b/fboss-image/image_builder/templates/centos-09.0/config.sh index dd86f33d0495e..e61da88cbb5ab 100755 --- a/fboss-image/image_builder/templates/centos-09.0/config.sh +++ b/fboss-image/image_builder/templates/centos-09.0/config.sh @@ -14,15 +14,15 @@ sed -i 's/^NAME=.*/NAME="FBOSS Distro Image"/' /usr/lib/os-release # kernel rpm present in /repos directory. This will either # be the LTS 6.12 or whatever the user specified. echo "Installing kernel rpms..." -dnf install --disablerepo=* -y /repos/*.rpm +dnf install --disablerepo=* -y /repos/*.rpm # 2. Define paths # Detect the installed kernel version from the boot directory # shellcheck disable=SC2012 VMLINUZ_PATH=$(ls /boot/vmlinuz-* 2>/dev/null | head -n 1) if [ -z "$VMLINUZ_PATH" ]; then - echo "Error: No vmlinuz found in /boot" - exit 1 + echo "Error: No vmlinuz found in /boot" + exit 1 fi KERNEL_VERSION=$(basename "$VMLINUZ_PATH" | sed 's/^vmlinuz-//') @@ -30,8 +30,8 @@ KERNEL_VERSION=$(basename "$VMLINUZ_PATH" | sed 's/^vmlinuz-//') # shellcheck disable=SC2012 INITRD_PATH=$(ls /boot/initramfs-* 2>/dev/null | head -n 1) if [ -z "$INITRD_PATH" ]; then - echo "Error: No initramfs found in /boot" - exit 1 + echo "Error: No initramfs found in /boot" + exit 1 fi echo "Detected kernel version: ${KERNEL_VERSION}" @@ -48,8 +48,18 @@ dracut --force --kver "${KERNEL_VERSION}" "${INITRD_PATH}" # This wipes ALL interfering variables set by kiwi-ng # and runs kernel-install in a "sterile" environment. env -i \ - PATH="/usr/bin:/usr/sbin:/bin:/sbin" \ - kernel-install add "${KERNEL_VERSION}" "${VMLINUZ_PATH}" --initrd-file "${INITRD_PATH}" + PATH="/usr/bin:/usr/sbin:/bin:/sbin" \ + kernel-install add "${KERNEL_VERSION}" "${VMLINUZ_PATH}" --initrd-file "${INITRD_PATH}" + +# 5. Enable systemd services +echo "Enabling FBOSS systemd services..." +systemctl enable platform_manager.service +systemctl enable data_corral_service.service +systemctl enable fan_service.service +systemctl enable sensor_service.service +systemctl enable fsdb.service +systemctl enable qsfp_service.service +systemctl enable wedge_agent.service # 6. Done! Cleanup, remember that we are chrooted on the rootfs echo "Removing kernel rpms from rootfs..." diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/data_corral_service.service b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/data_corral_service.service new file mode 100644 index 0000000000000..8ddacddd5fedb --- /dev/null +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/data_corral_service.service @@ -0,0 +1,33 @@ +# /usr/lib/systemd/system/data_corral_service.service +[Unit] +Description=FBOSS Data Corral Service +After=platform_manager.service +After=rc-local.service +StartLimitIntervalSec=600 +StartLimitBurst=5 + +[Service] +Type=notify +LimitNOFILE=10000000 +LimitCORE=32G + +Environment="PATH=/opt/fboss/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" +Environment="LD_LIBRARY_PATH=/opt/fboss/lib" +WorkingDirectory=/opt/fboss +ExecStart=/bin/bash -c 'source /opt/fboss/bin/setup_fboss_env && exec /opt/fboss/bin/data_corral_service' + +Restart=always +RestartSec=30 +TimeoutStartSec=180s + +# Capabilities +AmbientCapabilities=CAP_SYS_RAWIO +CapabilityBoundingSet=CAP_SYS_RAWIO + +# Logging to journald +StandardOutput=journal +StandardError=journal +SyslogIdentifier=data_corral_service + +[Install] +WantedBy=multi-user.target diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fan_service.service b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fan_service.service new file mode 100644 index 0000000000000..7e4032be32f76 --- /dev/null +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fan_service.service @@ -0,0 +1,29 @@ +# /usr/lib/systemd/system/fan_service.service +[Unit] +Description=FBOSS Fan Service +After=platform_manager.service +After=rc-local.service +StartLimitIntervalSec=600 +StartLimitBurst=5 + +[Service] +Type=notify +LimitNOFILE=10000000 +LimitCORE=32G + +Environment="PATH=/opt/fboss/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" +Environment="LD_LIBRARY_PATH=/opt/fboss/lib" +WorkingDirectory=/opt/fboss +ExecStart=/bin/bash -c 'source /opt/fboss/bin/setup_fboss_env && exec /opt/fboss/bin/fan_service --subscribe_to_stats_from_fsdb --subscribe_to_qsfp_data_from_fsdb' + +Restart=always +RestartSec=30 +TimeoutStartSec=180s + +# Logging to journald +StandardOutput=journal +StandardError=journal +SyslogIdentifier=fan_service + +[Install] +WantedBy=multi-user.target diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fsdb.service b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fsdb.service new file mode 100644 index 0000000000000..3391cd7d129c5 --- /dev/null +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fsdb.service @@ -0,0 +1,28 @@ +# /usr/lib/systemd/system/fsdb.service +[Unit] +Description=FBOSS FSDB Service +After=rc-local.service +StartLimitIntervalSec=600 +StartLimitBurst=5 + +[Service] +Type=simple +LimitNOFILE=65535 +LimitCORE=32G + +Environment="PATH=/opt/fboss/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" +Environment="LD_LIBRARY_PATH=/opt/fboss/lib" +WorkingDirectory=/opt/fboss +ExecStart=/bin/bash -c 'source /opt/fboss/bin/setup_fboss_env && exec /opt/fboss/bin/fsdb' + +Restart=always +RestartSec=30 +TimeoutStartSec=180s + +# Logging to journald +StandardOutput=journal +StandardError=journal +SyslogIdentifier=fsdb + +[Install] +WantedBy=multi-user.target diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/platform_manager.service b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/platform_manager.service new file mode 100644 index 0000000000000..f8d520fff9f09 --- /dev/null +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/platform_manager.service @@ -0,0 +1,34 @@ +# /usr/lib/systemd/system/platform_manager.service +[Unit] +Description=FBOSS Platform Manager +Before=sensor_service.service +Before=fan_service.service +Before=data_corral_service.service +Before=led_service.service +Before=qsfp_service.service +Before=fruid.service +After=rc-local.service +StartLimitIntervalSec=600 +StartLimitBurst=5 + +[Service] +Type=notify +LimitNOFILE=10000000 +LimitCORE=32G + +Environment="PATH=/opt/fboss/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" +Environment="LD_LIBRARY_PATH=/opt/fboss/lib" +WorkingDirectory=/opt/fboss +ExecStart=/bin/bash -c 'source /opt/fboss/bin/setup_fboss_env && exec /opt/fboss/bin/platform_manager --run_once=false' + +Restart=on-failure +RestartSec=30 +TimeoutStartSec=180s + +# Logging to journald +StandardOutput=journal +StandardError=journal +SyslogIdentifier=platform_manager + +[Install] +WantedBy=multi-user.target diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/qsfp_service.service b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/qsfp_service.service new file mode 100644 index 0000000000000..d4f98eb37c49d --- /dev/null +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/qsfp_service.service @@ -0,0 +1,31 @@ +# /usr/lib/systemd/system/qsfp_service.service +[Unit] +Description=FBOSS QSFP Service +After=platform_manager.service +After=rc-local.service +StartLimitIntervalSec=600 +StartLimitBurst=5 + +[Service] +Type=notify +LimitNOFILE=10000000 +LimitCORE=32G +MemoryMax=3.75G +MemorySwapMax=0 + +Environment="PATH=/opt/fboss/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" +Environment="LD_LIBRARY_PATH=/opt/fboss/lib" +WorkingDirectory=/opt/fboss +ExecStart=/bin/bash -c 'source /opt/fboss/bin/setup_fboss_env && exec /opt/fboss/bin/qsfp_service' + +Restart=always +RestartSec=30 +TimeoutStartSec=180s + +# Logging to journald +StandardOutput=journal +StandardError=journal +SyslogIdentifier=qsfp_service + +[Install] +WantedBy=multi-user.target diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/sensor_service.service b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/sensor_service.service new file mode 100644 index 0000000000000..fa9a9fb945a92 --- /dev/null +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/sensor_service.service @@ -0,0 +1,29 @@ +# /usr/lib/systemd/system/sensor_service.service +[Unit] +Description=FBOSS Sensor Service +After=platform_manager.service +After=rc-local.service +StartLimitIntervalSec=600 +StartLimitBurst=5 + +[Service] +Type=notify +LimitNOFILE=10000000 +LimitCORE=32G + +Environment="PATH=/opt/fboss/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" +Environment="LD_LIBRARY_PATH=/opt/fboss/lib" +WorkingDirectory=/opt/fboss +ExecStart=/bin/bash -c 'source /opt/fboss/bin/setup_fboss_env && exec /opt/fboss/bin/sensor_service --subscribe_to_stats_from_fsdb' + +Restart=always +RestartSec=30 +TimeoutStartSec=180s + +# Logging to journald +StandardOutput=journal +StandardError=journal +SyslogIdentifier=sensor_service + +[Install] +WantedBy=multi-user.target diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/wedge_agent.service b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/wedge_agent.service new file mode 100644 index 0000000000000..72d89daab8fbe --- /dev/null +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/wedge_agent.service @@ -0,0 +1,32 @@ +# /usr/lib/systemd/system/wedge_agent.service +[Unit] +Description=FBOSS Wedge Agent +After=platform_manager.service +After=qsfp_service.service +After=rc-local.service +StartLimitIntervalSec=600 +StartLimitBurst=5 + +[Service] +Type=notify +LimitNOFILE=10000000 +LimitCORE=32G +MemoryMax=3.75G +MemorySwapMax=0 + +Environment="PATH=/opt/fboss/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" +Environment="LD_LIBRARY_PATH=/opt/fboss/lib" +WorkingDirectory=/opt/fboss +ExecStart=/bin/bash -c 'source /opt/fboss/bin/setup_fboss_env && exec /opt/fboss/bin/wedge_agent-sai_impl' + +Restart=always +RestartSec=30 +TimeoutStartSec=180s + +# Logging to journald +StandardOutput=journal +StandardError=journal +SyslogIdentifier=wedge_agent + +[Install] +WantedBy=multi-user.target From 985a470c4f486ca1f2a9f715fd53ad0e06c17544 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Tue, 20 Jan 2026 13:17:13 -0800 Subject: [PATCH 2/5] [Nexthop] Create device-local RPM repo for run-time installation **Pre-submission checklist** - [X] I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running `pip install -r requirements-dev.txt && pre-commit install` - [X] `pre-commit run` package_manager, by default, detects the platform it is running on then uses a compiled-in config file to install the platform BSP RPM using dnf. This requires that we have an RPM repo with those RPMs. In Distro Image we cannot presume an infrastructure RPM server with the correct BSP and dependent RPMs. Instead, create a device-local one for that purpose. The repo metadata is created at boot instead of just install time to help the development workflows where a new RPM is uploaded to the device, then the device is restarted for testing. Build and load the image on a dut. Manually copy the BSP RPM into /usr/local/share/local_rpm_repo, run createrepo /usr/local/share/local_rpm_repo, then dnf search for that RPM: ``` dnf search nexthop Repository local_rpm_repo is listed more than once in the configuration Last metadata expiration check: 0:00:15 ago on Sat 17 Jan 2026 12:44:46 AM UTC. ======================= Name & Summary Matched: nexthop ======================== nexthop_bsp_kmods-6.11.1-1.fboss.el9.x86_64-1.el9-1.0.0.x86_64 : Nexthop BSP Kernel Modules ``` --- .../image_builder/templates/centos-09.0/config.sh | 5 +++++ .../image_builder/templates/centos-09.0/config.xml | 1 + .../root_files/etc/yum.repos.d/local_rpm_repo.repo | 6 ++++++ .../usr/lib/systemd/system/local_rpm_repo.service | 10 ++++++++++ .../usr/lib/systemd/system/platform_manager.service | 2 ++ .../root_files/usr/local/share/local_rpm_repo/README | 3 +++ 6 files changed, 27 insertions(+) create mode 100644 fboss-image/image_builder/templates/centos-09.0/root_files/etc/yum.repos.d/local_rpm_repo.repo create mode 100644 fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/local_rpm_repo.service create mode 100644 fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/share/local_rpm_repo/README diff --git a/fboss-image/image_builder/templates/centos-09.0/config.sh b/fboss-image/image_builder/templates/centos-09.0/config.sh index e61da88cbb5ab..409cc03707cd4 100755 --- a/fboss-image/image_builder/templates/centos-09.0/config.sh +++ b/fboss-image/image_builder/templates/centos-09.0/config.sh @@ -6,6 +6,10 @@ echo "--- Executing $0 ---" sed -i 's/^PRETTY_NAME=.*/PRETTY_NAME="FBOSS Distro Image"/' /usr/lib/os-release sed -i 's/^NAME=.*/NAME="FBOSS Distro Image"/' /usr/lib/os-release +# All dnf invocations with an invalid RPM repo configured will fail. Create the +# metadata for the local_rpm_repo now to prevent that. +createrepo /usr/local/share/local_rpm_repo + # 1. Install our custom kernel RPMs # # On purpose we don't install any kernel rpms as part of @@ -53,6 +57,7 @@ env -i \ # 5. Enable systemd services echo "Enabling FBOSS systemd services..." +systemctl enable local_rpm_repo.service systemctl enable platform_manager.service systemctl enable data_corral_service.service systemctl enable fan_service.service diff --git a/fboss-image/image_builder/templates/centos-09.0/config.xml b/fboss-image/image_builder/templates/centos-09.0/config.xml index 3b3346b2e1c1e..61106a19437aa 100644 --- a/fboss-image/image_builder/templates/centos-09.0/config.xml +++ b/fboss-image/image_builder/templates/centos-09.0/config.xml @@ -114,6 +114,7 @@ + diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/etc/yum.repos.d/local_rpm_repo.repo b/fboss-image/image_builder/templates/centos-09.0/root_files/etc/yum.repos.d/local_rpm_repo.repo new file mode 100644 index 0000000000000..6c0417b6dd250 --- /dev/null +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/etc/yum.repos.d/local_rpm_repo.repo @@ -0,0 +1,6 @@ +[local_rpm_repo] +name=Local Platform RPM repo +baseurl=file:///usr/local/share/local_rpm_repo +gpgcheck=0 +metadata_expire=6h +enabled=1 diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/local_rpm_repo.service b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/local_rpm_repo.service new file mode 100644 index 0000000000000..1aaa2b5b402c4 --- /dev/null +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/local_rpm_repo.service @@ -0,0 +1,10 @@ +[Unit] +Description=Enable local_rpm_repo + +[Service] +Type=oneshot +ExecStart=/usr/bin/createrepo /usr/local/share/local_rpm_repo +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/platform_manager.service b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/platform_manager.service index f8d520fff9f09..40e6e48ea840a 100644 --- a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/platform_manager.service +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/platform_manager.service @@ -8,6 +8,8 @@ Before=led_service.service Before=qsfp_service.service Before=fruid.service After=rc-local.service +Wants=local_rpm_repo.service + StartLimitIntervalSec=600 StartLimitBurst=5 diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/share/local_rpm_repo/README b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/share/local_rpm_repo/README new file mode 100644 index 0000000000000..512aae24deed3 --- /dev/null +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/share/local_rpm_repo/README @@ -0,0 +1,3 @@ +This directory contains RPMs which need to be installed at run-time, mostly by +platform_manager. Common contents include BSP kmods RPMs, SAI kmods RPMs, and +dependencies of those types of RPMs. From 0c27eefe9c70287876f0673cde62d56a95d12178 Mon Sep 17 00:00:00 2001 From: marif-nexthop Date: Thu, 29 Jan 2026 13:57:02 -0800 Subject: [PATCH 3/5] FBOSS Distro init service and default configs At boot, start a oneshot systemd service that launches a fboss_init.sh script to perform FBOSS distro initialization and setup e.g. copying right config files to /etc/coop etc. - Added systemd service launches the script fboss_init.sh - The init script does the following steps for now - Copy /etc/coop configuration files based on the dmidecode output - Generate fruid.json file - Added option to add default configs (qsfp_service and wedge_agent) for different platforms - Added default configs for montblanc platform as an example --- .../usr/lib/systemd/system/fboss_init.service | 19 + .../systemd/system/platform_manager.service | 2 + .../root_files/usr/local/bin/fboss_init.sh | 93 ++++ fboss/oss/scripts/package.py | 1 + .../default_configs/montblanc/agent.conf | 205 ++++++++ .../default_configs/montblanc/qsfp.conf | 478 ++++++++++++++++++ 6 files changed, 798 insertions(+) create mode 100644 fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_init.service create mode 100755 fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/bin/fboss_init.sh create mode 100644 fboss/oss/scripts/run_configs/default_configs/montblanc/agent.conf create mode 100644 fboss/oss/scripts/run_configs/default_configs/montblanc/qsfp.conf diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_init.service b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_init.service new file mode 100644 index 0000000000000..74c320771d9fc --- /dev/null +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_init.service @@ -0,0 +1,19 @@ +# /usr/lib/systemd/system/fboss_init.service +[Unit] +Description=FBOSS Initialization +DefaultDependencies=no +Before=platform_manager.service +After=local-fs.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/local/bin/fboss_init.sh + +# Logging to journald +StandardOutput=journal +StandardError=journal +SyslogIdentifier=fboss_init + +[Install] +WantedBy=multi-user.target diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/platform_manager.service b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/platform_manager.service index 40e6e48ea840a..2278a5b17f0af 100644 --- a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/platform_manager.service +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/platform_manager.service @@ -8,7 +8,9 @@ Before=led_service.service Before=qsfp_service.service Before=fruid.service After=rc-local.service +After=fboss_init.service Wants=local_rpm_repo.service +Wants=fboss_init.service StartLimitIntervalSec=600 StartLimitBurst=5 diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/bin/fboss_init.sh b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/bin/fboss_init.sh new file mode 100755 index 0000000000000..8855b358c86b8 --- /dev/null +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/bin/fboss_init.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# Initialize FBOSS configuration based on platform detection + +set -e + +FBOSS_SHARE="/opt/fboss/share" +COOP_DIR="/etc/coop" +FRUID_FILE="/var/facebook/fboss/fruid.json" + +log() { + echo "[fboss_init] $1" >&2 +} + +error() { + echo "[fboss_init] ERROR: $1" >&2 +} + +get_platform_dir() { + local platform + # convert the platform name to lowercase and delete spaces + platform=$(dmidecode -s system-product-name 2>/dev/null | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]') + if [[ -z $platform ]]; then + error "Failed to get system-product-name from dmidecode" + return 1 + fi + log "Detected platform: $platform" + + local platform_dir="${FBOSS_SHARE}/default_configs/${platform}" + if [[ ! -d $platform_dir ]]; then + error "Platform config directory not found: $platform_dir" + return 1 + fi + log "Using platform config directory: $platform_dir" + + echo "$platform_dir" +} + +copy_config() { + local src="$1" + local dst="$2" + local name="$3" + + if [[ -e $dst ]]; then + log "$name already exists at $dst (skipping)" + return + fi + + if [[ -f $src ]]; then + cp "$src" "$dst" + log "Copied $name: $src -> $dst" + else + log "No $name found at $src (skipping)" + fi +} + +generate_fruid() { + if [[ -e $FRUID_FILE ]]; then + log "fruid.json already exists at $FRUID_FILE (skipping)" + return + fi + + mkdir -p "$(dirname "$FRUID_FILE")" + + if /opt/fboss/bin/weutil --json >"$FRUID_FILE" 2>/dev/null; then + log "Generated fruid.json: $FRUID_FILE" + else + error "Failed to generate fruid.json" + rm -f "$FRUID_FILE" + fi +} + +setup_coop_configs() { + local platform_dir="$1" + mkdir -p "$COOP_DIR" + copy_config "${platform_dir}/agent.conf" "${COOP_DIR}/agent.conf" "agent.conf" + copy_config "${platform_dir}/qsfp.conf" "${COOP_DIR}/qsfp.conf" "qsfp.conf" +} + +main() { + log "Starting FBOSS initialization" + + local platform_dir + if ! platform_dir=$(get_platform_dir); then + exit 1 + fi + + setup_coop_configs "$platform_dir" + generate_fruid + + log "FBOSS initialization complete" +} + +main "$@" diff --git a/fboss/oss/scripts/package.py b/fboss/oss/scripts/package.py index d1dcfc18897a4..1df2103d507b7 100755 --- a/fboss/oss/scripts/package.py +++ b/fboss/oss/scripts/package.py @@ -39,6 +39,7 @@ RUN_SCRIPTS_DIR / "setup.py": "bin/setup.py", RUN_SCRIPTS_DIR / "setup_fboss_env": "bin/setup_fboss_env", RUN_SCRIPTS_DIR / "topology.cdf": "bin/topology.cdf", + RUN_CONFIGS_DIR / "default_configs": "share/default_configs", RUN_CONFIGS_DIR / "j2cp": "share/j2cp", RUN_CONFIGS_DIR / "j3b": "share/j3b", RUN_CONFIGS_DIR / "janga800bic": "share/janga800bic", diff --git a/fboss/oss/scripts/run_configs/default_configs/montblanc/agent.conf b/fboss/oss/scripts/run_configs/default_configs/montblanc/agent.conf new file mode 100644 index 0000000000000..4a9b33e77c523 --- /dev/null +++ b/fboss/oss/scripts/run_configs/default_configs/montblanc/agent.conf @@ -0,0 +1,205 @@ +{ + "defaultCommandLineArgs": { + "check_wb_handles": "true", + "counter_refresh_interval": "0", + "enable_acl_table_group": "true", + "log_variable_name": "true", + "sai_configure_six_tap": "true", + "skip_transceiver_programming": "true", + "use_full_dlb_scale": "true" + }, + "sw": { + "version": 0, + "ports": [ + ], + "vlans": [ + + ], + "vlanPorts": [ + + ], + "defaultVlan": 0, + "interfaces": [ + + ], + "arpTimeoutSeconds": 60, + "arpRefreshSeconds": 20, + "arpAgerInterval": 5, + "proactiveArp": false, + "staticRoutesWithNhops": [ + + ], + "staticRoutesToNull": [ + + ], + "staticRoutesToCPU": [ + + ], + "acls": [ + + ], + "maxNeighborProbes": 300, + "staleEntryInterval": 10, + "aggregatePorts": [ + + ], + "clientIdToAdminDistance": { + "0": 20, + "1": 1, + "2": 0, + "3": 0, + "4": 0, + "700": 255, + "786": 10 + }, + "sFlowCollectors": [ + + ], + "cpuQueues": [ + + ], + "loadBalancers": [ + + ], + "mirrors": [ + + ], + "trafficCounters": [ + + ], + "qosPolicies": [ + + ], + "defaultPortQueues": [ + + ], + "staticMplsRoutesWithNhops": [ + + ], + "staticMplsRoutesToNull": [ + + ], + "staticMplsRoutesToCPU": [ + + ], + "staticIp2MplsRoutes": [ + + ], + "portQueueConfigs": { + + }, + "switchSettings": { + "l2LearningMode": 0, + "qcmEnable": false, + "ptpTcEnable": false, + "l2AgeTimerSeconds": 300, + "maxRouteCounterIDs": 0, + "blockNeighbors": [ + + ], + "macAddrsToBlock": [ + + ], + "switchType": 0, + "exactMatchTableConfigs": [ + + ], + "switchIdToSwitchType_DEPRECATED": { + + }, + "switchDrainState": 0, + "switchIdToSwitchInfo": { + "0": { + "switchType": 0, + "asicType": 13, + "switchIndex": 0, + "portIdRange": { + "minimum": 0, + "maximum": 2047 + }, + "firmwareNameToFirmwareInfo": { + + } + } + }, + "vendorMacOuis": [ + + ], + "metaMacOuis": [ + + ], + "needL2EntryForNeighbor": true + }, + "aclTableGroup": { + "name": "acl-table-group-ingress", + "aclTables": [ + { + "name": "AclTable1", + "priority": 0, + "aclEntries": [ + + ], + "actionTypes": [ + + ], + "qualifiers": [ + + ], + "udfGroups": [ + + ] + } + ], + "stage": 0 + }, + "sdkVersion": { + "asicSdk": "sdk", + "saiSdk": "sai" + }, + "dsfNodes": { + + }, + "defaultVoqConfig": [ + + ], + "aclTableGroups": [ + { + "name": "acl-table-group-ingress", + "aclTables": [ + { + "name": "AclTable1", + "priority": 0, + "aclEntries": [ + + ], + "actionTypes": [ + + ], + "qualifiers": [ + + ], + "udfGroups": [ + + ] + } + ], + "stage": 0 + } + ], + "mirrorOnDropReports": [ + + ] + }, + "platform": { + "chip": { + "asicConfig": { + "common": { + "yamlConfig": "---\ndevice:\n 0:\n PC_PM_CORE:\n ?\n PC_PM_ID: 1\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x54761032\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x32107654\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x8C\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xFF\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 2\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x54761032\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x32107654\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x55\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xCC\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 3\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x23016745\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x54761032\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x33\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x00\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 4\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x52701634\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x54761032\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xAA\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xCC\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 5\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x74305612\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x21640357\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xF7\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x59\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 6\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x03562147\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x30742165\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x48\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x29\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 7\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x14567302\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x56712430\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xAF\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xFC\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 8\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x67315024\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x56217034\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xDD\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x53\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 9\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x21403765\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x20543176\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xDD\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x48\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 10\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x53062147\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x30742165\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x48\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x69\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 11\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x54067312\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x56712430\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xAF\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xFC\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 12\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x65304721\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x56217430\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xDD\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x56\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 13\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x21403765\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x20543176\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xDD\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x48\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 14\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x53062147\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x30742165\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x48\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x69\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 15\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x54067312\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x56712430\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xAF\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xFC\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 16\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x65304721\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x56217430\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xDD\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x56\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 17\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x65274130\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x56207431\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x87\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xA7\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 18\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x47306521\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x76305412\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x6C\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x86\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 19\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x02731456\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x21345076\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x99\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x07\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 20\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x30472165\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x21543076\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x6C\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xAD\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 21\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x45376120\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x56207431\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x2D\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xA7\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 22\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x40376521\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x76305412\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x3C\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x86\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 23\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x02731456\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x21345076\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x99\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x07\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 24\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x30472165\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x21543076\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x6C\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xAD\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 25\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x45376120\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x56207431\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x2D\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xA7\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 26\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x40376521\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x76305412\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x3C\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x86\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 27\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x03762514\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x21345076\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xDE\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x03\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 28\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x67125403\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x12470356\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x63\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xB2\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 29\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x32107654\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x54761032\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x22\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x66\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 30\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x32107654\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x54761032\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xCC\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x00\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 31\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x05371426\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x32107654\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x65\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x66\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 32\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x56741032\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x23016745\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x9C\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xFF\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 33\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x46751032\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x32106754\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xC9\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x55\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 34\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x54721036\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x32107654\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x22\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xCC\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 35\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x63410725\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x54761032\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x93\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xAA\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 36\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x32107645\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x54761032\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x77\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xCC\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 37\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x74260351\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x13064257\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xD8\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x21\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 38\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x10573246\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x30762145\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xC6\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x99\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 39\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x47356120\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x56702431\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x2D\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x8F\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 40\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x75016423\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x54217630\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xC9\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x58\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 41\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x01736524\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x20365174\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x96\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x52\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 42\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x10573246\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x30762145\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xC6\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xD9\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 43\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x47356120\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x56702431\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x2D\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x8F\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 44\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x75016423\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x54217630\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xC9\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x58\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 45\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x01746523\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x20365174\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x86\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x52\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 46\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x10576423\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x30762145\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xC6\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xD9\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 47\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x46357102\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x56702431\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x2D\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x8F\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 48\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x75016423\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x54216703\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xC9\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x54\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 49\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x57032146\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x54702631\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xB3\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xED\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 50\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x75102346\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x74305612\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xF3\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x66\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 51\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x32610754\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x20345176\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x95\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x60\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 52\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x01572346\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x21560347\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x0C\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xA9\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 53\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x57032146\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x54702631\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xB3\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xED\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 54\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x75102346\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x74305612\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xF3\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x66\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 55\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x32610754\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x20345176\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x95\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x60\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 56\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x01572346\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x21560347\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x0C\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xA9\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 57\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x57032146\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x54702631\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xB3\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xED\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 58\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x75102346\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x74305612\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xF3\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x66\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 59\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x32610754\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x20345176\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x95\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x20\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 60\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x64207531\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x23671045\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x0B\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xBB\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 61\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x51740362\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x54761032\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xB1\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x66\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 62\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x23016745\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x54761032\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x66\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xAA\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 63\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x54761032\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x32107654\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x00\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x66\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 64\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x54761032\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x23016745\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0xD9\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0xAA\n TX_POLARITY_FLIP_AUTO: 0\n ?\n PC_PM_ID: 65\n CORE_INDEX: 0\n :\n RX_LANE_MAP: 0x3210\n RX_LANE_MAP_AUTO: 0\n TX_LANE_MAP: 0x3210\n TX_LANE_MAP_AUTO: 0\n RX_POLARITY_FLIP: 0x00\n RX_POLARITY_FLIP_AUTO: 0\n TX_POLARITY_FLIP: 0x0F\n TX_POLARITY_FLIP_AUTO: 0\n...\n---\ndevice:\n 0:\n PC_PORT_PHYS_MAP:\n ?\n PORT_ID: 1\n :\n PC_PHYS_PORT_ID: 1\n ?\n PORT_ID: 5\n :\n PC_PHYS_PORT_ID: 5\n ?\n PORT_ID: 9\n :\n PC_PHYS_PORT_ID: 9\n ?\n PORT_ID: 10\n :\n PC_PHYS_PORT_ID: 13\n ?\n PORT_ID: 11\n :\n PC_PHYS_PORT_ID: 17\n ?\n PORT_ID: 15\n :\n PC_PHYS_PORT_ID: 21\n ?\n PORT_ID: 19\n :\n PC_PHYS_PORT_ID: 25\n ?\n PORT_ID: 20\n :\n PC_PHYS_PORT_ID: 29\n ?\n PORT_ID: 22\n :\n PC_PHYS_PORT_ID: 33\n ?\n PORT_ID: 26\n :\n PC_PHYS_PORT_ID: 37\n ?\n PORT_ID: 30\n :\n PC_PHYS_PORT_ID: 41\n ?\n PORT_ID: 31\n :\n PC_PHYS_PORT_ID: 45\n ?\n PORT_ID: 33\n :\n PC_PHYS_PORT_ID: 49\n ?\n PORT_ID: 37\n :\n PC_PHYS_PORT_ID: 53\n ?\n PORT_ID: 41\n :\n PC_PHYS_PORT_ID: 57\n ?\n PORT_ID: 42\n :\n PC_PHYS_PORT_ID: 61\n ?\n PORT_ID: 44\n :\n PC_PHYS_PORT_ID: 65\n ?\n PORT_ID: 48\n :\n PC_PHYS_PORT_ID: 69\n ?\n PORT_ID: 52\n :\n PC_PHYS_PORT_ID: 73\n ?\n PORT_ID: 53\n :\n PC_PHYS_PORT_ID: 77\n ?\n PORT_ID: 55\n :\n PC_PHYS_PORT_ID: 81\n ?\n PORT_ID: 59\n :\n PC_PHYS_PORT_ID: 85\n ?\n PORT_ID: 63\n :\n PC_PHYS_PORT_ID: 89\n ?\n PORT_ID: 64\n :\n PC_PHYS_PORT_ID: 93\n ?\n PORT_ID: 66\n :\n PC_PHYS_PORT_ID: 97\n ?\n PORT_ID: 70\n :\n PC_PHYS_PORT_ID: 101\n ?\n PORT_ID: 74\n :\n PC_PHYS_PORT_ID: 105\n ?\n PORT_ID: 75\n :\n PC_PHYS_PORT_ID: 109\n ?\n PORT_ID: 77\n :\n PC_PHYS_PORT_ID: 113\n ?\n PORT_ID: 81\n :\n PC_PHYS_PORT_ID: 117\n ?\n PORT_ID: 85\n :\n PC_PHYS_PORT_ID: 121\n ?\n PORT_ID: 86\n :\n PC_PHYS_PORT_ID: 125\n ?\n PORT_ID: 88\n :\n PC_PHYS_PORT_ID: 129\n ?\n PORT_ID: 92\n :\n PC_PHYS_PORT_ID: 133\n ?\n PORT_ID: 96\n :\n PC_PHYS_PORT_ID: 137\n ?\n PORT_ID: 97\n :\n PC_PHYS_PORT_ID: 141\n ?\n PORT_ID: 99\n :\n PC_PHYS_PORT_ID: 145\n ?\n PORT_ID: 103\n :\n PC_PHYS_PORT_ID: 149\n ?\n PORT_ID: 107\n :\n PC_PHYS_PORT_ID: 153\n ?\n PORT_ID: 108\n :\n PC_PHYS_PORT_ID: 157\n ?\n PORT_ID: 110\n :\n PC_PHYS_PORT_ID: 161\n ?\n PORT_ID: 114\n :\n PC_PHYS_PORT_ID: 165\n ?\n PORT_ID: 118\n :\n PC_PHYS_PORT_ID: 169\n ?\n PORT_ID: 119\n :\n PC_PHYS_PORT_ID: 173\n ?\n PORT_ID: 121\n :\n PC_PHYS_PORT_ID: 177\n ?\n PORT_ID: 125\n :\n PC_PHYS_PORT_ID: 181\n ?\n PORT_ID: 129\n :\n PC_PHYS_PORT_ID: 185\n ?\n PORT_ID: 130\n :\n PC_PHYS_PORT_ID: 189\n ?\n PORT_ID: 132\n :\n PC_PHYS_PORT_ID: 193\n ?\n PORT_ID: 136\n :\n PC_PHYS_PORT_ID: 197\n ?\n PORT_ID: 140\n :\n PC_PHYS_PORT_ID: 201\n ?\n PORT_ID: 141\n :\n PC_PHYS_PORT_ID: 205\n ?\n PORT_ID: 143\n :\n PC_PHYS_PORT_ID: 209\n ?\n PORT_ID: 147\n :\n PC_PHYS_PORT_ID: 213\n ?\n PORT_ID: 151\n :\n PC_PHYS_PORT_ID: 217\n ?\n PORT_ID: 152\n :\n PC_PHYS_PORT_ID: 221\n ?\n PORT_ID: 154\n :\n PC_PHYS_PORT_ID: 225\n ?\n PORT_ID: 158\n :\n PC_PHYS_PORT_ID: 229\n ?\n PORT_ID: 162\n :\n PC_PHYS_PORT_ID: 233\n ?\n PORT_ID: 163\n :\n PC_PHYS_PORT_ID: 237\n ?\n PORT_ID: 165\n :\n PC_PHYS_PORT_ID: 241\n ?\n PORT_ID: 169\n :\n PC_PHYS_PORT_ID: 245\n ?\n PORT_ID: 173\n :\n PC_PHYS_PORT_ID: 249\n ?\n PORT_ID: 174\n :\n PC_PHYS_PORT_ID: 253\n ?\n PORT_ID: 176\n :\n PC_PHYS_PORT_ID: 257\n ?\n PORT_ID: 180\n :\n PC_PHYS_PORT_ID: 261\n ?\n PORT_ID: 184\n :\n PC_PHYS_PORT_ID: 265\n ?\n PORT_ID: 185\n :\n PC_PHYS_PORT_ID: 269\n ?\n PORT_ID: 187\n :\n PC_PHYS_PORT_ID: 273\n ?\n PORT_ID: 191\n :\n PC_PHYS_PORT_ID: 277\n ?\n PORT_ID: 195\n :\n PC_PHYS_PORT_ID: 281\n ?\n PORT_ID: 196\n :\n PC_PHYS_PORT_ID: 285\n ?\n PORT_ID: 198\n :\n PC_PHYS_PORT_ID: 289\n ?\n PORT_ID: 202\n :\n PC_PHYS_PORT_ID: 293\n ?\n PORT_ID: 206\n :\n PC_PHYS_PORT_ID: 297\n ?\n PORT_ID: 207\n :\n PC_PHYS_PORT_ID: 301\n ?\n PORT_ID: 209\n :\n PC_PHYS_PORT_ID: 305\n ?\n PORT_ID: 213\n :\n PC_PHYS_PORT_ID: 309\n ?\n PORT_ID: 217\n :\n PC_PHYS_PORT_ID: 313\n ?\n PORT_ID: 218\n :\n PC_PHYS_PORT_ID: 317\n ?\n PORT_ID: 220\n :\n PC_PHYS_PORT_ID: 321\n ?\n PORT_ID: 224\n :\n PC_PHYS_PORT_ID: 325\n ?\n PORT_ID: 228\n :\n PC_PHYS_PORT_ID: 329\n ?\n PORT_ID: 229\n :\n PC_PHYS_PORT_ID: 333\n ?\n PORT_ID: 231\n :\n PC_PHYS_PORT_ID: 337\n ?\n PORT_ID: 235\n :\n PC_PHYS_PORT_ID: 341\n ?\n PORT_ID: 239\n :\n PC_PHYS_PORT_ID: 345\n ?\n PORT_ID: 240\n :\n PC_PHYS_PORT_ID: 349\n ?\n PORT_ID: 242\n :\n PC_PHYS_PORT_ID: 353\n ?\n PORT_ID: 246\n :\n PC_PHYS_PORT_ID: 357\n ?\n PORT_ID: 250\n :\n PC_PHYS_PORT_ID: 361\n ?\n PORT_ID: 251\n :\n PC_PHYS_PORT_ID: 365\n ?\n PORT_ID: 253\n :\n PC_PHYS_PORT_ID: 369\n ?\n PORT_ID: 257\n :\n PC_PHYS_PORT_ID: 373\n ?\n PORT_ID: 261\n :\n PC_PHYS_PORT_ID: 377\n ?\n PORT_ID: 262\n :\n PC_PHYS_PORT_ID: 381\n ?\n PORT_ID: 264\n :\n PC_PHYS_PORT_ID: 385\n ?\n PORT_ID: 268\n :\n PC_PHYS_PORT_ID: 389\n ?\n PORT_ID: 272\n :\n PC_PHYS_PORT_ID: 393\n ?\n PORT_ID: 273\n :\n PC_PHYS_PORT_ID: 397\n ?\n PORT_ID: 275\n :\n PC_PHYS_PORT_ID: 401\n ?\n PORT_ID: 279\n :\n PC_PHYS_PORT_ID: 405\n ?\n PORT_ID: 283\n :\n PC_PHYS_PORT_ID: 409\n ?\n PORT_ID: 284\n :\n PC_PHYS_PORT_ID: 413\n ?\n PORT_ID: 286\n :\n PC_PHYS_PORT_ID: 417\n ?\n PORT_ID: 290\n :\n PC_PHYS_PORT_ID: 421\n ?\n PORT_ID: 294\n :\n PC_PHYS_PORT_ID: 425\n ?\n PORT_ID: 295\n :\n PC_PHYS_PORT_ID: 429\n ?\n PORT_ID: 297\n :\n PC_PHYS_PORT_ID: 433\n ?\n PORT_ID: 301\n :\n PC_PHYS_PORT_ID: 437\n ?\n PORT_ID: 305\n :\n PC_PHYS_PORT_ID: 441\n ?\n PORT_ID: 306\n :\n PC_PHYS_PORT_ID: 445\n ?\n PORT_ID: 308\n :\n PC_PHYS_PORT_ID: 449\n ?\n PORT_ID: 312\n :\n PC_PHYS_PORT_ID: 453\n ?\n PORT_ID: 316\n :\n PC_PHYS_PORT_ID: 457\n ?\n PORT_ID: 317\n :\n PC_PHYS_PORT_ID: 461\n ?\n PORT_ID: 319\n :\n PC_PHYS_PORT_ID: 465\n ?\n PORT_ID: 323\n :\n PC_PHYS_PORT_ID: 469\n ?\n PORT_ID: 327\n :\n PC_PHYS_PORT_ID: 473\n ?\n PORT_ID: 328\n :\n PC_PHYS_PORT_ID: 477\n ?\n PORT_ID: 330\n :\n PC_PHYS_PORT_ID: 481\n ?\n PORT_ID: 334\n :\n PC_PHYS_PORT_ID: 485\n ?\n PORT_ID: 338\n :\n PC_PHYS_PORT_ID: 489\n ?\n PORT_ID: 339\n :\n PC_PHYS_PORT_ID: 493\n ?\n PORT_ID: 341\n :\n PC_PHYS_PORT_ID: 497\n ?\n PORT_ID: 345\n :\n PC_PHYS_PORT_ID: 501\n ?\n PORT_ID: 349\n :\n PC_PHYS_PORT_ID: 505\n ?\n PORT_ID: 350\n :\n PC_PHYS_PORT_ID: 509\n ?\n PORT_ID: 0\n :\n PC_PHYS_PORT_ID: 0\n ?\n PORT_ID: 76\n :\n PC_PHYS_PORT_ID: 513\n...\n---\ndevice:\n 0:\n PC_PORT:\n ?\n PORT_ID: 0\n :\n ENABLE: 1\n SPEED: 10000\n NUM_LANES: 1\n ?\n PORT_ID: [[1, 1], [5, 5], [9, 9], [10, 10], [11, 11], [15, 15], [19, 19],\n [20, 20], [22, 22], [26, 26], [30, 30], [31, 31], [33, 33], [37, 37], [41,\n 41], [42, 42], [44, 44], [48, 48], [52, 52], [53, 53], [55, 55], [59, 59],\n [63, 63], [64, 64], [66, 66], [70, 70], [74, 74], [75, 75], [77, 77], [81,\n 81], [85, 85], [86, 86], [88, 88], [92, 92], [96, 96], [97, 97], [99, 99],\n [103, 103], [107, 107], [108, 108], [110, 110], [114, 114], [118, 118], [119,\n 119], [121, 121], [125, 125], [129, 129], [130, 130], [132, 132], [136, 136],\n [140, 140], [141, 141], [143, 143], [147, 147], [151, 151], [152, 152], [154,\n 154], [158, 158], [162, 162], [163, 163], [165, 165], [169, 169], [173, 173],\n [174, 174], [176, 176], [180, 180], [184, 184], [185, 185], [187, 187], [191,\n 191], [195, 195], [196, 196], [198, 198], [202, 202], [206, 206], [207, 207],\n [209, 209], [213, 213], [217, 217], [218, 218], [220, 220], [224, 224], [228,\n 228], [229, 229], [231, 231], [235, 235], [239, 239], [240, 240], [242, 242],\n [246, 246], [250, 250], [251, 251], [253, 253], [257, 257], [261, 261], [262,\n 262], [264, 264], [268, 268], [272, 272], [273, 273], [275, 275], [279, 279],\n [283, 283], [284, 284], [286, 286], [290, 290], [294, 294], [295, 295], [297,\n 297], [301, 301], [305, 305], [306, 306], [308, 308], [312, 312], [316, 316],\n [317, 317], [319, 319], [323, 323], [327, 327], [328, 328], [330, 330], [334,\n 334], [338, 338], [339, 339], [341, 341], [345, 345], [349, 349], [350, 350]]\n :\n ENABLE: 0\n SPEED: 400000\n NUM_LANES: 4\n FEC_MODE: PC_FEC_RS544_2XN\n MAX_FRAME_SIZE: 9416\n ?\n PORT_ID: 76\n :\n ENABLE: 0\n SPEED: 100000\n NUM_LANES: 4\n FEC_MODE: PC_FEC_RS528\n MAX_FRAME_SIZE: 9416\n...\n---\ndevice:\n 0:\n PORT_CONFIG:\n PORT_SYSTEM_PROFILE_OPERMODE_PIPEUNIQUE: 1\n...\n---\nbcm_device:\n 0:\n global:\n l3_alpm_template: 1\n l3_alpm_hit_mode: 1\n ipv6_lpm_128b_enable: 1\n pktio_driver_type: 1\n qos_map_multi_get_mode: 1\n rx_cosq_mapping_management_mode: 0\n l3_iif_reservation_skip: 0\n pcie_host_intf_timeout_purge_enable: 0\n macro_flow_hash_shuffle_random_seed: 34345645\n bcm_linkscan_interval: 25000\n sai_common_hash_crc: 0x1\n sai_disable_srcmacqedstmac_ctrl: 0x1\n sai_acl_qset_optimization: 0x1\n sai_optimized_mmu: 0x1\n sai_pkt_rx_custom_cfg: 1\n sai_pkt_rx_pkt_size: 16512\n sai_pkt_rx_cfg_ppc: 16\n sai_async_fdb_nbr_enable: 0x1\n sai_pfc_defaults_disable: 0x1\n sai_ifp_enable_on_cpu_tx: 0x1\n sai_vfp_smac_drop_filter_disable: 1\n sai_macro_flow_based_hash: 1\n sai_mmu_qgroups_default: 1\n sai_dis_ctr_incr_on_port_ln_dn: 0\n custom_feature_mesh_topology_sync_mode: 1\n sai_ecmp_group_members_increment: 1\n sai_field_group_auto_prioritize: 1\n bcm_tunnel_term_compatible_mode: 1\n sai_l2_cpu_fdb_event_suppress: 1\n sai_port_phy_time_sync_en: 1\n sai_stats_support_mask: 0x802\n sai_disable_internal_port_serdes: 1\n stat_custom_receive0_management_mode: 1\n sai_stats_disable_mask: 0x800\n global_flexctr_ing_action_num_reserved: 20\n global_flexctr_ing_pool_num_reserved: 8\n global_flexctr_ing_op_profile_num_reserved: 20\n global_flexctr_ing_group_num_reserved: 2\n global_flexctr_egr_action_num_reserved: 8\n global_flexctr_egr_pool_num_reserved: 5\n global_flexctr_egr_op_profile_num_reserved: 10\n global_flexctr_egr_group_num_reserved: 1\n sai_uncached_port_stats: 0x1\n ecmp_dlb_port_speeds: 1\n l3_ecmp_member_secondary_mem_size: 4096\n sai_rdma_udf_disable: 1\n sai_l3_byte1_udf_disable: 1\n...\n---\ndevice:\n 0:\n TM_THD_CONFIG:\n THRESHOLD_MODE: LOSSY\n...\n---\ndevice:\n 0:\n PORT:\n ?\n PORT_ID: [[1, 1], [5, 5], [9, 9], [10, 10], [11, 11], [15, 15], [19, 19],\n [20, 20], [22, 22], [26, 26], [30, 30], [31, 31], [33, 33], [37, 37], [41,\n 41], [42, 42], [44, 44], [48, 48], [52, 52], [53, 53], [55, 55], [59, 59],\n [63, 63], [64, 64], [66, 66], [70, 70], [74, 74], [75, 75], [77, 77], [81,\n 81], [85, 85], [86, 86], [88, 88], [92, 92], [96, 96], [97, 97], [99, 99],\n [103, 103], [107, 107], [108, 108], [110, 110], [114, 114], [118, 118], [119,\n 119], [121, 121], [125, 125], [129, 129], [130, 130], [132, 132], [136, 136],\n [140, 140], [141, 141], [143, 143], [147, 147], [151, 151], [152, 152], [154,\n 154], [158, 158], [162, 162], [163, 163], [165, 165], [169, 169], [173, 173],\n [174, 174], [176, 176], [180, 180], [184, 184], [185, 185], [187, 187], [191,\n 191], [195, 195], [196, 196], [198, 198], [202, 202], [206, 206], [207, 207],\n [209, 209], [213, 213], [217, 217], [218, 218], [220, 220], [224, 224], [228,\n 228], [229, 229], [231, 231], [235, 235], [239, 239], [240, 240], [242, 242],\n [246, 246], [250, 250], [251, 251], [253, 253], [257, 257], [261, 261], [262,\n 262], [264, 264], [268, 268], [272, 272], [273, 273], [275, 275], [279, 279],\n [283, 283], [284, 284], [286, 286], [290, 290], [294, 294], [295, 295], [297,\n 297], [301, 301], [305, 305], [306, 306], [308, 308], [312, 312], [316, 316],\n [317, 317], [319, 319], [323, 323], [327, 327], [328, 328], [330, 330], [334,\n 334], [338, 338], [339, 339], [341, 341], [345, 345], [349, 349], [350, 350]]\n :\n MTU: 9416\n MTU_CHECK: 1\n...\n---\ndevice:\n 0:\n DEVICE_CONFIG:\n AUTOLOAD_BOARD_SETTINGS: 0\n CORE_CLK_FREQ: CLK_1125MHZ\n PP_CLK_FREQ: CLK_675MHZ\n...\n---\ndevice:\n 0:\n FP_CONFIG:\n FP_ING_OPERMODE: GLOBAL_PIPE_AWARE\n...\n---\ndevice:\n 0:\n CTR_EFLEX_CONFIG:\n CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 1\n CTR_ING_EFLEX_OPERMODE_PIPE_INSTANCE_UNIQUE: 1\n CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 1\n CTR_EGR_EFLEX_OPERMODE_PIPE_INSTANCE_UNIQUE: 1\n...\n" + } + } + } + }, + "thriftApiToRateLimitInQps": { + + } +} diff --git a/fboss/oss/scripts/run_configs/default_configs/montblanc/qsfp.conf b/fboss/oss/scripts/run_configs/default_configs/montblanc/qsfp.conf new file mode 100644 index 0000000000000..428b185003bd0 --- /dev/null +++ b/fboss/oss/scripts/run_configs/default_configs/montblanc/qsfp.conf @@ -0,0 +1,478 @@ +{ + "defaultCommandLineArgs": { + "firmware_upgrade_on_coldboot": "true", + "firmware_upgrade_on_link_down": "false", + "firmware_upgrade_on_tcvr_insert": "true", + "firmware_upgrade_supported": "true", + "mode": "montblanc", + "remediation_enabled": "false" + }, + "transceiverConfigOverrides": [ + ], + "qsfpTestConfig": { + "cabledPortPairs": [ + ] + }, + "transceiverFirmwareVersions": { + "versionsMap": { + "EOLO-138HG-5H-1B": { + "versions": [ + { + "fwType": 1, + "version": "3.5" + } + ] + }, + "EOLO-138HG-5H-1T": { + "versions": [ + { + "fwType": 1, + "version": "3.5" + } + ] + }, + "EOLO-138HG-5H-3B": { + "versions": [ + { + "fwType": 1, + "version": "3.5" + } + ] + }, + "EOLO-138HG-5H-3T": { + "versions": [ + { + "fwType": 1, + "version": "3.5" + } + ] + }, + "EOLO-138HG-5H-B": { + "versions": [ + { + "fwType": 1, + "version": "3.5" + } + ] + }, + "EOLO-138HG-5H-T": { + "versions": [ + { + "fwType": 1, + "version": "3.5" + } + ] + }, + "EOLO-13T-5H-1T": { + "versions": [ + { + "fwType": 1, + "version": "3.1" + } + ] + }, + "EOLO-13T-5H-SDR1": { + "versions": [ + { + "fwType": 1, + "version": "3.1" + } + ] + }, + "EOLO-168HG-02-1B": { + "versions": [ + { + "fwType": 1, + "version": "3.12" + } + ] + }, + "EOLO-168HG-02-1T": { + "versions": [ + { + "fwType": 1, + "version": "3.12" + } + ] + }, + "EOLO-168HG-02-9B": { + "versions": [ + { + "fwType": 1, + "version": "3.12" + } + ] + }, + "EOLO-168HG-02-9T": { + "versions": [ + { + "fwType": 1, + "version": "3.12" + } + ] + }, + "EOLO-168HG-10-1B": { + "versions": [ + { + "fwType": 1, + "version": "3.0" + } + ] + }, + "EOLO-168HG-10-1T": { + "versions": [ + { + "fwType": 1, + "version": "3.0" + } + ] + }, + "EOLO-168HG-10-2B": { + "versions": [ + { + "fwType": 1, + "version": "3.0" + } + ] + }, + "EOLO-168HG-10-2T": { + "versions": [ + { + "fwType": 1, + "version": "3.0" + } + ] + }, + "EOLO-168HG-5H-4B": { + "versions": [ + { + "fwType": 1, + "version": "3.4" + } + ] + }, + "EOLO-168HG-5H-4T": { + "versions": [ + { + "fwType": 1, + "version": "3.4" + } + ] + }, + "EOLO-168HG-5H-8B": { + "versions": [ + { + "fwType": 1, + "version": "3.4" + } + ] + }, + "EOLO-168HG-5H-8T": { + "versions": [ + { + "fwType": 1, + "version": "3.4" + } + ] + }, + "FTCD4313E2PCL-FB": { + "versions": [ + { + "fwType": 1, + "version": "2.19" + } + ] + }, + "FTCD4313E2PCLFBC": { + "versions": [ + { + "fwType": 1, + "version": "3.5" + } + ] + }, + "FTCD4313E2PCLFBE": { + "versions": [ + { + "fwType": 1, + "version": "3.5" + } + ] + }, + "FTCE2707E1PCB-FB": { + "versions": [ + { + "fwType": 1, + "version": "2.11" + } + ] + }, + "FTCE4717E1PCB-FB": { + "versions": [ + { + "fwType": 1, + "version": "1.16" + } + ] + }, + "FTCE4717E1PCBFB1": { + "versions": [ + { + "fwType": 1, + "version": "1.16" + } + ] + }, + "FTCE4717E1PCBFB3": { + "versions": [ + { + "fwType": 1, + "version": "1.16" + } + ] + }, + "FTCF2519E3PCA-FB": { + "versions": [ + { + "fwType": 1, + "version": "2.4" + } + ] + }, + "QDD-400G-XDR4": { + "versions": [ + { + "fwType": 1, + "version": "14.3" + }, + { + "fwType": 2, + "version": "209.7" + } + ] + }, + "SPTSHP3CLCK2": { + "versions": [ + { + "fwType": 1, + "version": "1.1" + } + ] + }, + "SPTSHP3CLCKS": { + "versions": [ + { + "fwType": 1, + "version": "2.6" + } + ] + }, + "T-DQ4CNT-NF2": { + "versions": [ + { + "fwType": 1, + "version": "234.147" + } + ] + }, + "T-DQ4CNT-NFB": { + "versions": [ + { + "fwType": 1, + "version": "234.147" + } + ] + }, + "T-DQ4CNT-NFM": { + "versions": [ + { + "fwType": 1, + "version": "234.147" + } + ] + }, + "T-FX4FNT-HF4": { + "versions": [ + { + "fwType": 1, + "version": "7.146" + } + ] + }, + "T-FX4FNT-HF5": { + "versions": [ + { + "fwType": 1, + "version": "7.146" + } + ] + }, + "T-FX4FNT-HF9": { + "versions": [ + { + "fwType": 1, + "version": "106.1" + } + ] + }, + "T-FX4FNT-HFE": { + "versions": [ + { + "fwType": 1, + "version": "106.1" + } + ] + }, + "T-FX4FNT-HFP": { + "versions": [ + { + "fwType": 1, + "version": "7.146" + } + ] + }, + "T-FX4FNT-HFS": { + "versions": [ + { + "fwType": 1, + "version": "7.146" + } + ] + }, + "T-FX4FNT-HFU": { + "versions": [ + { + "fwType": 1, + "version": "106.1" + } + ] + }, + "T-FX4FNT-HFV": { + "versions": [ + { + "fwType": 1, + "version": "106.1" + } + ] + }, + "T-OH8CNH-NFB": { + "versions": [ + { + "fwType": 1, + "version": "36.197" + } + ] + }, + "T-OH8CNH-NFL": { + "versions": [ + { + "fwType": 1, + "version": "36.197" + } + ] + }, + "T-OH8CNH-NFM": { + "versions": [ + { + "fwType": 1, + "version": "36.197" + } + ] + }, + "T-OL8CNH-NFL": { + "versions": [ + { + "fwType": 1, + "version": "114.149" + } + ] + }, + "T-OL8CNH-NFM": { + "versions": [ + { + "fwType": 1, + "version": "114.149" + } + ] + }, + "T-OL8CNL-NFL": { + "versions": [ + { + "fwType": 1, + "version": "114.149" + } + ] + }, + "T-OL8CNL-NFM": { + "versions": [ + { + "fwType": 1, + "version": "114.149" + } + ] + }, + "T-OL8CNL-NFY": { + "versions": [ + { + "fwType": 1, + "version": "114.149" + } + ] + }, + "T-OL8CNT-NF2": { + "versions": [ + { + "fwType": 1, + "version": "103.137" + } + ] + }, + "T-OL8CNT-NFB": { + "versions": [ + { + "fwType": 1, + "version": "103.137" + } + ] + }, + "T-OL8CNT-NFL": { + "versions": [ + { + "fwType": 1, + "version": "103.137" + } + ] + }, + "T-OL8CNT-NFM": { + "versions": [ + { + "fwType": 1, + "version": "103.137" + } + ] + }, + "T-RH8ENH-N00": { + "versions": [ + { + "fwType": 1, + "version": "86.245" + } + ] + }, + "T-RH8ENH-NFM": { + "versions": [ + { + "fwType": 1, + "version": "86.245" + } + ] + } + } + }, + "transceiverI2cLogging": { + "writeLog": true, + "readLog": true, + "disableOnFail": false, + "bufferSlots": 20480 + } +} From 9d2fe511363b3471035e6b0afc40c26e15253b62 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Thu, 5 Feb 2026 11:26:04 -0800 Subject: [PATCH 4/5] Minor update: changed default config name for minipack3 and product name cleanup improvement --- .../centos-09.0/root_files/usr/local/bin/fboss_init.sh | 2 +- .../default_configs/{montblanc => minipack3}/agent.conf | 0 .../default_configs/{montblanc => minipack3}/qsfp.conf | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename fboss/oss/scripts/run_configs/default_configs/{montblanc => minipack3}/agent.conf (100%) rename fboss/oss/scripts/run_configs/default_configs/{montblanc => minipack3}/qsfp.conf (100%) diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/bin/fboss_init.sh b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/bin/fboss_init.sh index 8855b358c86b8..e6a063c3f0d54 100755 --- a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/bin/fboss_init.sh +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/bin/fboss_init.sh @@ -18,7 +18,7 @@ error() { get_platform_dir() { local platform # convert the platform name to lowercase and delete spaces - platform=$(dmidecode -s system-product-name 2>/dev/null | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]') + platform=$(dmidecode -s system-product-name 2>/dev/null | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]-_') if [[ -z $platform ]]; then error "Failed to get system-product-name from dmidecode" return 1 diff --git a/fboss/oss/scripts/run_configs/default_configs/montblanc/agent.conf b/fboss/oss/scripts/run_configs/default_configs/minipack3/agent.conf similarity index 100% rename from fboss/oss/scripts/run_configs/default_configs/montblanc/agent.conf rename to fboss/oss/scripts/run_configs/default_configs/minipack3/agent.conf diff --git a/fboss/oss/scripts/run_configs/default_configs/montblanc/qsfp.conf b/fboss/oss/scripts/run_configs/default_configs/minipack3/qsfp.conf similarity index 100% rename from fboss/oss/scripts/run_configs/default_configs/montblanc/qsfp.conf rename to fboss/oss/scripts/run_configs/default_configs/minipack3/qsfp.conf From 3e054373abd33077a8499c09a9216b62974d84e6 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Mon, 9 Feb 2026 16:59:46 -0800 Subject: [PATCH 5/5] [Nexthop] Use split sw/hw agents in Distro The mono-mode `wedge_agent` is going to be deprecated 'soon' and it makes more sense to start Distro Image off using the multi-mode split `fboss_sw_agent` and multiple `fboss_hw_agent`s, one per ASIC. This change implements that. Switching to `fboss_sw_agent` is straightforward. Enabling a variable number of `fboss_hw_agent`s is slightly trickier because we need some way to determine the correct number of HW agents to start. We need this to be statically configured so a misbehaving ASIC doesn't go undetected. The way that is solved here is by adding a `num_hw_agents` file to the configurations extracted by fboss_init. As its name implies, it is the number of hardware agents to start on the given platform. The `fboss_init.sh` script will read this file and enable that number of hardware agents. To make the systemd unit dependencies works correctly, all the possible hardware agents are groups under an `fboss_hw_agents.target` target. Here up to 4 HW agents are supported, but that is easily extended. Testing Load the image on a Minipack3. Then verify that: 1. `fboss_sw_agent` is running; `ps -A|grep fboss_sw` 2. `fboss_hw_agent@0` is enabled: `systemctl status fboss_hw_agent@0.service` 3. `fboss_hw_agent@1` is disabled: `systemctl status fboss_hw_agent@1.service` Unfortunately the HW agent crashes on start due to a SAI initialization error. --- .../templates/centos-09.0/config.sh | 4 ++- .../systemd/system/fboss_hw_agent@.service | 34 +++++++++++++++++++ .../lib/systemd/system/fboss_hw_agents.target | 6 ++++ ...e_agent.service => fboss_sw_agent.service} | 9 ++--- .../lib/systemd/system/qsfp_service.service | 2 ++ .../root_files/usr/local/bin/fboss_init.sh | 16 +++++++++ .../default_configs/minipack3/agent.conf | 1 + .../default_configs/minipack3/num_hw_agents | 1 + 8 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_hw_agent@.service create mode 100644 fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_hw_agents.target rename fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/{wedge_agent.service => fboss_sw_agent.service} (78%) create mode 100644 fboss/oss/scripts/run_configs/default_configs/minipack3/num_hw_agents diff --git a/fboss-image/image_builder/templates/centos-09.0/config.sh b/fboss-image/image_builder/templates/centos-09.0/config.sh index 0094cf3060234..4fb7e2c7b2e16 100755 --- a/fboss-image/image_builder/templates/centos-09.0/config.sh +++ b/fboss-image/image_builder/templates/centos-09.0/config.sh @@ -57,6 +57,7 @@ env -i \ # 5. Enable systemd services echo "Enabling FBOSS systemd services..." +systemctl enable fboss_init.service systemctl enable local_rpm_repo.service systemctl enable platform_manager.service systemctl enable data_corral_service.service @@ -64,7 +65,8 @@ systemctl enable fan_service.service systemctl enable sensor_service.service systemctl enable fsdb.service systemctl enable qsfp_service.service -systemctl enable wedge_agent.service +systemctl enable fboss_sw_agent.service +systemctl enable fboss_hw_agents.target # 6. Use system GRUB 2.06 from packages # The grub2-efi-x64 package already provides grubx64.efi with all necessary modules diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_hw_agent@.service b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_hw_agent@.service new file mode 100644 index 0000000000000..9dd97ebdd7de1 --- /dev/null +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_hw_agent@.service @@ -0,0 +1,34 @@ +# /usr/lib/systemd/system/fboss_hw_agent@.service +[Unit] +Description=FBOSS HW Agent %i +PartOf=fboss_hw_agents.target +After=platform_manager.service +After=qsfp_service.service +After=rc-local.service +Wants=fboss_init.service +After=fboss_init.service + +[Service] +Type=simple +LimitNOFILE=10000000 +LimitCORE=32G +MemoryMax=3.75G +MemorySwapMax=0 + +Environment="PATH=/opt/fboss/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" +Environment="LD_LIBRARY_PATH=/opt/fboss/lib" +WorkingDirectory=/opt/fboss +ExecStart=/bin/bash -c 'source /opt/fboss/bin/setup_fboss_env && exec /opt/fboss/bin/fboss_hw_agent-sai_impl --switchIndex %i' + +Restart=always +RestartSec=30 +TimeoutStartSec=180s +TimeoutStopSec=30s + +# Logging to journald +StandardOutput=journal +StandardError=journal +SyslogIdentifier=fboss_hw_agent%i + +[Install] +WantedBy=multi-user.target diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_hw_agents.target b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_hw_agents.target new file mode 100644 index 0000000000000..966a17ec8d553 --- /dev/null +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_hw_agents.target @@ -0,0 +1,6 @@ +[Unit] +Description=FBOSS HW Agents Target +Wants=fboss_hw_agent@0.service fboss_hw_agent@1.service fboss_hw_agent@2.service fboss_hw_agent@3.service + +[Install] +WantedBy=multi-user.target diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/wedge_agent.service b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_sw_agent.service similarity index 78% rename from fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/wedge_agent.service rename to fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_sw_agent.service index 72d89daab8fbe..1afd9595ef362 100644 --- a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/wedge_agent.service +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/fboss_sw_agent.service @@ -1,6 +1,6 @@ -# /usr/lib/systemd/system/wedge_agent.service +# /usr/lib/systemd/system/fboss_sw_agent.service [Unit] -Description=FBOSS Wedge Agent +Description=FBOSS SW Agent After=platform_manager.service After=qsfp_service.service After=rc-local.service @@ -17,16 +17,17 @@ MemorySwapMax=0 Environment="PATH=/opt/fboss/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" Environment="LD_LIBRARY_PATH=/opt/fboss/lib" WorkingDirectory=/opt/fboss -ExecStart=/bin/bash -c 'source /opt/fboss/bin/setup_fboss_env && exec /opt/fboss/bin/wedge_agent-sai_impl' +ExecStart=/bin/bash -c 'source /opt/fboss/bin/setup_fboss_env && exec /opt/fboss/bin/fboss_sw_agent' Restart=always RestartSec=30 TimeoutStartSec=180s +TimeoutStopSec=30s # Logging to journald StandardOutput=journal StandardError=journal -SyslogIdentifier=wedge_agent +SyslogIdentifier=fboss_sw_agent [Install] WantedBy=multi-user.target diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/qsfp_service.service b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/qsfp_service.service index d4f98eb37c49d..ec38aa242a868 100644 --- a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/qsfp_service.service +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/lib/systemd/system/qsfp_service.service @@ -3,6 +3,8 @@ Description=FBOSS QSFP Service After=platform_manager.service After=rc-local.service +Wants=fboss_init.service +After=fboss_init.service StartLimitIntervalSec=600 StartLimitBurst=5 diff --git a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/bin/fboss_init.sh b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/bin/fboss_init.sh index e6a063c3f0d54..6fdeeec683ae1 100755 --- a/fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/bin/fboss_init.sh +++ b/fboss-image/image_builder/templates/centos-09.0/root_files/usr/local/bin/fboss_init.sh @@ -76,6 +76,21 @@ setup_coop_configs() { copy_config "${platform_dir}/qsfp.conf" "${COOP_DIR}/qsfp.conf" "qsfp.conf" } +enable_hw_agents() { + local platform_dir="$1" + local num_hw_agents + if [ ! -f "${platform_dir}/num_hw_agents" ]; then + num_hw_agents=1 + else + num_hw_agents=$(cat "${platform_dir}/num_hw_agents") + fi + for i in $(seq ${num_hw_agents}); do + systemctl enable "fboss_hw_agent@$((i - 1)).service" + # Calling systemctl start inside a starting systemd service deadlocks + systemctl start "fboss_hw_agent@$((i - 1)).service" & + done +} + main() { log "Starting FBOSS initialization" @@ -86,6 +101,7 @@ main() { setup_coop_configs "$platform_dir" generate_fruid + enable_hw_agents "$platform_dir" log "FBOSS initialization complete" } diff --git a/fboss/oss/scripts/run_configs/default_configs/minipack3/agent.conf b/fboss/oss/scripts/run_configs/default_configs/minipack3/agent.conf index 4a9b33e77c523..02460680756ef 100644 --- a/fboss/oss/scripts/run_configs/default_configs/minipack3/agent.conf +++ b/fboss/oss/scripts/run_configs/default_configs/minipack3/agent.conf @@ -4,6 +4,7 @@ "counter_refresh_interval": "0", "enable_acl_table_group": "true", "log_variable_name": "true", + "multi_switch": "true", "sai_configure_six_tap": "true", "skip_transceiver_programming": "true", "use_full_dlb_scale": "true" diff --git a/fboss/oss/scripts/run_configs/default_configs/minipack3/num_hw_agents b/fboss/oss/scripts/run_configs/default_configs/minipack3/num_hw_agents new file mode 100644 index 0000000000000..d00491fd7e5bb --- /dev/null +++ b/fboss/oss/scripts/run_configs/default_configs/minipack3/num_hw_agents @@ -0,0 +1 @@ +1