Skip to content

Commit 2922f26

Browse files
authored
[Mellanox] Replace iproute2 supplied by SDK to iproute2 downloaded from Debian repository (#14726)
- Why I did it Mellanox syncd container will be based on Debian iproute2 plus patches instead of Nvidia internal version of iproute2 - How I did it Download iproute2 from Debian repository, apply patches and compile to create a new target. The target is then deployed in syncd container of Mellanox switches only. The new target is called IPROUTE2_MLNX. - How to verify it Compile and load on switch, verify interfaces network devices created successfully. Verify LLDP shows connections to neighbors. Verify ping between 2 hosts over 2 router ports is successful.
1 parent 967c198 commit 2922f26

14 files changed

+519
-61
lines changed

platform/mellanox/docker-syncd-mlnx.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
DOCKER_SYNCD_PLATFORM_CODE = mlnx
2020
include $(PLATFORM_PATH)/../template/docker-syncd-bullseye.mk
2121

22-
$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(MFT)
22+
$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(MFT) $(IPROUTE2_MLNX)
2323

2424
ifeq ($(ENABLE_ASAN), y)
2525
$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD_DBG)

platform/mellanox/iproute2.dep

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
SPATH := $($(IPROUTE2_MLNX)_SRC_PATH)
3+
DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/iproute2.mk $(PLATFORM_PATH)/iproute2.dep
4+
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
5+
DEP_FILES += $(shell git ls-files $(SPATH))
6+
7+
$(IPROUTE2_MLNX)_CACHE_MODE := GIT_CONTENT_SHA
8+
$(IPROUTE2_MLNX)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
9+
$(IPROUTE2_MLNX)_DEP_FILES := $(DEP_FILES)
10+

platform/mellanox/iproute2.mk

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
3+
# Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
IPROUTE2_MLNX_VERSION = 5.10.0
19+
IPROUTE2_MLNX_VERSION_FULL = $(IPROUTE2_MLNX_VERSION)-4~bpo10+1
20+
21+
export IPROUTE2_MLNX_VERSION
22+
export IPROUTE2_MLNX_VERSION_FULL
23+
24+
IPROUTE2_MLNX = iproute2-mlnx_$(IPROUTE2_MLNX_VERSION_FULL)_$(CONFIGURED_ARCH).deb
25+
$(IPROUTE2_MLNX)_SRC_PATH = $(PLATFORM_PATH)/iproute2
26+
SONIC_MAKE_DEBS += $(IPROUTE2_MLNX)

platform/mellanox/iproute2/Makefile

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#
2+
# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
3+
# Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
SHELL = /bin/bash
19+
.ONESHELL:
20+
.SHELLFLAGS += -e
21+
22+
MAIN_TARGET = iproute2-mlnx_$(IPROUTE2_MLNX_VERSION_FULL)_$(CONFIGURED_ARCH).deb
23+
24+
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
25+
# Remove any stale files
26+
rm -rf iproute2*
27+
28+
# Download iproute2 from debian repository
29+
dget http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_$(IPROUTE2_MLNX_VERSION_FULL).dsc
30+
31+
pushd iproute2-$(IPROUTE2_MLNX_VERSION)
32+
33+
# Create git repository to apply patches with stg
34+
git init
35+
git add -f *
36+
git commit -qm "initial commit"
37+
38+
# Apply Patches
39+
stg init
40+
stg import -s ../patch/series
41+
42+
# Build debian
43+
dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
44+
45+
mv ../$(MAIN_TARGET) $(DEST)/
46+
popd
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
From 28e58b34f1168de182c37eff640180b6064a800d Mon Sep 17 00:00:00 2001
2+
From: liora <liora@nvidia.com>
3+
Date: Tue, 18 Apr 2023 13:01:16 +0000
4+
Subject: [PATCH 1/1] Remove arpd from iproute2 package
5+
6+
---
7+
debian/control | 3 +--
8+
debian/iproute2.install | 1 -
9+
misc/Makefile | 4 ----
10+
3 files changed, 1 insertion(+), 7 deletions(-)
11+
12+
diff --git a/debian/control b/debian/control
13+
index b5e8b0a..e735c26 100644
14+
--- a/debian/control
15+
+++ b/debian/control
16+
@@ -28,8 +28,7 @@ Build-Depends: bison,
17+
Package: iproute2
18+
Priority: important
19+
Architecture: linux-any
20+
-Provides: arpd
21+
-Conflicts: arpd, iproute (<< 20130000-1)
22+
+Conflicts: iproute (<< 20130000-1)
23+
Replaces: iproute
24+
Depends: ${misc:Depends}, ${shlibs:Depends}, libcap2-bin,
25+
Recommends: ${ipmods:Recommends}
26+
diff --git a/debian/iproute2.install b/debian/iproute2.install
27+
index f9e8c26..fba201d 100644
28+
--- a/debian/iproute2.install
29+
+++ b/debian/iproute2.install
30+
@@ -1,6 +1,5 @@
31+
etc/
32+
usr/include/iproute2/
33+
-sbin/arpd /usr/sbin
34+
sbin/bridge
35+
sbin/devlink
36+
sbin/genl /usr/sbin
37+
diff --git a/misc/Makefile b/misc/Makefile
38+
index 50dae79..1f3898f 100644
39+
--- a/misc/Makefile
40+
+++ b/misc/Makefile
41+
@@ -6,10 +6,6 @@ TARGETS=ss nstat ifstat rtacct lnstat
42+
43+
include ../config.mk
44+
45+
-ifeq ($(HAVE_BERKELEY_DB),y)
46+
- TARGETS += arpd
47+
-endif
48+
-
49+
all: $(TARGETS)
50+
51+
ss: $(SSOBJ)
52+
--
53+
2.30.2
54+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
From 6676c4a200df54a06c96faa9a30baaefc61a91b5 Mon Sep 17 00:00:00 2001
2+
From: liora <liora@nvidia.com>
3+
Date: Thu, 27 Apr 2023 03:34:10 +0000
4+
Subject: [PATCH 1/1] Rename iproute2 debian package
5+
6+
---
7+
debian/control | 4 ++--
8+
debian/{iproute2.install => iproute2-mlnx.install} | 0
9+
debian/rules | 2 +-
10+
3 files changed, 3 insertions(+), 3 deletions(-)
11+
rename debian/{iproute2.install => iproute2-mlnx.install} (100%)
12+
13+
diff --git a/debian/control b/debian/control
14+
index e735c26..4b03a6f 100644
15+
--- a/debian/control
16+
+++ b/debian/control
17+
@@ -25,11 +25,11 @@ Build-Depends: bison,
18+
po-debconf,
19+
zlib1g-dev,
20+
21+
-Package: iproute2
22+
+Package: iproute2-mlnx
23+
Priority: important
24+
Architecture: linux-any
25+
Conflicts: iproute (<< 20130000-1)
26+
-Replaces: iproute
27+
+Replaces: iproute, iproute2
28+
Depends: ${misc:Depends}, ${shlibs:Depends}, libcap2-bin,
29+
Recommends: ${ipmods:Recommends}
30+
Suggests: iproute2-doc
31+
diff --git a/debian/iproute2.install b/debian/iproute2-mlnx.install
32+
similarity index 100%
33+
rename from debian/iproute2.install
34+
rename to debian/iproute2-mlnx.install
35+
diff --git a/debian/rules b/debian/rules
36+
index d940d3c..8bd4f84 100755
37+
--- a/debian/rules
38+
+++ b/debian/rules
39+
@@ -34,7 +34,7 @@ override_dh_clean:
40+
41+
override_dh_shlibdeps:
42+
dh_shlibdeps -a -Xq_atm.so -Xm_xt.so -Xm_ipt.so
43+
- dh_shlibdeps -a -- -pipmods -dRecommends -e debian/iproute2/usr/lib/tc/m_xt.so -e debian/iproute2/usr/lib/tc/q_atm.so -xlibc6
44+
+ dh_shlibdeps -a -- -pipmods -dRecommends -e debian/iproute2-mlnx/usr/lib/tc/m_xt.so -e debian/iproute2-mlnx/usr/lib/tc/q_atm.so -xlibc6
45+
46+
override_dh_auto_test:
47+
# upstream test suite needs root and leaves machine unclean, skip it
48+
--
49+
2.30.2
50+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
From e10409ea82c16c0e48316a0b4d71a0f649f92a54 Mon Sep 17 00:00:00 2001
2+
From: liora <liora@nvidia.com>
3+
Date: Mon, 17 Apr 2023 05:17:27 +0000
4+
Subject: [PATCH 1/1] Fix version identifier
5+
6+
---
7+
include/version.h | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/include/version.h b/include/version.h
11+
index 89d0597..cf7afbb 100644
12+
--- a/include/version.h
13+
+++ b/include/version.h
14+
@@ -1 +1 @@
15+
-static const char version[] = "5.9.0";
16+
+static const char version[] = "5.10.0";
17+
--
18+
2.30.2
19+

0 commit comments

Comments
 (0)