From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2A2F14648F; Thu, 27 Mar 2025 09:58:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB2A340275; Thu, 27 Mar 2025 09:58:19 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 4B83A40261 for ; Thu, 27 Mar 2025 09:58:18 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4ZNcwL0PGJztRbs; Thu, 27 Mar 2025 16:56:50 +0800 (CST) Received: from kwepemo500011.china.huawei.com (unknown [7.202.195.194]) by mail.maildlp.com (Postfix) with ESMTPS id 61BED180087; Thu, 27 Mar 2025 16:58:16 +0800 (CST) Received: from localhost.huawei.com (10.50.165.33) by kwepemo500011.china.huawei.com (7.202.195.194) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 27 Mar 2025 16:58:15 +0800 From: Dengdui Huang To: CC: , , , , , , Subject: [PATCH] app/dma-perf: fix infinite loop Date: Thu, 27 Mar 2025 16:58:13 +0800 Message-ID: <20250327085815.3346159-1-huangdengdui@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250321040316.104126-1-huangdengdui@huawei.com> References: <20250321040316.104126-1-huangdengdui@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.50.165.33] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemo500011.china.huawei.com (7.202.195.194) 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 When a core that is not used by the rte is specified in the config for testing, the problem of infinite loop occurs. This patch fix it by adding a check for lcore_id. Fixes: 623dc9364dc6 ("app/dma-perf: introduce DMA performance test") Cc: stable@dpdk.org Signed-off-by: Dengdui Huang --- app/test-dma-perf/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/test-dma-perf/main.c b/app/test-dma-perf/main.c index 0586b3e1d0..1365456dd1 100644 --- a/app/test-dma-perf/main.c +++ b/app/test-dma-perf/main.c @@ -523,7 +523,7 @@ main(int argc, char *argv[]) { int ret; uint16_t case_nb; - uint32_t i, nb_lcores; + uint32_t i, j, nb_lcores, lcore; pid_t cpid, wpid; int wstatus; char args[MAX_EAL_PARAM_NB][MAX_EAL_PARAM_LEN]; @@ -603,6 +603,12 @@ main(int argc, char *argv[]) if (nb_lcores < 2) rte_exit(EXIT_FAILURE, "There should be at least 2 worker lcores.\n"); + for (j = 0; j < test_cases[i].num_worker; j++) { + lcore = test_cases[i].dma_config[j].lcore_dma_map.lcore; + if (!rte_lcore_has_role(lcore, ROLE_RTE)) + rte_exit(EXIT_FAILURE, + "Worker lcore %u not enabled in EAL\n", lcore); + } fd = fopen(rst_path_ptr, "a"); if (!fd) { -- 2.33.0