Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Mellanox]Support buster #35

Closed
wants to merge 12 commits into from
3 changes: 2 additions & 1 deletion build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in
ndisc6 \
makedumpfile \
conntrack \
cron
cron \
haveged


if [[ $CONFIGURED_ARCH == amd64 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def get_transceiver_change_event(self, timeout=0):
from swsscommon import swsscommon
self.state_db = swsscommon.DBConnector("STATE_DB",
REDIS_TIMEOUT_USECS,
True))
True)

# Subscribe to state table for SFP change notifications
self.db_sel = swsscommon.Select()
Expand Down
9 changes: 8 additions & 1 deletion files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,14 @@ sudo chmod a+x $FILESYSTEM_ROOT/usr/sbin/policy-rc.d
{% if installer_debs.strip() -%}
{% for deb in installer_debs.strip().split(' ') -%}
{% if sonic_asic_platform == "mellanox" %}
sudo dpkg --extract {{deb}} $FILESYSTEM_ROOT
if [ -e tmpdir ] ;
then
rm -rf tmpdir;
fi
sudo mkdir tmpdir
sudo dpkg --extract {{deb}} tmpdir
for subdir in $(ls tmpdir) ; do sudo cp -R tmpdir/$subdir/* $FILESYSTEM_ROOT/$subdir; done
sudo rm -rf tmpdir
{% else %}
sudo dpkg --root=$FILESYSTEM_ROOT -i {{deb}} || sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions files/image_config/misc/docker-wait-any
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import sys
import threading
from docker import Client
from docker import APIClient

# Instantiate a global event to share among our threads
g_thread_exit_event = threading.Event()
Expand All @@ -40,7 +40,7 @@ def wait_for_container(docker_client, container_name):
def main():
thread_list = []

docker_client = Client(base_url='unix://var/run/docker.sock')
docker_client = APIClient(base_url='unix://var/run/docker.sock')

# Ensure we were passed at least one argument
if len(sys.argv) < 2:
Expand Down
20 changes: 16 additions & 4 deletions platform/mellanox/fw.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,36 @@ else
FW_FROM_URL = n
endif

MLNX_SPC_FW_VERSION = 13.2000.2720
MLNX_SPC_FW_VERSION = 13.2007.0322
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.2000.2720
MLNX_SPC2_FW_VERSION = 29.2007.0322
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.2007.0322
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)

MLNX_FW_FILES = $(MLNX_SPC_FW_FILE) $(MLNX_SPC2_FW_FILE) $(MLNX_SPC3_FW_FILE)

ifeq ($(FW_FROM_URL),n)
SONIC_COPY_FILES += $(MLNX_SPC_FW_FILE) $(MLNX_SPC2_FW_FILE)
SONIC_COPY_FILES += $(MLNX_FW_FILES)
else
SONIC_ONLINE_FILES += $(MLNX_SPC_FW_FILE) $(MLNX_SPC2_FW_FILE)
SONIC_ONLINE_FILES += $(MLNX_FW_FILES)
endif

export MLNX_SPC_FW_VERSION
export MLNX_SPC_FW_FILE

export MLNX_SPC2_FW_VERSION
export MLNX_SPC2_FW_FILE

export MLNX_SPC3_FW_VERSION
export MLNX_SPC3_FW_FILE

export MLNX_FW_FILES
4 changes: 1 addition & 3 deletions platform/mellanox/hw-management.mk
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Mellanox HW Management

MLNX_HW_MANAGEMENT_VERSION = 7.0000.2308
MLNX_HW_MANAGEMENT_VERSION = 7.0000.3012

export MLNX_HW_MANAGEMENT_VERSION

MLNX_HW_MANAGEMENT = hw-management_1.mlnx.$(MLNX_HW_MANAGEMENT_VERSION)_amd64.deb
$(MLNX_HW_MANAGEMENT)_SRC_PATH = $(PLATFORM_PATH)/hw-management
$(MLNX_HW_MANAGEMENT)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
SONIC_MAKE_DEBS += $(MLNX_HW_MANAGEMENT)

SONIC_STRETCH_DEBS += $(MLNX_HW_MANAGEMENT)
2 changes: 0 additions & 2 deletions platform/mellanox/mft.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ $(eval $(call add_derived_package,$(MFT),$(KERNEL_MFT)))

MFT_OEM = mft-oem_$(MFT_VERSION)-$(MFT_REVISION)_amd64.deb
$(eval $(call add_derived_package,$(MFT),$(MFT_OEM)))

SONIC_STRETCH_DEBS += $(KERNEL_MFT)
2 changes: 1 addition & 1 deletion platform/mellanox/mft/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :

# fix timestamp because we do not actually build tools, only kernel
touch $(MFT_NAME)/DEBS/*
mv $(MFT_NAME)/SDEBS/ubuntu-drivers/4.9.0/kernel-mft-dkms_$(MFT_VERSION)-$(KVERSION)_all.deb $(MFT_NAME)/DEBS/* $(DEST)
mv $(MFT_NAME)/SDEBS/ubuntu-drivers/4.19.0/kernel-mft-dkms_$(MFT_VERSION)-$(KVERSION)_all.deb $(MFT_NAME)/DEBS/* $(DEST)

$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)
7 changes: 7 additions & 0 deletions platform/mellanox/mlnx-fw-upgrade.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,18 @@ declare -r QUERY_FILE="/tmp/mlxfwmanager-query.log"

declare -r SPC1_ASIC="spc1"
declare -r SPC2_ASIC="spc2"
declare -r SPC3_ASIC="spc3"
declare -r UNKN_ASIC="unknown"

declare -rA FW_FILE_MAP=( \
[$SPC1_ASIC]="/etc/mlnx/fw-SPC.mfa" \
[$SPC2_ASIC]="/etc/mlnx/fw-SPC2.mfa" \
[$SPC3_ASIC]="/etc/mlnx/fw-SPC3.mfa" \
)
declare -rA FW_REQUIRED_MAP=( \
[$SPC1_ASIC]="{{ MLNX_SPC_FW_VERSION }}" \
[$SPC2_ASIC]="{{ MLNX_SPC2_FW_VERSION }}" \
[$SPC3_ASIC]="{{ MLNX_SPC3_FW_VERSION }}" \
)

IMAGE_UPGRADE="${NO_PARAM}"
Expand Down Expand Up @@ -135,13 +138,17 @@ function GetAsicType() {

local -r SPC1_PRODUCT_ID="cb84"
local -r SPC2_PRODUCT_ID="cf6c"
local -r SPC3_PRODUCT_ID="cf70"

if lspci -n | grep "${VENDOR_ID}:${SPC1_PRODUCT_ID}" &>/dev/null; then
echo "${SPC1_ASIC}"
exit "${EXIT_SUCCESS}"
elif lspci -n | grep "${VENDOR_ID}:${SPC2_PRODUCT_ID}" &>/dev/null; then
echo "${SPC2_ASIC}"
exit "${EXIT_SUCCESS}"
elif lspci -n | grep "${VENDOR_ID}:${SPC3_PRODUCT_ID}" &>/dev/null; then
echo "${SPC3_ASIC}"
exit "${EXIT_SUCCESS}"
fi

echo "${UNKN_ASIC}"
Expand Down
2 changes: 1 addition & 1 deletion platform/mellanox/mlnx-sai.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mellanox SAI

MLNX_SAI_VERSION = SAIRel1.15.5-master
MLNX_SAI_VERSION = SAIRel1.16.1-master

export MLNX_SAI_VERSION

Expand Down
2 changes: 1 addition & 1 deletion platform/mellanox/mlnx-sai/SAI-Implementation
Submodule SAI-Implementation updated 41 files
+2 −2 README.md
+1 −1 mlnx_sai/debian/changelog
+78 −8 mlnx_sai/inc/mlnx_sai.h
+2 −0 mlnx_sai/mlnx_sai.vcxproj
+6 −0 mlnx_sai/mlnx_sai.vcxproj.filters
+11 −3 mlnx_sai/src/Makefile.am
+0 −4 mlnx_sai/src/dbgdump/mlnx_sai_dbg_acl.c
+143 −0 mlnx_sai/src/dbgdump/mlnx_sai_dbg_bfd.c
+9 −11 mlnx_sai/src/dbgdump/mlnx_sai_dbg_debug_counter.c
+4 −4 mlnx_sai/src/dbgdump/mlnx_sai_dbg_hash.c
+1 −1 mlnx_sai/src/dbgdump/mlnx_sai_dbg_mirror.c
+12 −6 mlnx_sai/src/dbgdump/mlnx_sai_dbg_port.c
+4 −4 mlnx_sai/src/dbgdump/mlnx_sai_dbg_tunnel.c
+3 −3 mlnx_sai/src/fx_base_api.c
+427 −402 mlnx_sai/src/mlnx_sai_acl.c
+1,367 −0 mlnx_sai/src/mlnx_sai_bfd.c
+11 −67 mlnx_sai/src/mlnx_sai_bmtor.c
+8 −7 mlnx_sai/src/mlnx_sai_bridge.c
+70 −33 mlnx_sai/src/mlnx_sai_buffer.c
+292 −235 mlnx_sai/src/mlnx_sai_debug_counter.c
+33 −33 mlnx_sai/src/mlnx_sai_hash.c
+32 −19 mlnx_sai/src/mlnx_sai_host_interface.c
+30 −13 mlnx_sai/src/mlnx_sai_interfacequery.c
+51 −34 mlnx_sai/src/mlnx_sai_lag.c
+9 −10 mlnx_sai/src/mlnx_sai_mirror.c
+4 −4 mlnx_sai/src/mlnx_sai_neighbor.c
+7 −8 mlnx_sai/src/mlnx_sai_object.c
+70 −23 mlnx_sai/src/mlnx_sai_policer.c
+1,007 −414 mlnx_sai/src/mlnx_sai_port.c
+8 −11 mlnx_sai/src/mlnx_sai_rif.c
+1 −1 mlnx_sai/src/mlnx_sai_scheduler.c
+619 −77 mlnx_sai/src/mlnx_sai_switch.c
+164 −122 mlnx_sai/src/mlnx_sai_tunnel.c
+76 −12 mlnx_sai/src/mlnx_sai_utils.c
+244 −0 mlnx_sai/src/sai_4700.xml
+244 −0 mlnx_sai/src/sai_4700_100G.xml
+244 −0 mlnx_sai/src/sai_4700_1G.xml
+34 −0 mlnx_sai/src/sai_4700_pld.xml
+48 −0 mlnx_sai/src/sai_4700_pld_4.xml
+468 −0 mlnx_sai/src/sai_4800.xml
+17 −6 release notes.txt
2 changes: 1 addition & 1 deletion platform/mellanox/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ $(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.g
else
$(SONIC_ONE_IMAGE)_DOCKERS = $(SONIC_INSTALL_DOCKER_IMAGES)
endif
$(SONIC_ONE_IMAGE)_FILES += $(MLNX_SPC_FW_FILE) $(MLNX_SPC2_FW_FILE) $(MLNX_FFB_SCRIPT) $(ISSU_VERSION_FILE) $(ONIE_FW_UPDATE)
$(SONIC_ONE_IMAGE)_FILES += $(MLNX_FW_FILES) $(MLNX_FFB_SCRIPT) $(ISSU_VERSION_FILE) $(ONIE_FW_UPDATE)
SONIC_INSTALLERS += $(SONIC_ONE_IMAGE)
3 changes: 0 additions & 3 deletions platform/mellanox/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ $(SYNCD)_RDEPENDS += $(MLNX_SAI)

# Inject mlnx sdk libs to platform monitor
$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(APPLIBS) $(SX_COMPLIB) $(SXD_LIBS) $(SX_GEN_UTILS) $(PYTHON_SDK_API) $(APPLIBS_DEV) $(SX_COMPLIB_DEV) $(SXD_LIBS_DEV) $(SX_GEN_UTILS_DEV)

# Inject mlnx mlx libs to platform monitor
$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(MFT)
2 changes: 1 addition & 1 deletion platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers
4 changes: 1 addition & 3 deletions platform/mellanox/sdk.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MLNX_SDK_BASE_PATH = $(PLATFORM_PATH)/sdk-src/sx-kernel/Switch-SDK-drivers/bin/
MLNX_SDK_VERSION = 4.3.2908
MLNX_SDK_VERSION = 4.4.0542
MLNX_SDK_ISSU_VERSION = 101

MLNX_SDK_DEB_VERSION = $(subst _,.,$(MLNX_SDK_VERSION))
Expand Down Expand Up @@ -152,8 +152,6 @@ else
SONIC_COPY_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API)
endif

SONIC_STRETCH_DEBS += $(SX_KERNEL)

mlnx-sdk-packages: $(addprefix $(DEBS_PATH)/, $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) $(SX_KERNEL))

SONIC_PHONY_TARGETS += mlnx-sdk-packages
3 changes: 3 additions & 0 deletions src/python-click/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# which stg doesn't like, so we use this method instead
git reset --hard debian/$(PYTHON_CLICK_VERSION)

stg init
stg import -s ../patch/series

# Build source and Debian packages
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)
popd
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
From 24fe650a982e502d2ec4f169a8045493fbcd55cf Mon Sep 17 00:00:00 2001
From: Stephen Sun <stephens@mellanox.com>
Date: Fri, 20 Mar 2020 20:24:37 +0800
Subject: [PATCH] Don't replace underscore with dash in order to retain
backword compatibility

Signed-off-by: Stephen Sun <stephens@mellanox.com>
---
click/decorators.py | 2 +-
tests/test_commands.py | 4 ++--
tests/test_formatting.py | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/click/decorators.py b/click/decorators.py
index c57c530..6ee331e 100644
--- a/click/decorators.py
+++ b/click/decorators.py
@@ -85,7 +85,7 @@ def _make_command(f, name, attrs, cls):
help = inspect.cleandoc(help)
attrs['help'] = help
_check_for_unicode_literals()
- return cls(name=name or f.__name__.lower().replace('_', '-'),
+ return cls(name=name or f.__name__.lower(),
callback=f, params=params, **attrs)


diff --git a/tests/test_commands.py b/tests/test_commands.py
index 9189eca..190854c 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -64,7 +64,7 @@ def test_auto_shorthelp(runner):
r'Commands:\n\s+'
r'long\s+This is a long text that is too long to show as short help\.\.\.\n\s+'
r'short\s+This is a short text\.\n\s+'
- r'special-chars\s+Login and store the token in ~/.netrc\.\s*',
+ r'special_chars\s+Login and store the token in ~/.netrc\.\s*',
result.output) is not None


@@ -208,7 +208,7 @@ def test_other_command_invoke_with_defaults(runner):
@click.option('--foo', type=click.INT, default=42)
@click.pass_context
def other_cmd(ctx, foo):
- assert ctx.info_name == 'other-cmd'
+ assert ctx.info_name == 'other_cmd'
click.echo(foo)

result = runner.invoke(cli, [])
diff --git a/tests/test_formatting.py b/tests/test_formatting.py
index 2005f98..7894829 100644
--- a/tests/test_formatting.py
+++ b/tests/test_formatting.py
@@ -74,11 +74,11 @@ def test_wrapping_long_options_strings(runner):

# 54 is chosen as a length where the second line is one character
# longer than the maximum length.
- result = runner.invoke(cli, ['a-very-long', 'command', '--help'],
+ result = runner.invoke(cli, ['a_very_long', 'command', '--help'],
terminal_width=54)
assert not result.exception
assert result.output.splitlines() == [
- 'Usage: cli a-very-long command [OPTIONS] FIRST SECOND',
+ 'Usage: cli a_very_long command [OPTIONS] FIRST SECOND',
' THIRD FOURTH FIFTH',
' SIXTH',
'',
@@ -111,11 +111,11 @@ def test_wrapping_long_command_name(runner):
"""A command.
"""

- result = runner.invoke(cli, ['a-very-very-very-long', 'command', '--help'],
+ result = runner.invoke(cli, ['a_very_very_very_long', 'command', '--help'],
terminal_width=54)
assert not result.exception
assert result.output.splitlines() == [
- 'Usage: cli a-very-very-very-long command ',
+ 'Usage: cli a_very_very_very_long command ',
' [OPTIONS] FIRST SECOND THIRD FOURTH FIFTH',
' SIXTH',
'',
--
2.20.1

1 change: 1 addition & 0 deletions src/python-click/patch/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0001-Don-t-replace-underscore-with-dash-in-order-to-retai.patch