Skip to content

Commit

Permalink
Mellanox bullseye merge (#1)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexrallen authored and saiarcot895 committed Nov 10, 2021
1 parent 1379ca1 commit 2847265
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions platform/mellanox/docker-syncd-mlnx.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand All @@ -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)
6 changes: 3 additions & 3 deletions platform/mellanox/fw.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion platform/mellanox/hw-management.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion platform/mellanox/hw-management/hw-mgmt
Submodule hw-mgmt updated 201 files
5 changes: 0 additions & 5 deletions platform/mellanox/issu-version.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions platform/mellanox/issu-version/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ 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) || {
echo "ISSU version is undefined: $(sx_sdk --version)"
rm $(DEST)/$(MAIN_TARGET)
exit 1
}
cp $(DEST)/$(MAIN_TARGET) $(BULLSEYE_FILES_PATH)/$(MAIN_TARGET)
9 changes: 4 additions & 5 deletions platform/mellanox/mft.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
4 changes: 1 addition & 3 deletions platform/mellanox/mft/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions platform/mellanox/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers
2 changes: 1 addition & 1 deletion platform/mellanox/sdk.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
4 changes: 4 additions & 0 deletions sonic-slave-buster/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 2847265

Please sign in to comment.