From patchwork Fri Nov 10 09:53:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Hai X-Patchwork-Id: 134086 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 412CD432F3; Fri, 10 Nov 2023 10:56:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0501540291; Fri, 10 Nov 2023 10:56:38 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 55D3C40268 for ; Fri, 10 Nov 2023 10:56:35 +0100 (CET) Received: from kwepemd100004.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SRZ396crRztRKk; Fri, 10 Nov 2023 17:56:21 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemd100004.china.huawei.com (7.221.188.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.23; Fri, 10 Nov 2023 17:56:32 +0800 From: Jie Hai To: , Chas Williams , "Min Hu (Connor)" , Pablo de Lara , Declan Doherty CC: , , , Subject: [PATCH] app/test: fix retest link bonding fail Date: Fri, 10 Nov 2023 17:53:01 +0800 Message-ID: <20231110095302.2469090-1-haijie1@huawei.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemd100004.china.huawei.com (7.221.188.31) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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; }