Skip to content

Commit 417900f

Browse files
authored
Merge branch 'master' into frr_enhancements
2 parents 3dd876e + e54a984 commit 417900f

File tree

36 files changed

+556
-61
lines changed

36 files changed

+556
-61
lines changed

device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/jr2-a7280cr3-32d4-40x100G.config.bcm

+2
Original file line numberDiff line numberDiff line change
@@ -863,3 +863,5 @@ dma_desc_aggregator_enable_specific_MDB_FEC.BCM8869X=1
863863
sai_pfc_dlr_init_capability=0
864864
sai_default_cpu_tx_tc=7
865865
sai_disable_srcmacqedstmac_ctrl=1
866+
appl_param_active_links_thr_high=58
867+
appl_param_active_links_thr_low=1

device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/0/j2p-a7800r3a-36d-36x400G.config.bcm

+2
Original file line numberDiff line numberDiff line change
@@ -1017,3 +1017,5 @@ xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=2
10171017
sai_pfc_dlr_init_capability=0
10181018
sai_default_cpu_tx_tc=7
10191019
sai_disable_srcmacqedstmac_ctrl=1
1020+
appl_param_active_links_thr_high=91
1021+
appl_param_active_links_thr_low=1

device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/1/j2p-a7800r3a-36d-36x400G.config.bcm

+2
Original file line numberDiff line numberDiff line change
@@ -1017,3 +1017,5 @@ xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=2
10171017
sai_pfc_dlr_init_capability=0
10181018
sai_default_cpu_tx_tc=7
10191019
sai_disable_srcmacqedstmac_ctrl=1
1020+
appl_param_active_links_thr_high=91
1021+
appl_param_active_links_thr_low=1

device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/0/j2p-a7800r3a-36d-36x400G.config.bcm

+2
Original file line numberDiff line numberDiff line change
@@ -1034,3 +1034,5 @@ xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4
10341034
sai_pfc_dlr_init_capability=0
10351035
sai_default_cpu_tx_tc=7
10361036
sai_disable_srcmacqedstmac_ctrl=1
1037+
appl_param_active_links_thr_high=91
1038+
appl_param_active_links_thr_low=1

device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/1/j2p-a7800r3a-36d-36x400G.config.bcm

+2
Original file line numberDiff line numberDiff line change
@@ -1034,3 +1034,5 @@ xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4
10341034
sai_pfc_dlr_init_capability=0
10351035
sai_default_cpu_tx_tc=7
10361036
sai_disable_srcmacqedstmac_ctrl=1
1037+
appl_param_active_links_thr_high=91
1038+
appl_param_active_links_thr_low=1

device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/0/j2p-a7800r3a-36d-36x400G.config.bcm

+2
Original file line numberDiff line numberDiff line change
@@ -1054,3 +1054,5 @@ xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4
10541054
sai_pfc_dlr_init_capability=0
10551055
sai_default_cpu_tx_tc=7
10561056
sai_disable_srcmacqedstmac_ctrl=1
1057+
appl_param_active_links_thr_high=91
1058+
appl_param_active_links_thr_low=1

device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/1/j2p-a7800r3a-36d-36x400G.config.bcm

+2
Original file line numberDiff line numberDiff line change
@@ -1054,3 +1054,5 @@ xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4
10541054
sai_pfc_dlr_init_capability=0
10551055
sai_default_cpu_tx_tc=7
10561056
sai_disable_srcmacqedstmac_ctrl=1
1057+
appl_param_active_links_thr_high=91
1058+
appl_param_active_links_thr_low=1

dockers/docker-stp/Dockerfile.j2

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
2+
FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
3+
4+
ARG docker_container_name
5+
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
6+
7+
## Make apt-get non-interactive
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
10+
RUN apt-get update && \
11+
apt-get install -f -y \
12+
libdbus-1-3 \
13+
libdaemon0 \
14+
libjansson4 \
15+
libpython2.7 \
16+
libjemalloc2 \
17+
ebtables
18+
19+
{% if docker_stp_debs.strip() -%}
20+
# Copy locally-built Debian package dependencies
21+
{{ copy_files("debs/", docker_stp_debs.split(' '), "/debs/") }}
22+
23+
# Install locally-built Debian packages and implicitly install their dependencies
24+
{{ install_debian_packages(docker_stp_debs.split(' ')) }}
25+
{%- endif %}
26+
27+
RUN apt-get clean -y && \
28+
apt-get autoclean -y && \
29+
apt-get autoremove -y && \
30+
rm -rf /debs
31+
32+
COPY ["start.sh", "/usr/bin/"]
33+
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
34+
COPY ["critical_processes", "/etc/supervisor"]
35+
36+
ENTRYPOINT ["/usr/local/bin/supervisord"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
# -t option needed only for shell, not for commands
4+
5+
docker exec -i stp stpctl "$@"

dockers/docker-stp/critical_processes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
program:stpd
2+
program:stpmgrd

dockers/docker-stp/start.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
rm -f /var/run/rsyslogd.pid
4+
rm -f /var/run/stpd/*
5+
rm -f /var/run/stpmgrd/*
6+
7+
supervisorctl start rsyslogd
8+
9+
supervisorctl start stpd
10+
11+
supervisorctl start stpmgrd

dockers/docker-stp/supervisord.conf

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[supervisord]
2+
logfile_maxbytes=1MB
3+
logfile_backups=2
4+
nodaemon=true
5+
6+
[program:start.sh]
7+
command=/usr/bin/start.sh
8+
priority=1
9+
autostart=true
10+
autorestart=false
11+
stdout_logfile=syslog
12+
stderr_logfile=syslog
13+
14+
[program:rsyslogd]
15+
command=/usr/sbin/rsyslogd -n
16+
priority=2
17+
autostart=false
18+
autorestart=false
19+
stdout_logfile=syslog
20+
stderr_logfile=syslog
21+
22+
[program:stpd]
23+
command=/usr/bin/stpd
24+
priority=3
25+
autostart=false
26+
autorestart=false
27+
stdout_logfile=syslog
28+
stderr_logfile=syslog
29+
30+
[program:stpmgrd]
31+
command=/usr/bin/stpmgrd
32+
priority=3
33+
autostart=false
34+
autorestart=false
35+
stdout_logfile=syslog
36+
stderr_logfile=syslog
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
gdb==13.1-3
2+
gdbserver==13.1-3
3+
libbabeltrace1==1.5.11-1+b2
4+
libboost-regex1.74.0==1.74.0+ds1-21
5+
libcbor0.8==0.8.0-2+b1
6+
libcurl3-gnutls==7.88.1-10+deb12u6
7+
libdebuginfod-common==0.188-2.1
8+
libdebuginfod1==0.188-2.1
9+
libdw1==0.188-2.1
10+
libedit2==3.1-20221030-2
11+
libevent-2.1-7==2.1.12-stable-8
12+
libexplain51==1.4.D001-12+b1
13+
libfido2-1==1.12.0-2+b1
14+
libglib2.0-0==2.74.6-2+deb12u3
15+
libgpm2==1.20.7-10+b1
16+
libicu72==72.1-3
17+
libipt2==2.0.5-1
18+
liblua5.1-0==5.1.5-9
19+
libmpfr6==4.2.0-1
20+
libsource-highlight-common==3.1.9-4.2
21+
libsource-highlight4v5==3.1.9-4.2+b3
22+
libssl-dev==3.0.13-1~deb12u1
23+
libssl3==3.0.13-1~deb12u1
24+
libswsscommon-dbgsym==1.0.0
25+
libunwind8==1.6.2-3
26+
lsof==4.95.0-1
27+
openssh-client==1:9.2p1-2+deb12u3
28+
openssl==3.0.13-1~deb12u1
29+
sensible-utils==0.0.17+nmu1
30+
sshpass==1.09-1+b1
31+
strace==6.1-0.1
32+
ucf==3.0043+nmu1
33+
vim==2:9.0.1378-2
34+
vim-runtime==2:9.0.1378-2

files/build_templates/stp.service.j2

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[Unit]
2+
Description=STP container
3+
Requires=updategraph.service swss.service
4+
After=updategraph.service swss.service syncd.service
5+
Before=ntp-config.service
6+
BindsTo=sonic.target
7+
After=sonic.target
8+
StartLimitIntervalSec=1200
9+
StartLimitBurst=3
10+
11+
[Service]
12+
User={{ sonicadmin_user }}
13+
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
14+
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
15+
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
16+
RestartSec=30
17+
18+
[Install]
19+
WantedBy=multi-user.target

files/image_config/logrotate/rsyslog.j2

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
/var/log/syslog
3131
/var/log/teamd.log
3232
/var/log/telemetry.log
33+
/var/log/stpd.log
3334
/var/log/gnmi.log
3435
/var/log/frr/bgpd.log
3536
/var/log/frr/zebra.log

files/image_config/rsyslog/rsyslog.d/00-sonic.conf.j2

+8
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,11 @@ if $msg startswith " telemetry" or ($msg startswith " dialout" )then {
4646
/var/log/telemetry.log
4747
stop
4848
}
49+
50+
## stpd rules
51+
if $programname contains "stp" then {
52+
if not ($msg contains "STP_SYSLOG") then {
53+
/var/log/stpd.log
54+
stop
55+
}
56+
}

platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py

+26-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from sonic_platform_base.chassis_base import ChassisBase
2828
from sonic_py_common.logger import Logger
2929
import os
30+
from sonic_py_common import device_info
3031
from functools import reduce
3132
from .utils import extract_RJ45_ports_index
3233
from . import module_host_mgmt_initializer
@@ -57,6 +58,8 @@
5758
REBOOT_TYPE_KEXEC_PATTERN_WARM = ".*SONIC_BOOT_TYPE=(warm|fastfast).*"
5859
REBOOT_TYPE_KEXEC_PATTERN_FAST = ".*SONIC_BOOT_TYPE=(fast|fast-reboot).*"
5960

61+
SYS_DISPLAY = "SYS_DISPLAY"
62+
6063
# Global logger class instance
6164
logger = Logger()
6265

@@ -742,8 +745,15 @@ def get_model(self):
742745
Returns:
743746
string: Model/part number of device
744747
"""
745-
self.initialize_eeprom()
746-
return self._eeprom.get_part_number()
748+
model = None
749+
if self._read_model_from_vpd():
750+
if not self.vpd_data:
751+
self.vpd_data = self._parse_vpd_data(VPD_DATA_FILE)
752+
model = self.vpd_data.get(SYS_DISPLAY, "N/A")
753+
else:
754+
self.initialize_eeprom()
755+
model = self._eeprom.get_part_number()
756+
return model
747757

748758
def get_base_mac(self):
749759
"""
@@ -944,6 +954,20 @@ def _parse_vpd_data(self, filename):
944954

945955
return result
946956

957+
def _read_model_from_vpd(self):
958+
"""
959+
Returns if model number should be returned from VPD file
960+
961+
Returns:
962+
Returns True if spectrum version is higher than Spectrum-4 according to sku number
963+
"""
964+
sku = device_info.get_hwsku()
965+
sku_num = re.search('[0-9]{4}', sku).group()
966+
# fallback to spc1 in case sku number is not available
967+
if sku_num is None:
968+
sku_num = 2700
969+
return int(sku_num) >= 5000
970+
947971
def _verify_reboot_cause(self, filename):
948972
'''
949973
Open and read the reboot cause file in

platform/mellanox/mlnx-platform-api/tests/test_eeprom.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
2-
# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES.
2+
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
3+
# Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
34
# Apache-2.0
45
#
56
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,6 +19,7 @@
1819
import os
1920
import pytest
2021
import sys
22+
from sonic_py_common import device_info
2123
if sys.version_info.major == 3:
2224
from unittest.mock import MagicMock, patch
2325
else:
@@ -33,6 +35,7 @@
3335
class TestEeprom:
3436
@patch('os.path.exists', MagicMock(return_value=True))
3537
@patch('os.path.islink', MagicMock(return_value=True))
38+
@patch('sonic_py_common.device_info.get_hwsku', MagicMock(return_value='MSN3420'))
3639
@patch('sonic_platform.eeprom.Eeprom.get_system_eeprom_info')
3740
@patch('sonic_platform.chassis.extract_RJ45_ports_index', MagicMock(return_value=[]))
3841
def test_chassis_eeprom(self, mock_eeprom_info):

rules/docker-stp.mk

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Docker image for STP
2+
3+
DOCKER_STP_STEM = docker-stp
4+
DOCKER_STP = $(DOCKER_STP_STEM).gz
5+
DOCKER_STP_DBG = $(DOCKER_STP_STEM)-$(DBG_IMAGE_MARK).gz
6+
7+
$(DOCKER_STP)_PATH = $(DOCKERS_PATH)/$(DOCKER_STP_STEM)
8+
9+
$(DOCKER_STP)_DEPENDS += $(STP) $(SWSS) $(SONIC_RSYSLOG_PLUGIN)
10+
$(DOCKER_STP)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_DEPENDS)
11+
$(DOCKER_STP)_DBG_DEPENDS += $(STP) $(SWSS) $(SONIC_RSYSLOG_PLUGIN)
12+
13+
$(DOCKER_STP)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_IMAGE_PACKAGES)
14+
15+
$(DOCKER_STP)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_BOOKWORM)
16+
17+
ifeq ($(INCLUDE_STP), y)
18+
SONIC_DOCKER_IMAGES += $(DOCKER_STP)
19+
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_STP)
20+
21+
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_STP_DBG)
22+
SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_STP_DBG)
23+
endif
24+
25+
$(DOCKER_STP)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_BOOKWORM)
26+
27+
$(DOCKER_STP)_CONTAINER_NAME = stp
28+
$(DOCKER_STP)_RUN_OPT += -t --cap-add=NET_ADMIN --cap-add=SYS_ADMIN
29+
$(DOCKER_STP)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
30+
31+
$(DOCKER_STP)_BASE_IMAGE_FILES += stpctl:/usr/bin/stpctl

rules/sonic-stp.dep

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
SPATH := $($(SONIC-STP)_SRC_PATH)
3+
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-stp.mk rules/sonic-stp.dep
4+
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
5+
SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files))
6+
7+
$(SONIC-STP)_CACHE_MODE := GIT_CONTENT_SHA
8+
$(SONIC-STP)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
9+
$(SONIC-STP)_DEP_FILES := $(DEP_FILES)
10+
$(SONIC-STP)_SMDEP_FILES := $(SMDEP_FILES)
11+
$(SONIC-STP)_SMDEP_PATHS := $(SPATH)

rules/sonic-stp.mk

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# STP package
2+
#
3+
STP_VERSION = 1.0.0
4+
export STP_VERSION
5+
6+
STP = stp_$(STP_VERSION)_$(CONFIGURED_ARCH).deb
7+
$(STP)_SRC_PATH = $(SRC_PATH)/sonic-stp
8+
$(STP)_DEPENDS += $(LIBSWSSCOMMON_DEV)
9+
$(STP)_RDEPENDS += $(LIBSWSSCOMMON)
10+
SONIC_DPKG_DEBS += $(STP)
11+
12+
STP_DBG = stp-dbg_$(STP_VERSION)_$(CONFIGURED_ARCH).deb
13+
$(STP_DBG)_DEPENDS += $(STP)
14+
$(STP_DBG)_RDEPENDS += $(STP)
15+
$(eval $(call add_derived_package,$(STP),$(STP_DBG)))
16+
17+
export STP

rules/swss.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SWSS = swss_1.0.0_$(CONFIGURED_ARCH).deb
44
$(SWSS)_SRC_PATH = $(SRC_PATH)/sonic-swss
55
$(SWSS)_DEPENDS += $(LIBSAIREDIS_DEV) $(LIBSAIMETADATA_DEV) $(LIBTEAM_DEV) \
66
$(LIBTEAMDCTL) $(LIBTEAM_UTILS) $(LIBSWSSCOMMON_DEV) \
7-
$(LIBSAIVS) $(LIBSAIVS_DEV) \
7+
$(LIBSAIVS) $(LIBSAIVS_DEV) $(STP)\
88
$(PROTOBUF) $(PROTOBUF_LITE) $(PROTOBUF_DEV) $(LIB_SONIC_DASH_API)
99
$(SWSS)_UNINSTALLS = $(LIBSAIVS_DEV)
1010

slave.mk

+2
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ $(info "BLDENV" : "$(BLDENV)")
441441
$(info "VS_PREPARE_MEM" : "$(VS_PREPARE_MEM)")
442442
$(info "INCLUDE_MGMT_FRAMEWORK" : "$(INCLUDE_MGMT_FRAMEWORK)")
443443
$(info "INCLUDE_ICCPD" : "$(INCLUDE_ICCPD)")
444+
$(info "INCLUDE_STP" : "$(INCLUDE_STP)")
444445
$(info "INCLUDE_SYSTEM_TELEMETRY" : "$(INCLUDE_SYSTEM_TELEMETRY)")
445446
$(info "INCLUDE_SYSTEM_GNMI" : "$(INCLUDE_SYSTEM_GNMI)")
446447
$(info "INCLUDE_SYSTEM_BMP" : "$(INCLUDE_SYSTEM_BMP)")
@@ -1451,6 +1452,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
14511452
export include_dhcp_server="$(INCLUDE_DHCP_SERVER)"
14521453
export include_mgmt_framework="$(INCLUDE_MGMT_FRAMEWORK)"
14531454
export include_iccpd="$(INCLUDE_ICCPD)"
1455+
export include_stpd="$(INCLUDE_STP)"
14541456
export pddf_support="$(PDDF_SUPPORT)"
14551457
export include_pde="$(INCLUDE_PDE)"
14561458
export shutdown_bgp_on_start="$(SHUTDOWN_BGP_ON_START)"

sonic-slave-bullseye/Dockerfile.j2

+1
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ RUN apt-get purge -y python3-pip python3-yaml
535535

536536
# For building Python packages
537537
RUN pip3 install setuptools==49.6.00
538+
RUN pip3 install setuptools-scm==8.1.0
538539
RUN pip3 install wheel==0.38.1
539540

540541
{%- if CONFIGURED_ARCH == "armhf" %}

0 commit comments

Comments
 (0)