Skip to content

Commit 4e224ac

Browse files
authored
Merge pull request sonic-net#51 from mssonicbld/sonicbld/202205-merge
[code sync] Merge code from sonic-net/sonic-buildimage:202205 to 202205
2 parents a004f9d + 25c9dbc commit 4e224ac

File tree

10 files changed

+160
-111
lines changed

10 files changed

+160
-111
lines changed

device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/hwsku.json

+32-44
Original file line numberDiff line numberDiff line change
@@ -1,143 +1,131 @@
11
{
22
"interfaces": {
33
"Ethernet0": {
4-
"default_brkout_mode": "1x10G",
5-
"port_type": "RJ45"
6-
},
7-
"Ethernet1": {
8-
"default_brkout_mode": "1x10G",
9-
"port_type": "RJ45"
10-
},
11-
"Ethernet2": {
12-
"default_brkout_mode": "1x10G",
13-
"port_type": "RJ45"
14-
},
15-
"Ethernet3": {
16-
"default_brkout_mode": "1x1G",
4+
"default_brkout_mode": "3x10G(3)+1x1G(1)",
175
"port_type": "RJ45"
186
},
197
"Ethernet4": {
20-
"default_brkout_mode": "1x40G",
8+
"default_brkout_mode": "1x40G[10G]",
219
"port_type": "QSFP+"
2210
},
2311
"Ethernet8": {
24-
"default_brkout_mode": "1x40G",
12+
"default_brkout_mode": "1x40G[10G]",
2513
"port_type": "QSFP+"
2614
},
2715
"Ethernet12": {
28-
"default_brkout_mode": "1x40G",
16+
"default_brkout_mode": "1x40G[10G]",
2917
"port_type": "QSFP+"
3018
},
3119
"Ethernet16": {
32-
"default_brkout_mode": "1x40G",
20+
"default_brkout_mode": "1x40G[10G]",
3321
"port_type": "QSFP+"
3422
},
3523
"Ethernet20": {
36-
"default_brkout_mode": "1x40G",
24+
"default_brkout_mode": "1x40G[10G]",
3725
"port_type": "QSFP+"
3826
},
3927
"Ethernet24": {
40-
"default_brkout_mode": "1x40G",
28+
"default_brkout_mode": "1x40G[10G]",
4129
"port_type": "QSFP+"
4230
},
4331
"Ethernet28": {
44-
"default_brkout_mode": "1x40G",
32+
"default_brkout_mode": "1x40G[10G]",
4533
"port_type": "QSFP+"
4634
},
4735
"Ethernet32": {
48-
"default_brkout_mode": "1x40G",
36+
"default_brkout_mode": "1x40G[10G]",
4937
"port_type": "QSFP+"
5038
},
5139
"Ethernet36": {
52-
"default_brkout_mode": "1x40G",
40+
"default_brkout_mode": "1x40G[10G]",
5341
"port_type": "QSFP+"
5442
},
5543
"Ethernet40": {
56-
"default_brkout_mode": "1x40G",
44+
"default_brkout_mode": "1x40G[10G]",
5745
"port_type": "QSFP+"
5846
},
5947
"Ethernet44": {
60-
"default_brkout_mode": "1x40G",
48+
"default_brkout_mode": "1x40G[10G]",
6149
"port_type": "QSFP+"
6250
},
6351
"Ethernet48": {
64-
"default_brkout_mode": "1x40G",
52+
"default_brkout_mode": "1x40G[10G]",
6553
"port_type": "QSFP+"
6654
},
6755
"Ethernet52": {
68-
"default_brkout_mode": "1x40G",
56+
"default_brkout_mode": "1x40G[10G]",
6957
"port_type": "QSFP+"
7058
},
7159
"Ethernet56": {
72-
"default_brkout_mode": "1x40G",
60+
"default_brkout_mode": "1x40G[10G]",
7361
"port_type": "QSFP+"
7462
},
7563
"Ethernet60": {
76-
"default_brkout_mode": "1x40G",
64+
"default_brkout_mode": "1x40G[10G]",
7765
"port_type": "QSFP+"
7866
},
7967
"Ethernet64": {
80-
"default_brkout_mode": "1x40G",
68+
"default_brkout_mode": "1x40G[10G]",
8169
"port_type": "QSFP+"
8270
},
8371
"Ethernet68": {
84-
"default_brkout_mode": "1x40G",
72+
"default_brkout_mode": "1x40G[10G]",
8573
"port_type": "QSFP+"
8674
},
8775
"Ethernet72": {
88-
"default_brkout_mode": "1x40G",
76+
"default_brkout_mode": "1x40G[10G]",
8977
"port_type": "QSFP+"
9078
},
9179
"Ethernet76": {
92-
"default_brkout_mode": "1x40G",
80+
"default_brkout_mode": "1x40G[10G]",
9381
"port_type": "QSFP+"
9482
},
9583
"Ethernet80": {
96-
"default_brkout_mode": "1x40G",
84+
"default_brkout_mode": "1x40G[10G]",
9785
"port_type": "QSFP+"
9886
},
9987
"Ethernet84": {
100-
"default_brkout_mode": "1x40G",
88+
"default_brkout_mode": "1x40G[10G]",
10189
"port_type": "QSFP+"
10290
},
10391
"Ethernet88": {
104-
"default_brkout_mode": "1x40G",
92+
"default_brkout_mode": "1x40G[10G]",
10593
"port_type": "QSFP+"
10694
},
10795
"Ethernet92": {
108-
"default_brkout_mode": "1x40G",
96+
"default_brkout_mode": "1x40G[10G]",
10997
"port_type": "QSFP+"
11098
},
11199
"Ethernet96": {
112-
"default_brkout_mode": "1x40G",
100+
"default_brkout_mode": "1x40G[10G]",
113101
"port_type": "QSFP+"
114102
},
115103
"Ethernet100": {
116-
"default_brkout_mode": "1x40G",
104+
"default_brkout_mode": "1x40G[10G]",
117105
"port_type": "QSFP+"
118106
},
119107
"Ethernet104": {
120-
"default_brkout_mode": "1x40G",
108+
"default_brkout_mode": "1x40G[10G]",
121109
"port_type": "QSFP+"
122110
},
123111
"Ethernet108": {
124-
"default_brkout_mode": "1x40G",
112+
"default_brkout_mode": "1x40G[10G]",
125113
"port_type": "QSFP+"
126114
},
127115
"Ethernet112": {
128-
"default_brkout_mode": "1x40G",
116+
"default_brkout_mode": "1x40G[10G]",
129117
"port_type": "QSFP+"
130118
},
131119
"Ethernet116": {
132-
"default_brkout_mode": "1x40G",
120+
"default_brkout_mode": "1x40G[10G]",
133121
"port_type": "QSFP+"
134122
},
135123
"Ethernet120": {
136-
"default_brkout_mode": "1x40G",
124+
"default_brkout_mode": "1x40G[10G]",
137125
"port_type": "QSFP+"
138126
},
139127
"Ethernet124": {
140-
"default_brkout_mode": "1x40G",
128+
"default_brkout_mode": "1x40G[10G]",
141129
"port_type": "QSFP+"
142130
}
143131
}

device/arista/x86_64-arista_7050_qx32s/platform.json

+6
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,12 @@
218218
"1x40G[10G]": [
219219
"Ethernet5/1"
220220
],
221+
"3x10G(3)+1x1G(1)": [
222+
"Ethernet1",
223+
"Ethernet2",
224+
"Ethernet3",
225+
"Ethernet4"
226+
],
221227
"2x20G[10G]": [
222228
"Ethernet5/1",
223229
"Ethernet5/3"

dockers/docker-lldp/lldpmgrd

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ try:
2323
from sonic_py_common import daemon_base
2424
from swsscommon import swsscommon
2525
from sonic_py_common.interface import inband_prefix, recirc_prefix
26+
from sonic_py_common import device_info
27+
2628
except ImportError as err:
2729
raise ImportError("%s - required module not found" % str(err))
2830

@@ -357,7 +359,8 @@ def run_cmd(self, cmd):
357359

358360
def check_timeout(self, start_time):
359361
if time.time() - start_time > PORT_INIT_TIMEOUT:
360-
self.log_error("Port init timeout reached ({} seconds), resuming lldpd...".format(PORT_INIT_TIMEOUT))
362+
if device_info.is_frontend_port_present_in_host():
363+
self.log_error("Port init timeout reached ({} seconds), resuming lldpd...".format(PORT_INIT_TIMEOUT))
361364
return True
362365
return False
363366

files/build_templates/sonic_debian_extension.j2

+2-1
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,8 @@ for fw_file_name in ${!FW_FILE_MAP[@]}; do
938938
# Link old FW location to not break existing automation/scripts
939939
sudo ln -s /host/image-$SONIC_IMAGE_VERSION/$PLATFORM_DIR/fw/asic/${FW_FILE_MAP[$fw_file_name]} $FILESYSTEM_ROOT/etc/mlnx/${FW_FILE_MAP[$fw_file_name]}
940940
done
941-
sudo cp $files_path/$ISSU_VERSION_FILE $FILESYSTEM_ROOT/etc/mlnx/issu-version
941+
sudo cp $files_path/$ISSU_VERSION_FILE $FILESYSTEM_ROOT/$PLATFORM_DIR/fw/asic/issu-version
942+
sudo ln -s /host/image-$SONIC_IMAGE_VERSION/$PLATFORM_DIR/fw/asic/issu-version $FILESYSTEM_ROOT/etc/mlnx/issu-version
942943
sudo cp $files_path/$MLNX_FFB_SCRIPT $FILESYSTEM_ROOT/usr/bin/mlnx-ffb.sh
943944
sudo cp $files_path/$MLNX_ONIE_FW_UPDATE $FILESYSTEM_ROOT/usr/bin/$MLNX_ONIE_FW_UPDATE
944945
sudo cp $files_path/$MLNX_SSD_FW_UPDATE $FILESYSTEM_ROOT/usr/bin/$MLNX_SSD_FW_UPDATE

files/scripts/arp_update

+40-25
Original file line numberDiff line numberDiff line change
@@ -89,32 +89,47 @@ while /bin/true; do
8989
eval `eval $ip6cmd`
9090

9191
if [[ $SUBTYPE == "dualtor" ]]; then
92-
# manually set any remaining FAILED/INCOMPLETE entries to permanently INCOMPLETE
93-
# this prevents any remaining INCOMPLETE entries from automatically transitioning to FAILED
94-
# once these entries are incomplete, any subsequent neighbor advertisement messages
95-
# are able to resolve the entry
96-
97-
# generates the following command for each failed or incomplete IPv6 neighbor
98-
# ip neigh replace <neighbor IPv6> dev <VLAN name> nud incomplete
99-
neigh_replace_template="sed -e 's/^/ip neigh replace /' -e 's/,/ dev /' -e 's/$/ nud incomplete;/'"
100-
ip_neigh_replace_cmd="ip -6 neigh show | grep -v fe80 | grep $vlan | grep -E 'FAILED|INCOMPLETE' | cut -d ' ' -f 1,3 --output-delimiter=',' | $neigh_replace_template"
101-
eval `eval $ip_neigh_replace_cmd`
102-
103-
# on dual ToR devices, try to resolve failed neighbor entries since
104-
# these entries will have tunnel routes installed, preventing normal
105-
# neighbor resolution (SWSS PR #2137)
106-
107-
# since ndisc6 is a userland process, the above ndisc6 commands are
108-
# insufficient to update the kernel neighbor table for failed entries
109-
110-
# we don't need to do this for ipv4 neighbors since arping is able to
111-
# update the kernel neighbor table
112-
113-
# generates the following command for each failed or incomplete IPv6 neighbor
92+
# capture all current failed/incomplete IPv6 neighbors in the kernel to avoid situations where new neighbors are learned
93+
# in the middle of the below sequence of commands
94+
unresolved_kernel_neighbors=$(ip -6 neigh show | grep -v fe80 | grep $vlan | grep -E 'FAILED|INCOMPLETE')
95+
failed_kernel_neighbors=$(echo "$unresolved_kernel_neighbors" | grep FAILED | cut -d ' ' -f 1)
96+
97+
# it's possible for kernel neighbors to fall out of sync with the hardware
98+
# this can result in failed neighbors entries that don't have corresponding zero MAC neighbor entries
99+
# and therefore don't have tunnel routes installed in the hardware
100+
# flush these neighbors from the kernel to force relearning and resync them to the hardware:
101+
# 1. for every FAILED or INCOMPLETE neighbor in the kernel, check if there is a corresponding zero MAC neighbor in APPL_DB
102+
# 2. if no zero MAC neighbor entry exists, flush the kernel neighbor entry
103+
# - generates the command 'ip neigh flush <neighbor IPv6>' for all such neighbors
104+
unsync_neighbors=$(echo "$unresolved_kernel_neighbors" | cut -d ' ' -f 1 | xargs -I{} bash -c "if [[ -z \"\$(sonic-db-cli APPL_DB hget NEIGH_TABLE:$vlan:{} neigh)\" ]]; then echo '{}'; fi")
105+
if [[ ! -z "$unsync_neighbors" ]]; then
106+
ip_neigh_flush_cmd="echo \"$unsync_neighbors\" | sed -e 's/^/ip neigh flush /' -e 's/$/;/'"
107+
eval `eval "$ip_neigh_flush_cmd"`
108+
sleep 2
109+
fi
110+
111+
# generates the following command for each FAILED or INCOMPLETE IPv6 neighbor
114112
# timeout 0.2 ping <neighbor IPv6> -n -q -i 0 -c 1 -W 1 -I <VLAN name> >/dev/null
115-
ping6_template="sed -e 's/^/timeout 0.2 ping /' -e 's/,/ -n -q -i 0 -c 1 -W 1 -I /' -e 's/$/ >\/dev\/null;/'"
116-
failed_ip6_neigh_cmd="ip -6 neigh show | grep -v fe80 | grep $vlan | grep -E 'FAILED|INCOMPLETE' | cut -d ' ' -f 1,3 --output-delimiter=',' | $ping6_template"
117-
eval `eval $failed_ip6_neigh_cmd`
113+
if [[ ! -z "$unresolved_kernel_neighbors" ]]; then
114+
ping6_template="sed -e 's/^/timeout 0.2 ping /' -e 's/,/ -n -q -i 0 -c 1 -W 1 -I /' -e 's/$/ >\/dev\/null;/'"
115+
failed_ip6_neigh_cmd="echo \"$unresolved_kernel_neighbors\" | cut -d ' ' -f 1,3 --output-delimiter=',' | $ping6_template"
116+
eval `eval "$failed_ip6_neigh_cmd"`
117+
# allow some time for any transient INCOMPLETE neighbors to transition to FAILED
118+
sleep 5
119+
fi
120+
121+
# manually set any remaining FAILED entries to permanently INCOMPLETE
122+
# once these entries are INCOMPLETE, any subsequent neighbor advertisement messages are able to resolve the entry
123+
# ignore INCOMPLETE neighbors since if they are transiently incomplete (i.e. new kernel neighbors that we are attempting to resolve for the first time),
124+
# setting them to permanently incomplete here means the kernel will never generate a netlink message for that neighbor
125+
# generates the following command for each FAILED IPv6 neighbor
126+
# ip neigh replace <neighbor IPv6> dev <VLAN name> nud incomplete
127+
failed_kernel_neighbors=$(ip -6 neigh show | grep -v fe80 | grep $vlan | grep -E 'FAILED')
128+
if [[ ! -z "$failed_kernel_neighbors" ]]; then
129+
neigh_replace_template="sed -e 's/^/ip neigh replace /' -e 's/,/ dev /' -e 's/$/ nud incomplete;/'"
130+
ip_neigh_replace_cmd="echo \"$failed_kernel_neighbors\" | cut -d ' ' -f 1,3 --output-delimiter=',' | $neigh_replace_template"
131+
eval `eval "$ip_neigh_replace_cmd"`
132+
fi
118133
fi
119134
done
120135

platform/mellanox/mlnx-ffb.sh

+39-33
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Copyright (c) 2018-2021 NVIDIA CORPORATION & AFFILIATES.
3+
# Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES.
44
# Apache-2.0
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -49,41 +49,47 @@ check_sdk_upgrade()
4949
return "${FFB_SUCCESS}"
5050
fi
5151

52-
while :; do
53-
mkdir -p "${FS_MOUNTPOINT}"
54-
mount -t squashfs "${FS_PATH}" "${FS_MOUNTPOINT}" || {
55-
>&2 echo "Failed to mount next SONiC image"
52+
ISSU_VERSION_FILE_PATH="/etc/mlnx/issu-version"
53+
CURRENT_ISSU_VERSION="$(cat ${ISSU_VERSION_FILE_PATH})"
54+
NEXT_ISSU_VERSION="Unknown"
55+
56+
# /host/image-<version>/platform/fw/asic/issu-version is now the new location for ISSU version.
57+
NEXT_IMAGE_ISSU_VERSION_FILE_PATH="/host/image-${NEXT_SONIC_IMAGE#SONiC-OS-}/platform/fw/asic/issu-version"
58+
59+
if [ -f "${NEXT_IMAGE_ISSU_VERSION_FILE_PATH}" ]; then
60+
NEXT_ISSU_VERSION="$(cat ${NEXT_IMAGE_ISSU_VERSION_FILE_PATH})"
61+
else
62+
while :; do
63+
mkdir -p "${FS_MOUNTPOINT}"
64+
mount -t squashfs "${FS_PATH}" "${FS_MOUNTPOINT}" || {
65+
>&2 echo "Failed to mount next SONiC image"
66+
break
67+
}
68+
69+
[ -f "${ISSU_VERSION_FILE_PATH}" ] || {
70+
>&2 echo "No ISSU version file found ${ISSU_VERSION_FILE_PATH}"
71+
break
72+
}
73+
74+
[ -f "${FS_MOUNTPOINT}/${ISSU_VERSION_FILE_PATH}" ] || {
75+
>&2 echo "No ISSU version file found ${ISSU_VERSION_FILE_PATH} in ${NEXT_SONIC_IMAGE}"
76+
break
77+
}
78+
NEXT_ISSU_VERSION="$(cat ${FS_MOUNTPOINT}/${ISSU_VERSION_FILE_PATH})"
5679
break
57-
}
80+
done
5881

59-
ISSU_VERSION_FILE_PATH="/etc/mlnx/issu-version"
60-
61-
[ -f "${ISSU_VERSION_FILE_PATH}" ] || {
62-
>&2 echo "No ISSU version file found ${ISSU_VERSION_FILE_PATH}"
63-
break
64-
}
65-
66-
[ -f "${FS_MOUNTPOINT}/${ISSU_VERSION_FILE_PATH}" ] || {
67-
>&2 echo "No ISSU version file found ${ISSU_VERSION_FILE_PATH} in ${NEXT_SONIC_IMAGE}"
68-
break
69-
}
70-
71-
CURRENT_ISSU_VERSION="$(cat ${ISSU_VERSION_FILE_PATH})"
72-
NEXT_ISSU_VERSION="$(cat ${FS_MOUNTPOINT}/${ISSU_VERSION_FILE_PATH})"
73-
74-
if [[ "${CURRENT_ISSU_VERSION}" == "${NEXT_ISSU_VERSION}" ]]; then
75-
CHECK_RESULT="${FFB_SUCCESS}"
76-
else
77-
>&2 echo "Current and next ISSU version do not match:"
78-
>&2 echo "Current ISSU version: ${CURRENT_ISSU_VERSION}"
79-
>&2 echo "Next ISSU version: ${NEXT_ISSU_VERSION}"
80-
fi
81-
82-
break
83-
done
82+
umount -rf "${FS_MOUNTPOINT}" 2> /dev/null || true
83+
rm -rf "${FS_MOUNTPOINT}" 2> /dev/null || true
84+
fi
8485

85-
umount -rf "${FS_MOUNTPOINT}" 2> /dev/null || true
86-
rm -rf "${FS_MOUNTPOINT}" 2> /dev/null || true
86+
if [[ "${CURRENT_ISSU_VERSION}" == "${NEXT_ISSU_VERSION}" ]]; then
87+
CHECK_RESULT="${FFB_SUCCESS}"
88+
else
89+
>&2 echo "Current and next ISSU version do not match:"
90+
>&2 echo "Current ISSU version: ${CURRENT_ISSU_VERSION}"
91+
>&2 echo "Next ISSU version: ${NEXT_ISSU_VERSION}"
92+
fi
8793

8894
return "${CHECK_RESULT}"
8995
}

src/sonic-py-common/sonic_py_common/device_info.py

+10
Original file line numberDiff line numberDiff line change
@@ -682,3 +682,13 @@ def is_fast_reboot_enabled():
682682

683683
state_db.close(state_db.STATE_DB)
684684
return fb_enable_state
685+
686+
687+
def is_frontend_port_present_in_host():
688+
if is_supervisor():
689+
return False
690+
if is_multi_npu():
691+
namespace_id = os.getenv("NAMESPACE_ID")
692+
if not namespace_id:
693+
return False
694+
return True

0 commit comments

Comments
 (0)