From 2847265bfd5e3d13f928998405325760448ebed7 Mon Sep 17 00:00:00 2001 From: Alexander Allen Date: Thu, 28 Oct 2021 20:15:31 -0700 Subject: [PATCH] Mellanox bullseye merge (#1) Allow mellanox platform to build and successfully switch packets in Debian 11 Upgraded * Mellanox SDK * Mellanox Hardware Management * Mellanox Firmware * Mellanox Kernel Patches Adjusted build system to support host system running bullseye and dockers running buster. --- files/build_templates/sonic_debian_extension.j2 | 2 +- platform/mellanox/docker-syncd-mlnx.mk | 3 +++ platform/mellanox/fw.mk | 6 +++--- platform/mellanox/hw-management.mk | 2 +- platform/mellanox/hw-management/hw-mgmt | 2 +- platform/mellanox/issu-version.mk | 5 ----- platform/mellanox/issu-version/Makefile | 2 ++ platform/mellanox/mft.mk | 9 ++++----- platform/mellanox/mft/Makefile | 4 +--- platform/mellanox/rules.mk | 6 ++++++ platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers | 2 +- platform/mellanox/sdk.mk | 2 +- sonic-slave-buster/Dockerfile.j2 | 4 ++++ 13 files changed, 28 insertions(+), 21 deletions(-) diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 674f2186cb77..1f49f751ed69 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -829,7 +829,7 @@ sudo mkdir -p $FILESYSTEM_ROOT/etc/mlnx/ sudo cp $files_path/$MLNX_SPC_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC.mfa sudo cp $files_path/$MLNX_SPC2_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC2.mfa sudo cp $files_path/$MLNX_SPC3_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC3.mfa -#sudo cp $files_path/$ISSU_VERSION_FILE $FILESYSTEM_ROOT/etc/mlnx/issu-version +sudo cp $files_path/$ISSU_VERSION_FILE $FILESYSTEM_ROOT/etc/mlnx/issu-version sudo cp $files_path/$MLNX_FFB_SCRIPT $FILESYSTEM_ROOT/usr/bin/mlnx-ffb.sh sudo cp $files_path/$MLNX_ONIE_FW_UPDATE $FILESYSTEM_ROOT/usr/bin/$MLNX_ONIE_FW_UPDATE sudo cp $files_path/$MLNX_SSD_FW_UPDATE $FILESYSTEM_ROOT/usr/bin/$MLNX_SSD_FW_UPDATE diff --git a/platform/mellanox/docker-syncd-mlnx.mk b/platform/mellanox/docker-syncd-mlnx.mk index f24845655ae7..0377b910be6f 100644 --- a/platform/mellanox/docker-syncd-mlnx.mk +++ b/platform/mellanox/docker-syncd-mlnx.mk @@ -21,6 +21,8 @@ include $(PLATFORM_PATH)/../template/docker-syncd-base.mk $(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(MFT) +$(DOCKER_SYNCD_BASE)_FILES += $(ISSU_VERSION_FILE) + $(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \ $(LIBSWSSCOMMON_DBG) \ $(LIBSAIMETADATA_DBG) \ @@ -34,3 +36,4 @@ $(DOCKER_SYNCD_BASE)_VERSION = 1.0.0 $(DOCKER_SYNCD_BASE)_PACKAGE_NAME = syncd $(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot +SONIC_BUSTER_DOCKERS += $(DOCKER_SYNCD_BASE) diff --git a/platform/mellanox/fw.mk b/platform/mellanox/fw.mk index 58a3f3d1b460..3dab7db0f183 100644 --- a/platform/mellanox/fw.mk +++ b/platform/mellanox/fw.mk @@ -27,17 +27,17 @@ else FW_FROM_URL = n endif -MLNX_SPC_FW_VERSION = 13.2008.3326 +MLNX_SPC_FW_VERSION = 13.2008.3330 MLNX_SPC_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_SPC_FW_VERSION))-EVB.mfa $(MLNX_SPC_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC_FW_FILE) -MLNX_SPC2_FW_VERSION = 29.2008.3326 +MLNX_SPC2_FW_VERSION = 29.2008.3330 MLNX_SPC2_FW_FILE = fw-SPC2-rel-$(subst .,_,$(MLNX_SPC2_FW_VERSION))-EVB.mfa $(MLNX_SPC2_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC2_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC2_FW_FILE) -MLNX_SPC3_FW_VERSION = 30.2008.3326 +MLNX_SPC3_FW_VERSION = 30.2008.3330 MLNX_SPC3_FW_FILE = fw-SPC3-rel-$(subst .,_,$(MLNX_SPC3_FW_VERSION))-EVB.mfa $(MLNX_SPC3_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC3_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC3_FW_FILE) diff --git a/platform/mellanox/hw-management.mk b/platform/mellanox/hw-management.mk index df8886abe06d..7b71c059304b 100644 --- a/platform/mellanox/hw-management.mk +++ b/platform/mellanox/hw-management.mk @@ -16,7 +16,7 @@ # # Mellanox HW Management -MLNX_HW_MANAGEMENT_VERSION = 7.0010.2344 +MLNX_HW_MANAGEMENT_VERSION = 7.0010.3300 export MLNX_HW_MANAGEMENT_VERSION diff --git a/platform/mellanox/hw-management/hw-mgmt b/platform/mellanox/hw-management/hw-mgmt index b661fa329e2d..efbfa1e83d4b 160000 --- a/platform/mellanox/hw-management/hw-mgmt +++ b/platform/mellanox/hw-management/hw-mgmt @@ -1 +1 @@ -Subproject commit b661fa329e2dff4fd6c22da89d009169e1008d99 +Subproject commit efbfa1e83d4bbbad08d80360c343bb3185c786f3 diff --git a/platform/mellanox/issu-version.mk b/platform/mellanox/issu-version.mk index 51a6152495ad..33e512b0089c 100644 --- a/platform/mellanox/issu-version.mk +++ b/platform/mellanox/issu-version.mk @@ -21,9 +21,4 @@ $(ISSU_VERSION_FILE)_SRC_PATH = $(PLATFORM_PATH)/issu-version $(ISSU_VERSION_FILE)_DEPENDS += $(APPLIBS) SONIC_MAKE_FILES += $(ISSU_VERSION_FILE) -# TODO: Disable because the base OS version (bullseye) doesn't match what the -# SDK app packages are built for (buster), and this target assumes that they -# are available. -#MLNX_FILES += $(ISSU_VERSION_FILE) - export ISSU_VERSION_FILE diff --git a/platform/mellanox/issu-version/Makefile b/platform/mellanox/issu-version/Makefile index fbb21af74902..bf749fb3e2ca 100644 --- a/platform/mellanox/issu-version/Makefile +++ b/platform/mellanox/issu-version/Makefile @@ -19,6 +19,7 @@ SHELL = /bin/bash .SHELLFLAGS += -e MAIN_TARGET = issu-version +BULLSEYE_FILES_PATH = /sonic/target/files/bullseye $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : sx_sdk --version | egrep -o 'ISSU [0-9]+' > $(DEST)/$(MAIN_TARGET) || { @@ -26,3 +27,4 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : rm $(DEST)/$(MAIN_TARGET) exit 1 } + cp $(DEST)/$(MAIN_TARGET) $(BULLSEYE_FILES_PATH)/$(MAIN_TARGET) diff --git a/platform/mellanox/mft.mk b/platform/mellanox/mft.mk index 7cc1fda6e117..97d31f8fe46d 100644 --- a/platform/mellanox/mft.mk +++ b/platform/mellanox/mft.mk @@ -23,15 +23,14 @@ export MFT_VERSION MFT_REVISION MFT = mft_$(MFT_VERSION)-$(MFT_REVISION)_amd64.deb $(MFT)_SRC_PATH = $(PLATFORM_PATH)/mft -ifeq ($(DISTRO), bullseye) -$(MFT)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) -endif SONIC_MAKE_DEBS += $(MFT) -ifeq ($(DISTRO), bullseye) +ifeq ($(BLDENV), bullseye) +$(MFT)_DEPENDS = $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +endif + KERNEL_MFT = kernel-mft-dkms-modules-$(KVERSION)_$(MFT_VERSION)_amd64.deb $(eval $(call add_derived_package,$(MFT),$(KERNEL_MFT))) -endif MFT_OEM = mft-oem_$(MFT_VERSION)-$(MFT_REVISION)_amd64.deb $(eval $(call add_derived_package,$(MFT),$(MFT_OEM))) diff --git a/platform/mellanox/mft/Makefile b/platform/mellanox/mft/Makefile index c1798dcc768d..efa791dba1db 100644 --- a/platform/mellanox/mft/Makefile +++ b/platform/mellanox/mft/Makefile @@ -35,7 +35,6 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : wget -O $(MFT_TGZ) http://www.mellanox.com/downloads/MFT/$(MFT_TGZ) tar xzf $(MFT_TGZ) -ifeq ($(DISTRO), bullseye) pushd $(MFT_NAME)/SDEBS # put a lock here because dpkg does not allow installing packages in parallel @@ -47,7 +46,7 @@ ifeq ($(DISTRO), bullseye) popd - sudo dkms build kernel-mft-dkms/$(MFT_VERSION) -k $(KVERSION) -a amd64 + sudo dkms build kernel-mft-dkms/$(MFT_VERSION) -k $(KVERSION) -a amd64 --kernelsourcedir /usr/src/linux-headers-$(KVERSION) sudo dkms mkbmdeb kernel-mft-dkms/$(MFT_VERSION) -k $(KVERSION) -a amd64 # w/a: remove dependencies @@ -63,7 +62,6 @@ ifeq ($(DISTRO), bullseye) popd rm -rf $(DKMS_TMP) -endif # fix timestamp because we do not actually build tools, only kernel touch $(MFT_NAME)/DEBS/*.deb diff --git a/platform/mellanox/rules.mk b/platform/mellanox/rules.mk index be046bed91eb..f4d13abbc180 100644 --- a/platform/mellanox/rules.mk +++ b/platform/mellanox/rules.mk @@ -14,6 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +# Set KVERSION correctly depending on build environment +ifeq ($(BLDENV), buster) +KVERSION = 5.10.0-0.bpo.9-amd64 +endif + include $(PLATFORM_PATH)/sdk.mk include $(PLATFORM_PATH)/fw.mk include $(PLATFORM_PATH)/mft.mk diff --git a/platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers b/platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers index 726bef49c07a..306567c6e89a 160000 --- a/platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers +++ b/platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers @@ -1 +1 @@ -Subproject commit 726bef49c07a1a0d7c52d8e3062e95ec6efa736f +Subproject commit 306567c6e89a94fb61ed0efa2bcb125ee8b162cd diff --git a/platform/mellanox/sdk.mk b/platform/mellanox/sdk.mk index 1e26f53b918c..f2ffa8b3e016 100644 --- a/platform/mellanox/sdk.mk +++ b/platform/mellanox/sdk.mk @@ -16,7 +16,7 @@ # MLNX_SDK_BASE_PATH = $(PLATFORM_PATH)/sdk-src/sx-kernel/Switch-SDK-drivers/bin/ MLNX_SDK_PKG_BASE_PATH = $(MLNX_SDK_BASE_PATH)/$(BLDENV)/ -MLNX_SDK_VERSION = 4.4.3326 +MLNX_SDK_VERSION = 4.4.3334 MLNX_SDK_ISSU_VERSION = 101 MLNX_SDK_DEB_VERSION = $(subst -,.,$(subst _,.,$(MLNX_SDK_VERSION))) diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index 3ac1709d20d2..2c8b144d7d5a 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -153,6 +153,10 @@ RUN apt-get update && apt-get install -y \ # For mellanox sai build libtool-bin \ libxml2-dev \ +# For mellanox MFT build + linux-image-5.10.0-0.bpo.9-amd64 \ + linux-headers-5.10.0-0.bpo.9-amd64 \ + linux-headers-5.10.0-0.bpo.9-common \ # For BFN sdk build libusb-1.0-0-dev \ libcurl3-nss-dev \