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 D5DC643376; Mon, 20 Nov 2023 03:54:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6137E4027C; Mon, 20 Nov 2023 03:54:56 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 9347E40266 for ; Mon, 20 Nov 2023 03:54:52 +0100 (CET) Received: from dggpeml100024.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SYXCb47TCzWhct; Mon, 20 Nov 2023 10:54:19 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 20 Nov 2023 10:54:49 +0800 Subject: Re: [PATCH v7 1/4] app/dma-perf: add skip support To: Gowrishankar Muthukrishnan , CC: , Cheng Jiang , Kevin Laatz , Bruce Richardson , Pavan Nikhilesh , Amit Prakash Shukla References: <20231117121548.2401-1-gmuthukrishn@marvell.com> <20231117121548.2401-2-gmuthukrishn@marvell.com> From: fengchengwen Message-ID: <6bf5168b-89db-458d-5a7a-2bfb47f52d9f@huawei.com> Date: Mon, 20 Nov 2023 10:54:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20231117121548.2401-2-gmuthukrishn@marvell.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml100024.china.huawei.com (7.185.36.115) 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 Hi Gowrishankar and Amit, On 2023/11/17 20:15, Gowrishankar Muthukrishnan wrote: > From: Amit Prakash Shukla > > Add support to skip running a dma-perf test-case. > > Signed-off-by: Amit Prakash Shukla > Acked-by: Anoob Joseph > --- > app/test-dma-perf/config.ini | 2 ++ > app/test-dma-perf/main.c | 23 +++++++++++++++++++++++ > app/test-dma-perf/main.h | 1 + > 3 files changed, 26 insertions(+) > > diff --git a/app/test-dma-perf/config.ini b/app/test-dma-perf/config.ini > index b550f4b23f..4d59234b2a 100644 > --- a/app/test-dma-perf/config.ini > +++ b/app/test-dma-perf/config.ini > @@ -36,6 +36,8 @@ > ; If you do not specify a result file, one will be generated with the same name as the configuration > ; file, with the addition of "_result.csv" at the end. > > +; "skip" To skip a test-case set skip to 1. > + > [case1] > type=DMA_MEM_COPY > mem_size=10 > diff --git a/app/test-dma-perf/main.c b/app/test-dma-perf/main.c > index 5f8bab8f45..c74f1d81bd 100644 > --- a/app/test-dma-perf/main.c > +++ b/app/test-dma-perf/main.c > @@ -320,6 +320,7 @@ load_configs(const char *path) > const char *case_type; > const char *lcore_dma; > const char *mem_size_str, *buf_size_str, *ring_size_str, *kick_batch_str; > + const char *skip; > int args_nr, nb_vp; > bool is_dma; > > @@ -339,6 +340,13 @@ load_configs(const char *path) > for (i = 0; i < nb_sections; i++) { > snprintf(section_name, CFG_NAME_LEN, "case%d", i + 1); > test_case = &test_cases[i]; > + > + skip = rte_cfgfile_get_entry(cfgfile, section_name, "skip"); > + if (skip && (atoi(skip) == 1)) { > + test_case->is_skip = true; > + continue; > + } > + > case_type = rte_cfgfile_get_entry(cfgfile, section_name, "type"); > if (case_type == NULL) { > printf("Error: No case type in case %d, the test will be finished here.\n", > @@ -523,6 +531,21 @@ main(int argc, char *argv[]) > > printf("Running cases...\n"); > for (i = 0; i < case_nb; i++) { > + if (test_cases[i].is_skip) { > + printf("Test case %d configured to be skipped.\n\n", i + 1); > + snprintf(output_str[0], MAX_OUTPUT_STR_LEN, "Skip the test-case %d\n", > + i + 1); > + > + fd = fopen(rst_path_ptr, "a"); > + if (!fd) { > + printf("Open output CSV file error.\n"); > + return 0; > + } > + output_csv(true); > + fclose(fd); > + continue; > + } The process is similar to following two cases: 1\ if (!test_cases[i].is_valid) 2\ if (test_cases[i].test_type == TEST_TYPE_NONE) They just different in error info, suggest abstract one function. With above fixed, Acked-by: Chengwen Feng Thanks Chengwen > + > if (!test_cases[i].is_valid) { > printf("Invalid test case %d.\n\n", i + 1); > snprintf(output_str[0], MAX_OUTPUT_STR_LEN, "Invalid case %d\n", i + 1); > diff --git a/app/test-dma-perf/main.h b/app/test-dma-perf/main.h > index 62085e6e8f..32670151af 100644 > --- a/app/test-dma-perf/main.h > +++ b/app/test-dma-perf/main.h > @@ -40,6 +40,7 @@ struct lcore_dma_map_t { > > struct test_configure { > bool is_valid; > + bool is_skip; > uint8_t test_type; > const char *test_type_str; > uint16_t src_numa_node; >