patch 'test/bonding: fix active backup receive test' has been queued to stable release 23.11.4
Xueming Li
xuemingl at nvidia.com
Tue Feb 18 13:34:04 CET 2025
Hi,
FYI, your patch has been queued to stable release 23.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=d0d04dead13a23640736a8b83a27bda0164f45be
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From d0d04dead13a23640736a8b83a27bda0164f45be 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
Cc: Xueming Li <xuemingl at nvidia.com>
[ 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 | 74 +++++++++++++++++-------------------
1 file changed, 34 insertions(+), 40 deletions(-)
diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index b53f512815..19b064771a 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -2246,54 +2246,48 @@ test_activebackup_rx_burst(void)
virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[i],
&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 */
- for (i = 0; i < MAX_PKT_BURST; i++) {
- if (rx_pkt_burst[i] != NULL) {
- rte_pktmbuf_free(rx_pkt_burst[i]);
- rx_pkt_burst[i] = NULL;
- }
- }
+ /* 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 */
rte_eth_stats_reset(test_params->bonding_port_id);
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-02-18 19:39:01.070352072 +0800
+++ 0009-test-bonding-fix-active-backup-receive-test.patch 2025-02-18 19:39:00.428244082 +0800
@@ -1 +1 @@
-From eb29e625ce41b50898efc8e2618b7eeb128460ed Mon Sep 17 00:00:00 2001
+From d0d04dead13a23640736a8b83a27bda0164f45be Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit eb29e625ce41b50898efc8e2618b7eeb128460ed ]
@@ -14 +16,0 @@
-Cc: stable at dpdk.org
@@ -20,2 +22,2 @@
- app/test/test_link_bonding.c | 69 ++++++++++++++++++------------------
- 1 file changed, 34 insertions(+), 35 deletions(-)
+ app/test/test_link_bonding.c | 74 +++++++++++++++++-------------------
+ 1 file changed, 34 insertions(+), 40 deletions(-)
@@ -24 +26 @@
-index b752a5ecbf..19b064771a 100644
+index b53f512815..19b064771a 100644
@@ -27 +29 @@
-@@ -2246,49 +2246,48 @@ test_activebackup_rx_burst(void)
+@@ -2246,54 +2246,48 @@ test_activebackup_rx_burst(void)
@@ -101 +103,6 @@
-- rte_pktmbuf_free_bulk(rx_pkt_burst, burst_size);
+- for (i = 0; i < MAX_PKT_BURST; i++) {
+- if (rx_pkt_burst[i] != NULL) {
+- rte_pktmbuf_free(rx_pkt_burst[i]);
+- rx_pkt_burst[i] = NULL;
+- }
+- }
More information about the stable
mailing list