From 5cf88e89f6925e94d7362c3fb93c3b2b25eda882 Mon Sep 17 00:00:00 2001 From: Sonic Build Admin Date: Wed, 18 Feb 2026 05:29:31 +0000 Subject: [PATCH] Change dummy ip for fill packets to eliminate false positives ### Description of PR Summary: Fixes # (issue) ### Type of change - [x] Bug fix - [ ] Testbed and Framework(new/improvement) - [ ] New Test case - [ ] Skipped for non-supported platforms - [ ] Test case improvement ### Back port request - [ ] 202205 - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [x] 202412 - [ ] 202505 - [x] 202511 ### Approach #### What is the motivation for this PR? We were seeing failures in packet trimming tests when verifying UDP packets. This is because the shaper on TH5 is still sending a few packets a second that were used to fill up the buffer (simulating congestion) and these packets are nearly identical to the UDP packets used to verify trimming. This is leading to false positives where a packet that was used to fill the buffer is being detected as a "trimmed" packet when packet trimming is turned off. #### How did you do it? Fixed this by changing the dummy ip for the packets used to fill the buffer, meaning they won't be mistaken for a packet that the test sends to verify trimming. #### How did you verify/test it? Verified that the failure goes away with the change. #### Any platform specific information? #### Supported testbed topology if it's a new test case? ### Documentation --- tests/packet_trimming/constants.py | 2 ++ tests/packet_trimming/packet_trimming_helper.py | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/packet_trimming/constants.py b/tests/packet_trimming/constants.py index fb069a716..0ebbd45a1 100644 --- a/tests/packet_trimming/constants.py +++ b/tests/packet_trimming/constants.py @@ -21,7 +21,9 @@ JUMBO_PACKET_SIZE = 5000 MIN_PACKET_SIZE = 100 DUMMY_IP = "8.8.8.8" +DUMMY_FILL_IP = "9.9.9.9" DUMMY_IPV6 = "8000::2" +DUMMY_FILL_IPV6 = "9000::2" DUMMY_MAC = "00:11:22:33:44:55" PACKET_COUNT = 1000 BATCH_PACKET_COUNT = 10000 diff --git a/tests/packet_trimming/packet_trimming_helper.py b/tests/packet_trimming/packet_trimming_helper.py index cbb95624d..4e22a0874 100644 --- a/tests/packet_trimming/packet_trimming_helper.py +++ b/tests/packet_trimming/packet_trimming_helper.py @@ -17,7 +17,8 @@ from tests.common.helpers.srv6_helper import dump_packet_detail, validate_srv6_in_appl_db, validate_srv6_in_asic_db from tests.common.reboot import reboot from tests.packet_trimming.constants import (DEFAULT_SRC_PORT, DEFAULT_DST_PORT, DEFAULT_TTL, DUMMY_MAC, DUMMY_IPV6, - DUMMY_IP, BATCH_PACKET_COUNT, PACKET_COUNT, STATIC_THRESHOLD_MULTIPLIER, + DUMMY_FILL_IPV6, DUMMY_IP, DUMMY_FILL_IP, BATCH_PACKET_COUNT, + PACKET_COUNT, STATIC_THRESHOLD_MULTIPLIER, BLOCK_DATA_PLANE_SCHEDULER_NAME, PACKET_TYPE, SRV6_PACKETS, TRIM_QUEUE_PROFILE, TRIMMING_CAPABILITY, ACL_TABLE_NAME, ACL_RULE_PRIORITY, ACL_TABLE_TYPE_NAME, ACL_RULE_NAME, SRV6_MY_SID_LIST, @@ -698,7 +699,7 @@ def fill_egress_buffer(duthost, ptfadapter, port_id, buffer_size, target_queue, if is_ipv6: # Create IPv6 UDP packet ipv6_params = { - 'ipv6_src': DUMMY_IPV6, + 'ipv6_src': DUMMY_FILL_IPV6, 'ipv6_dst': dst_addr, 'ipv6_hlim': DEFAULT_TTL, 'ipv6_tc': dscp_value << 2, # Convert DSCP to Traffic Class @@ -708,7 +709,7 @@ def fill_egress_buffer(duthost, ptfadapter, port_id, buffer_size, target_queue, else: # Create IPv4 UDP packet ipv4_params = { - 'ip_src': DUMMY_IP, + 'ip_src': DUMMY_FILL_IP, 'ip_dst': dst_addr, 'ip_ttl': DEFAULT_TTL, 'ip_dscp': dscp_value,