Skip to content

Commit

Permalink
Merge pull request sonic-net#477 from mssonicbld/sonicbld/202405-merge
Browse files Browse the repository at this point in the history
[code sync] Merge code from sonic-net/sonic-buildimage:202405 to 202405
  • Loading branch information
mssonicbld authored Dec 26, 2024
2 parents e5a30c6 + 8e80ad5 commit b724982
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 30 deletions.
39 changes: 17 additions & 22 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -445,33 +445,28 @@ start() {

DOCKERCHECK=`docker inspect --type container ${DOCKERNAME} 2>/dev/null`
if [ "$?" -eq "0" ]; then
{%- if docker_container_name == "database" and sonic_asic_platform == "vs" %}
echo "Removing existing ${DOCKERNAME} container"
docker rm -f ${DOCKERNAME}
{%- if docker_container_name == "database" %}
DOCKERMOUNT=""
{%- else %}
DOCKERMOUNT=`getMountPoint "$DOCKERCHECK"`
{%- endif %}
if [ x"$DOCKERMOUNT" == x"$MOUNTPATH" ]; then
CONTAINER_EXISTS="yes"
preStartAction
{%- if docker_container_name == "database" %}
DOCKERMOUNT=""
echo "Starting existing ${DOCKERNAME} container"
docker start ${DOCKERNAME}
{%- else %}
DOCKERMOUNT=`getMountPoint "$DOCKERCHECK"`
echo "Starting existing ${DOCKERNAME} container with HWSKU $HWSKU"
/usr/local/bin/container start ${DOCKERNAME}
{%- endif %}
if [ x"$DOCKERMOUNT" == x"$MOUNTPATH" ]; then
CONTAINER_EXISTS="yes"
preStartAction
{%- if docker_container_name == "database" %}
echo "Starting existing ${DOCKERNAME} container"
docker start ${DOCKERNAME}
{%- else %}
echo "Starting existing ${DOCKERNAME} container with HWSKU $HWSKU"
/usr/local/bin/container start ${DOCKERNAME}
{%- endif %}
postStartAction
exit $?
fi
postStartAction
exit $?
fi

# docker created with a different HWSKU, remove and recreate
echo "Removing obsolete ${DOCKERNAME} container with HWSKU $DOCKERMOUNT"
docker rm -f ${DOCKERNAME}
{%- endif %}
# docker created with a different HWSKU, remove and recreate
echo "Removing obsolete ${DOCKERNAME} container with HWSKU $DOCKERMOUNT"
docker rm -f ${DOCKERNAME}
fi

{%- if docker_container_name == "database" %}
Expand Down
1 change: 0 additions & 1 deletion files/image_config/bannerconfig/banner-config.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Description=Update banner config based on configdb
Requires=config-setup.service
After=config-setup.service
Before=systemd-logind.service sshd.service
BindsTo=database.service
BindsTo=sonic.target

Expand Down
3 changes: 2 additions & 1 deletion platform/broadcom/sai.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
LIBSAIBCM_XGS_VERSION = 11.2.18.2
LIBSAIBCM_DNX_VERSION = 11.2.16.1
LIBSAIBCM_DNX_VERSION = 11.2.18.1

LIBSAIBCM_XGS_BRANCH_NAME = SAI_11.2.0_GA
LIBSAIBCM_DNX_BRANCH_NAME = SAI_11.2.0_GA
LIBSAIBCM_XGS_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/sai-broadcom/$(LIBSAIBCM_XGS_BRANCH_NAME)/$(LIBSAIBCM_XGS_VERSION)/xgs"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From f961a46cd8b3736a7ac8534fad774433b2a8ce6b Mon Sep 17 00:00:00 2001
From: Vinod Kumar <vkjammala@arista.com>
Date: Thu, 12 Dec 2024 11:04:21 +0000
Subject: [PATCH] Consider only expected packets for timeout

"count_matched_packets" method is getting stuck in a while loop as long
as ptf server port receives any packet (Ex: in dualtor case, we do see
continuous ICMP packets on ptf port). Fix is to consider only expected
packets w.r.t timeout (similar to "count_matched_packets_all_ports" logic).
---
src/ptf/testutils.py | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/src/ptf/testutils.py b/src/ptf/testutils.py
index 46b926c..2402e8f 100755
--- a/src/ptf/testutils.py
+++ b/src/ptf/testutils.py
@@ -3636,14 +3636,19 @@ def count_matched_packets(test, exp_packet, port, device_number=0, timeout=None)
"%s() requires positive timeout value." % sys._getframe().f_code.co_name
)

+ last_matched_packet_time = time.time()
total_rcv_pkt_cnt = 0
while True:
+ if (time.time() - last_matched_packet_time) > timeout:
+ break
+
result = dp_poll(
test, device_number=device_number, port_number=port, timeout=timeout
)
if isinstance(result, test.dataplane.PollSuccess):
if ptf.dataplane.match_exp_pkt(exp_packet, result.packet):
total_rcv_pkt_cnt += 1
+ last_matched_packet_time = time.time()
else:
break

--
2.43.5

1 change: 1 addition & 0 deletions src/ptf-py3.patch/series
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
0001-Remove-ord-in-get_mac-to-avoid-TypeError.patch
0002-Fill-byte-formatted-client-mac-address-in-DHCP-Disco.patch
0003-Avoid-local-version-scheme-by-setuptools-scm.patch
0004-Consider-only-expected-packets-for-timeout.patch
8 changes: 2 additions & 6 deletions src/sonic-eventd/tests/eventd_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,12 @@ void run_cap(void *zctx, bool &term, string &read_source,
EXPECT_EQ(0, zmq_setsockopt(mock_cap, ZMQ_SUBSCRIBE, "", 0));
EXPECT_EQ(0, zmq_setsockopt(mock_cap, ZMQ_RCVTIMEO, &block_ms, sizeof (block_ms)));

zmq_msg_t msg;
zmq_msg_init(&msg);
int rc = zmq_msg_recv(&msg, mock_cap, 0);
EXPECT_EQ(1, rc); // read control character

while(!term) {
string source;
internal_event_t ev_int;

if (0 == zmq_message_read(mock_cap, 0, source, ev_int)) {
int rc = zmq_message_read(mock_cap, 0, source, ev_int);
if (0 == rc && !ev_int.empty()) { // ignore control character empty event
cnt = ++i;
}
}
Expand Down

0 comments on commit b724982

Please sign in to comment.