From patchwork Mon Aug 7 13:06:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Prakash Shukla X-Patchwork-Id: 129933 X-Patchwork-Delegate: thomas@monjalon.net 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 12FF142FFE; Mon, 7 Aug 2023 15:06:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF7F7410D3; Mon, 7 Aug 2023 15:06:31 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 7403740A8B for ; Mon, 7 Aug 2023 15:06:29 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3775pbRG011295; Mon, 7 Aug 2023 06:06:28 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=Zmwp/GCe6izshYoo6epsiepx1N90ap+FsFYYRWpjjxo=; b=NinNgJPKUvJ9fy6tscn2AdnITgdrNs0Tk6T/g9/8r1eBlkwQypIEu9RuB1XskCxltMCa ILNZItGnyGB5fqaiT8UMKjf6SkIb1e4fErzrfjq72hod9KeTWmw7UEqo+bsgH+JGPg1U arUQPULam+udwrQPquzVHdCZH0JDNtxAyWo82bieo4ZqvgOMSxmeWg5OeQHz2+uwXn65 5RHb3xADCjDX9qE7Ngl6RbI7jKNc9yK6BfG5gS9o9hrTBk3JAqkYbTMa8UssIFkKVayZ fYd8NY/0tZAS+uK1EFfXiDw3NRFWKaQFQTp11OrChxxWQL+DqU7cilP3/H9ha9tBHWJS tQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3s9nxkvptg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 07 Aug 2023 06:06:28 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 7 Aug 2023 06:06:26 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Mon, 7 Aug 2023 06:06:26 -0700 Received: from localhost.localdomain (unknown [10.28.36.157]) by maili.marvell.com (Postfix) with ESMTP id CF2703F70A0; Mon, 7 Aug 2023 06:06:24 -0700 (PDT) From: Amit Prakash Shukla To: Cheng Jiang CC: , , Amit Prakash Shukla Subject: [PATCH 1/2] app/dma-perf: skip support in dma-perf application Date: Mon, 7 Aug 2023 18:36:20 +0530 Message-ID: <20230807130621.2023043-1-amitprakashs@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: DMi_qBs5uNY3rEEMbgUivCZYfpYJ8ANo X-Proofpoint-ORIG-GUID: DMi_qBs5uNY3rEEMbgUivCZYfpYJ8ANo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-07_13,2023-08-03_01,2023-05-22_02 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 Add support to skip running a dma-perf test-case. Signed-off-by: Amit Prakash Shukla --- 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 e5bccc27da..61260fa072 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; + } + 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 f65e264378..be89cb2b65 100644 --- a/app/test-dma-perf/main.h +++ b/app/test-dma-perf/main.h @@ -41,6 +41,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;