DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/test: fix retest link bonding fail
@ 2023-11-10  9:53 Jie Hai
  2023-11-11  2:02 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Jie Hai @ 2023-11-10  9:53 UTC (permalink / raw)
  To: dev, Chas Williams, Min Hu (Connor), Pablo de Lara, Declan Doherty
  Cc: lihuisong, fengchengwen, liudongdong3, haijie1

The testcase "test_close_bonding_device" closes the bonding
port shared by several cases. After closed, the port is in
RTE_ETH_DEV_UNUSED state, and could not be used by other cases
anymore. If retest the "link_bonding_autotest", failure occurs.
This patch creates a new bonding device for the closing testcase.

Fixes: 92073ef961ee ("bond: unit tests")
Cc: stable@dpdk.org

Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 app/test/test_link_bonding.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index 4d54706c21d6..15fb0bc3e108 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -4182,7 +4182,16 @@ test_reconfigure_bonding_device(void)
 static int
 test_close_bonding_device(void)
 {
-	rte_eth_dev_close(test_params->bonding_port_id);
+	int16_t bonding_port_id;
+	char pmd_name[RTE_ETH_NAME_MAX_LEN];
+
+	snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, "%s_%d",
+		 BONDING_DEV_NAME, ++bonding_id);
+	bonding_port_id = rte_eth_bond_create(pmd_name,
+				test_params->bonding_mode, rte_socket_id());
+	TEST_ASSERT(bonding_port_id >= 0,
+				"Failed to create bonding ethdev %s", pmd_name);
+	rte_eth_dev_close(bonding_port_id);
 	return 0;
 }
 
-- 
2.30.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-11  2:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-10  9:53 [PATCH] app/test: fix retest link bonding fail Jie Hai
2023-11-11  2:02 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).