patch 'test/bonding: fix active backup receive test' has been queued to stable release 24.11.2
Kevin Traynor
ktraynor at redhat.com
Thu Feb 13 10:57:40 CET 2025
Hi,
FYI, your patch has been queued to stable release 24.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/17/25. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/8ed4c26a454c42d24c0dcb27d8d7983f5237432a
Thanks.
Kevin
---
>From 8ed4c26a454c42d24c0dcb27d8d7983f5237432a Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Fri, 13 Dec 2024 09:17:14 -0800
Subject: [PATCH] test/bonding: fix active backup receive test
[ upstream commit eb29e625ce41b50898efc8e2618b7eeb128460ed ]
The test had incorrect assumptions about how active backup
should work. When in active backup mode, the secondary (not primary)
ports should be ignored. The test was always broken since initially
written but earlier bug was masking the part of the test which
tested non-primary ports.
Bugzilla ID: 1589
Fixes: 112ce3917674 ("test/bonding: fix loop on members")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Huisong Li <lihuisong at huawei.com>
Tested-by: Huisong Li <lihuisong at huawei.com>
---
app/test/test_link_bonding.c | 69 ++++++++++++++++++------------------
1 file changed, 34 insertions(+), 35 deletions(-)
diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index b752a5ecbf..19b064771a 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -2247,47 +2247,46 @@ test_activebackup_rx_burst(void)
&gen_pkt_burst[0], burst_size);
+ /* Expect burst if this was the active port, zero otherwise */
+ unsigned int rx_expect
+ = (test_params->member_port_ids[i] == primary_port) ? burst_size : 0;
+
/* Call rx burst on bonding device */
- TEST_ASSERT_EQUAL(rte_eth_rx_burst(test_params->bonding_port_id, 0,
- &rx_pkt_burst[0], MAX_PKT_BURST), burst_size,
- "rte_eth_rx_burst failed");
+ unsigned int rx_count = rte_eth_rx_burst(test_params->bonding_port_id, 0,
+ &rx_pkt_burst[0], MAX_PKT_BURST);
+ TEST_ASSERT_EQUAL(rx_count, rx_expect,
+ "rte_eth_rx_burst (%u) not as expected (%u)",
+ rx_count, rx_expect);
- if (test_params->member_port_ids[i] == primary_port) {
- /* Verify bonding device rx count */
- rte_eth_stats_get(test_params->bonding_port_id, &port_stats);
- TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size,
- "Bonding Port (%d) ipackets value (%u) not as expected (%d)",
+ /* Verify bonding device rx count */
+ rte_eth_stats_get(test_params->bonding_port_id, &port_stats);
+ TEST_ASSERT_EQUAL(port_stats.ipackets, rx_expect,
+ "Bonding Port (%d) ipackets value (%u) not as expected (%u)",
test_params->bonding_port_id,
- (unsigned int)port_stats.ipackets, burst_size);
+ (unsigned int)port_stats.ipackets, rx_expect);
- /* Verify bonding member devices rx count */
- for (j = 0; j < test_params->bonding_member_count; j++) {
- rte_eth_stats_get(test_params->member_port_ids[j], &port_stats);
- if (i == j) {
- TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size,
- "Member Port (%d) ipackets value (%u) not as "
- "expected (%d)",
- test_params->member_port_ids[i],
- (unsigned int)port_stats.ipackets,
- burst_size);
- } else {
- TEST_ASSERT_EQUAL(port_stats.ipackets, 0,
- "Member Port (%d) ipackets value (%u) not as "
- "expected (%d)\n",
- test_params->member_port_ids[i],
- (unsigned int)port_stats.ipackets, 0);
- }
- }
- } else {
- for (j = 0; j < test_params->bonding_member_count; j++) {
- rte_eth_stats_get(test_params->member_port_ids[j], &port_stats);
+ for (j = 0; j < test_params->bonding_member_count; j++) {
+ rte_eth_stats_get(test_params->member_port_ids[j], &port_stats);
+ if (i == j) {
+ TEST_ASSERT_EQUAL(port_stats.ipackets, rx_expect,
+ "Member Port (%d) ipackets (%u) not as expected (%d)",
+ test_params->member_port_ids[i],
+ (unsigned int)port_stats.ipackets, rx_expect);
+
+ /* reset member device stats */
+ rte_eth_stats_reset(test_params->member_port_ids[j]);
+ } else {
TEST_ASSERT_EQUAL(port_stats.ipackets, 0,
- "Member Port (%d) ipackets value (%u) not as expected "
- "(%d)", test_params->member_port_ids[i],
- (unsigned int)port_stats.ipackets, 0);
+ "Member Port (%d) ipackets (%u) not as expected (%d)",
+ test_params->member_port_ids[i],
+ (unsigned int)port_stats.ipackets, 0);
}
}
- /* free mbufs */
- rte_pktmbuf_free_bulk(rx_pkt_burst, burst_size);
+ /* extract packets queued to inactive member */
+ if (rx_count == 0)
+ rx_count = rte_eth_rx_burst(test_params->member_port_ids[i], 0,
+ rx_pkt_burst, MAX_PKT_BURST);
+ if (rx_count > 0)
+ rte_pktmbuf_free_bulk(rx_pkt_burst, rx_count);
/* reset bonding device stats */
--
2.48.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-02-12 17:29:35.994134793 +0000
+++ 0013-test-bonding-fix-active-backup-receive-test.patch 2025-02-12 17:29:34.166944832 +0000
@@ -1 +1 @@
-From eb29e625ce41b50898efc8e2618b7eeb128460ed Mon Sep 17 00:00:00 2001
+From 8ed4c26a454c42d24c0dcb27d8d7983f5237432a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit eb29e625ce41b50898efc8e2618b7eeb128460ed ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list