Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/129934/?format=api
http://patches.dpdk.org/api/patches/129934/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230807130621.2023043-2-amitprakashs@marvell.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20230807130621.2023043-2-amitprakashs@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230807130621.2023043-2-amitprakashs@marvell.com", "date": "2023-08-07T13:06:21", "name": "[2/2] app/dma-perf: add PCI device support", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "b1ae97cd25235827575e44ced77d2d1ecdd4f1fb", "submitter": { "id": 2699, "url": "http://patches.dpdk.org/api/people/2699/?format=api", "name": "Amit Prakash Shukla", "email": "amitprakashs@marvell.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230807130621.2023043-2-amitprakashs@marvell.com/mbox/", "series": [ { "id": 29122, "url": "http://patches.dpdk.org/api/series/29122/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=29122", "date": "2023-08-07T13:06:20", "name": "[1/2] app/dma-perf: skip support in dma-perf application", "version": 1, "mbox": "http://patches.dpdk.org/series/29122/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/129934/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/129934/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id D9B9342FFE;\n\tMon, 7 Aug 2023 15:06:42 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C75AD43254;\n\tMon, 7 Aug 2023 15:06:42 +0200 (CEST)", "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 7804140A8B\n for <dev@dpdk.org>; Mon, 7 Aug 2023 15:06:40 +0200 (CEST)", "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 3775pbRI011295; Mon, 7 Aug 2023 06:06:39 -0700", "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3s9nxkvpub-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Mon, 07 Aug 2023 06:06:39 -0700", "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Mon, 7 Aug 2023 06:06:37 -0700", "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Mon, 7 Aug 2023 06:06:37 -0700", "from localhost.localdomain (unknown [10.28.36.157])\n by maili.marvell.com (Postfix) with ESMTP id BFAE73F70A7;\n Mon, 7 Aug 2023 06:06:35 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=JB6l4gGg2lbv9JR0ycrKndfutHsXRuLjjo8VR0baCO4=;\n b=ON9TEvxHBW4h/c+9b195BmRaRjybVmx4DYolItkJqWziuezTrNG9GW/uA0lQd9BPjei3\n F/ttxkKPJyXgrV2UVTSiBT1enXK21AL7PJvTaNdWwaMXf99sPs0EzDF0UfdR/ajNhp6c\n D7gbdG3vq7rmEfCpHmCOSIkd84Y/WPGnMH2tAclKnTI6V3fP+yB0uEgB+rpH2fcdzf90\n AFhS4IH1YLweW11ICZ+PlxMon3NGD/BowxddtZCLhIB/JfpMdwMQQXDN9+K+shHaKTNh\n GgpDE3TjHOYLRJ5NbPrmlP63/0/PlLGCqmoA/OAM8xzsRyTNm1gLmrcRee2IZOKtFsak uw==", "From": "Amit Prakash Shukla <amitprakashs@marvell.com>", "To": "Cheng Jiang <cheng1.jiang@intel.com>", "CC": "<dev@dpdk.org>, <jerinj@marvell.com>, Amit Prakash Shukla\n <amitprakashs@marvell.com>", "Subject": "[PATCH 2/2] app/dma-perf: add PCI device support", "Date": "Mon, 7 Aug 2023 18:36:21 +0530", "Message-ID": "<20230807130621.2023043-2-amitprakashs@marvell.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20230807130621.2023043-1-amitprakashs@marvell.com>", "References": "<20230807130621.2023043-1-amitprakashs@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-GUID": "yEcCrN_oU5paxi3ysWTwfn3FSPJurJIs", "X-Proofpoint-ORIG-GUID": "yEcCrN_oU5paxi3ysWTwfn3FSPJurJIs", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26\n 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 <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "Add support to test performance for \"device to memory\" and\n\"memory to device\" data transfer.\n\nSigned-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>\n---\n app/test-dma-perf/benchmark.c | 67 +++++++++++++++++++++++++++++++----\n app/test-dma-perf/config.ini | 37 +++++++++++++++++++\n app/test-dma-perf/main.c | 67 +++++++++++++++++++++++++++++++++++\n app/test-dma-perf/main.h | 6 ++++\n 4 files changed, 170 insertions(+), 7 deletions(-)", "diff": "diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c\nindex 0601e0d171..523f2fbb5a 100644\n--- a/app/test-dma-perf/benchmark.c\n+++ b/app/test-dma-perf/benchmark.c\n@@ -127,17 +127,54 @@ cache_flush_buf(__rte_unused struct rte_mbuf **array,\n #endif\n }\n \n+static int\n+vchan_data_populate(uint32_t dev_id, struct rte_dma_vchan_conf *qconf,\n+\t\t struct test_configure *cfg)\n+{\n+\tstruct rte_dma_info info;\n+\n+\tqconf->direction = cfg->transfer_dir;\n+\n+\trte_dma_info_get(dev_id, &info);\n+\tif (!(RTE_BIT64(qconf->direction) & info.dev_capa))\n+\t\treturn -1;\n+\n+\tqconf->nb_desc = cfg->ring_size.cur;\n+\n+\tswitch (qconf->direction) {\n+\tcase RTE_DMA_DIR_MEM_TO_DEV:\n+\t\tqconf->dst_port.pcie.vfen = 1;\n+\t\tqconf->dst_port.port_type = RTE_DMA_PORT_PCIE;\n+\t\tqconf->dst_port.pcie.coreid = cfg->dcoreid;\n+\t\tqconf->dst_port.pcie.vfid = cfg->vfid;\n+\t\tqconf->dst_port.pcie.pfid = cfg->pfid;\n+\t\tbreak;\n+\tcase RTE_DMA_DIR_DEV_TO_MEM:\n+\t\tqconf->src_port.pcie.vfen = 1;\n+\t\tqconf->src_port.port_type = RTE_DMA_PORT_PCIE;\n+\t\tqconf->src_port.pcie.coreid = cfg->scoreid;\n+\t\tqconf->src_port.pcie.vfid = cfg->vfid;\n+\t\tqconf->src_port.pcie.pfid = cfg->pfid;\n+\t\tbreak;\n+\tcase RTE_DMA_DIR_MEM_TO_MEM:\n+\tcase RTE_DMA_DIR_DEV_TO_DEV:\n+\t\tbreak;\n+\t}\n+\n+\treturn 0;\n+}\n+\n /* Configuration of device. */\n static void\n-configure_dmadev_queue(uint32_t dev_id, uint32_t ring_size)\n+configure_dmadev_queue(uint32_t dev_id, struct test_configure *cfg)\n {\n \tuint16_t vchan = 0;\n \tstruct rte_dma_info info;\n \tstruct rte_dma_conf dev_config = { .nb_vchans = 1 };\n-\tstruct rte_dma_vchan_conf qconf = {\n-\t\t.direction = RTE_DMA_DIR_MEM_TO_MEM,\n-\t\t.nb_desc = ring_size\n-\t};\n+\tstruct rte_dma_vchan_conf qconf = { 0 };\n+\n+\tif (vchan_data_populate(dev_id, &qconf, cfg) != 0)\n+\t\trte_exit(EXIT_FAILURE, \"Error with vchan data populate.\\n\");\n \n \tif (rte_dma_configure(dev_id, &dev_config) != 0)\n \t\trte_exit(EXIT_FAILURE, \"Error with dma configure.\\n\");\n@@ -159,7 +196,6 @@ configure_dmadev_queue(uint32_t dev_id, uint32_t ring_size)\n static int\n config_dmadevs(struct test_configure *cfg)\n {\n-\tuint32_t ring_size = cfg->ring_size.cur;\n \tstruct lcore_dma_map_t *ldm = &cfg->lcore_dma_map;\n \tuint32_t nb_workers = ldm->cnt;\n \tuint32_t i;\n@@ -176,7 +212,7 @@ config_dmadevs(struct test_configure *cfg)\n \t\t}\n \n \t\tldm->dma_ids[i] = dev_id;\n-\t\tconfigure_dmadev_queue(dev_id, ring_size);\n+\t\tconfigure_dmadev_queue(dev_id, cfg);\n \t\t++nb_dmadevs;\n \t}\n \n@@ -308,6 +344,7 @@ setup_memory_env(struct test_configure *cfg, struct rte_mbuf ***srcs,\n \tunsigned int buf_size = cfg->buf_size.cur;\n \tunsigned int nr_sockets;\n \tuint32_t nr_buf = cfg->nr_buf;\n+\tuint32_t i;\n \n \tnr_sockets = rte_socket_count();\n \tif (cfg->src_numa_node >= nr_sockets ||\n@@ -360,6 +397,22 @@ setup_memory_env(struct test_configure *cfg, struct rte_mbuf ***srcs,\n \t\treturn -1;\n \t}\n \n+\tif (cfg->transfer_dir == RTE_DMA_DIR_DEV_TO_MEM) {\n+\t\tfor (i = 0; i < nr_buf; i++) {\n+\t\t\t/* Using mbuf structure to hold remote iova address. */\n+\t\t\trte_mbuf_iova_set(*srcs[i], (rte_iova_t)cfg->raddr);\n+\t\t\t((*srcs)[i])->data_off = 0;\n+\t\t}\n+\t}\n+\n+\tif (cfg->transfer_dir == RTE_DMA_DIR_MEM_TO_DEV) {\n+\t\tfor (i = 0; i < nr_buf; i++) {\n+\t\t\t/* Using mbuf structure to hold remote iova address. */\n+\t\t\trte_mbuf_iova_set(*dsts[i], (rte_iova_t)cfg->raddr);\n+\t\t\t((*dsts)[i])->data_off = 0;\n+\t\t}\n+\t}\n+\n \treturn 0;\n }\n \ndiff --git a/app/test-dma-perf/config.ini b/app/test-dma-perf/config.ini\nindex 4d59234b2a..cddcf93c6e 100644\n--- a/app/test-dma-perf/config.ini\n+++ b/app/test-dma-perf/config.ini\n@@ -38,6 +38,23 @@\n \n ; \"skip\" To skip a test-case set skip to 1.\n \n+; Parameters to be configured for data transfers from \"mem to dev\" and \"dev to mem\":\n+; ==================================================================================\n+; \"direction\" denotes the direction of data transfer. It can take 3 values:\n+; 0 - mem to mem transfer\n+; 1 - mem to dev transfer\n+; 2 - dev to mem transfer\n+; If not specified the default value is 0 (mem to mem transfer).\n+\n+; \"raddr\" remote iova address for \"mem to dev\" and \"dev to mem\" transfer.\n+\n+; \"scoreid\" denotes source PCIe core index.\n+; \"dcoreid\" denotes destination PCIe core index.\n+; \"pfid\" denotes PF-id to be used for data transfer\n+; \"vfid\" denotes VF-id of PF-id to be used for data transfer.\n+\n+; =========== End of \"mem to dev\" and \"dev to mem\" config parameters. ==============\n+\n [case1]\n type=DMA_MEM_COPY\n mem_size=10\n@@ -52,6 +69,26 @@ lcore_dma=lcore10@0000:00:04.2, lcore11@0000:00:04.3\n eal_args=--in-memory --file-prefix=test\n \n [case2]\n+skip=1\n+type=DMA_MEM_COPY\n+direction=2\n+raddr=0x200000000\n+scoreid=0\n+dcoreid=0\n+pfid=0\n+vfid=0\n+mem_size=10\n+buf_size=64,4096,2,MUL\n+dma_ring_size=1024\n+kick_batch=32\n+src_numa_node=0\n+dst_numa_node=0\n+cache_flush=0\n+test_seconds=2\n+lcore_dma=lcore10@0000:00:04.2, lcore11@0000:00:04.3\n+eal_args=--in-memory --file-prefix=test\n+\n+[case3]\n type=CPU_MEM_COPY\n mem_size=10\n buf_size=64,8192,2,MUL\ndiff --git a/app/test-dma-perf/main.c b/app/test-dma-perf/main.c\nindex 61260fa072..9640356592 100644\n--- a/app/test-dma-perf/main.c\n+++ b/app/test-dma-perf/main.c\n@@ -16,6 +16,7 @@\n #include <rte_cfgfile.h>\n #include <rte_string_fns.h>\n #include <rte_lcore.h>\n+#include <rte_dmadev.h>\n \n #include \"main.h\"\n \n@@ -318,9 +319,11 @@ load_configs(const char *path)\n \tstruct test_configure *test_case;\n \tchar section_name[CFG_NAME_LEN];\n \tconst char *case_type;\n+\tconst char *transfer_dir;\n \tconst char *lcore_dma;\n \tconst char *mem_size_str, *buf_size_str, *ring_size_str, *kick_batch_str;\n \tconst char *skip;\n+\tconst char *raddr, *scoreid, *dcoreid, *vfid, *pfid;\n \tint args_nr, nb_vp;\n \tbool is_dma;\n \n@@ -358,6 +361,20 @@ load_configs(const char *path)\n \t\tif (strcmp(case_type, DMA_MEM_COPY) == 0) {\n \t\t\ttest_case->test_type = TEST_TYPE_DMA_MEM_COPY;\n \t\t\ttest_case->test_type_str = DMA_MEM_COPY;\n+\n+\t\t\ttransfer_dir = rte_cfgfile_get_entry(cfgfile, section_name, \"direction\");\n+\t\t\tif (transfer_dir == NULL) {\n+\t\t\t\tprintf(\"Transfer direction not configured.\"\n+\t\t\t\t\t\" Defaulting it to MEM to MEM transfer.\\n\");\n+\t\t\t\ttest_case->transfer_dir = RTE_DMA_DIR_MEM_TO_MEM;\n+\t\t\t} else\n+\t\t\t\ttest_case->transfer_dir = (uint8_t)atoi(transfer_dir);\n+\n+\t\t\tif (test_case->transfer_dir >= RTE_DMA_DIR_DEV_TO_DEV) {\n+\t\t\t\tprintf(\"Error: Invalid transfer direction configured.\\n\");\n+\t\t\t\ttest_case->is_valid = false;\n+\t\t\t\tcontinue;\n+\t\t\t}\n \t\t\tis_dma = true;\n \t\t} else if (strcmp(case_type, CPU_MEM_COPY) == 0) {\n \t\t\ttest_case->test_type = TEST_TYPE_CPU_MEM_COPY;\n@@ -369,6 +386,56 @@ load_configs(const char *path)\n \t\t\tcontinue;\n \t\t}\n \n+\t\tif (test_case->transfer_dir == RTE_DMA_DIR_MEM_TO_DEV ||\n+\t\t\ttest_case->transfer_dir == RTE_DMA_DIR_DEV_TO_MEM) {\n+\t\t\tchar *endptr;\n+\n+\t\t\traddr = rte_cfgfile_get_entry(cfgfile, section_name, \"raddr\");\n+\t\t\tif (raddr == NULL) {\n+\t\t\t\tprintf(\"Error: No raddr configured for case%d.\\n\", i + 1);\n+\t\t\t\ttest_case->is_valid = false;\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\ttest_case->raddr = strtoull(raddr, &endptr, 16);\n+\n+\t\t\tvfid = rte_cfgfile_get_entry(cfgfile, section_name, \"vfid\");\n+\t\t\tif (vfid == NULL) {\n+\t\t\t\tprintf(\"Error: No vfid configured for case%d.\\n\", i + 1);\n+\t\t\t\ttest_case->is_valid = false;\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\ttest_case->vfid = (uint16_t)atoi(vfid);\n+\n+\t\t\tpfid = rte_cfgfile_get_entry(cfgfile, section_name, \"pfid\");\n+\t\t\tif (pfid == NULL) {\n+\t\t\t\tprintf(\"Error: No pfid configured for case%d.\\n\", i + 1);\n+\t\t\t\ttest_case->is_valid = false;\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\ttest_case->pfid = (uint8_t)atoi(pfid);\n+\n+\t\t}\n+\n+\t\tif (test_case->transfer_dir == RTE_DMA_DIR_DEV_TO_MEM) {\n+\t\t\tscoreid = rte_cfgfile_get_entry(cfgfile, section_name, \"scoreid\");\n+\t\t\tif (scoreid == NULL) {\n+\t\t\t\tprintf(\"Error: No scoreid configured for case%d.\\n\", i + 1);\n+\t\t\t\ttest_case->is_valid = false;\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\ttest_case->scoreid = (uint8_t)atoi(scoreid);\n+\t\t}\n+\n+\t\tif (test_case->transfer_dir == RTE_DMA_DIR_MEM_TO_DEV) {\n+\t\t\tdcoreid = rte_cfgfile_get_entry(cfgfile, section_name, \"dcoreid\");\n+\t\t\tif (dcoreid == NULL) {\n+\t\t\t\tprintf(\"Error: No dcoreid configured for case%d.\\n\", i + 1);\n+\t\t\t\ttest_case->is_valid = false;\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\ttest_case->dcoreid = (uint8_t)atoi(dcoreid);\n+\t\t}\n+\n \t\ttest_case->src_numa_node = (int)atoi(rte_cfgfile_get_entry(cfgfile,\n \t\t\t\t\t\t\t\tsection_name, \"src_numa_node\"));\n \t\ttest_case->dst_numa_node = (int)atoi(rte_cfgfile_get_entry(cfgfile,\ndiff --git a/app/test-dma-perf/main.h b/app/test-dma-perf/main.h\nindex be89cb2b65..617f62f085 100644\n--- a/app/test-dma-perf/main.h\n+++ b/app/test-dma-perf/main.h\n@@ -43,6 +43,7 @@ struct test_configure {\n \tbool is_valid;\n \tbool is_skip;\n \tuint8_t test_type;\n+\tuint8_t transfer_dir;\n \tconst char *test_type_str;\n \tuint16_t src_numa_node;\n \tuint16_t dst_numa_node;\n@@ -58,6 +59,11 @@ struct test_configure {\n \tuint16_t test_secs;\n \tconst char *eal_args;\n \tuint8_t scenario_id;\n+\tuint8_t scoreid;\n+\tuint8_t dcoreid;\n+\tuint8_t pfid;\n+\tuint16_t vfid;\n+\tuint64_t raddr;\n };\n \n void mem_copy_benchmark(struct test_configure *cfg, bool is_dma);\n", "prefixes": [ "2/2" ] }{ "id": 129934, "url": "