Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/97707/?format=api
https://patches.dpdk.org/api/patches/97707/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210901163216.120087-3-bruce.richardson@intel.com/", "project": { "id": 1, "url": "https://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": "<20210901163216.120087-3-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210901163216.120087-3-bruce.richardson@intel.com", "date": "2021-09-01T16:32:12", "name": "[v2,2/6] app/test: add basic dmadev instance tests", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "58529f3864715961cfebe0bd1fa29479cde8d9fe", "submitter": { "id": 20, "url": "https://patches.dpdk.org/api/people/20/?format=api", "name": "Bruce Richardson", "email": "bruce.richardson@intel.com" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210901163216.120087-3-bruce.richardson@intel.com/mbox/", "series": [ { "id": 18607, "url": "https://patches.dpdk.org/api/series/18607/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=18607", "date": "2021-09-01T16:32:10", "name": "add test suite for DMA drivers", "version": 2, "mbox": "https://patches.dpdk.org/series/18607/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/97707/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/97707/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 A0282A0C47;\n\tWed, 1 Sep 2021 18:32:37 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id CC3FE41149;\n\tWed, 1 Sep 2021 18:32:33 +0200 (CEST)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by mails.dpdk.org (Postfix) with ESMTP id AABBD4113B\n for <dev@dpdk.org>; Wed, 1 Sep 2021 18:32:32 +0200 (CEST)", "from orsmga005.jf.intel.com ([10.7.209.41])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Sep 2021 09:32:32 -0700", "from silpixa00399126.ir.intel.com ([10.237.223.29])\n by orsmga005.jf.intel.com with ESMTP; 01 Sep 2021 09:32:30 -0700" ], "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,10094\"; a=\"198359873\"", "E=Sophos;i=\"5.84,369,1620716400\"; d=\"scan'208\";a=\"198359873\"", "E=Sophos;i=\"5.84,369,1620716400\"; d=\"scan'208\";a=\"645812761\"" ], "X-ExtLoop1": "1", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "dev@dpdk.org", "Cc": "conor.walsh@intel.com, kevin.laatz@intel.com, fengchengwen@huawei.com,\n jerinj@marvell.com, Bruce Richardson <bruce.richardson@intel.com>", "Date": "Wed, 1 Sep 2021 17:32:12 +0100", "Message-Id": "<20210901163216.120087-3-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 2.30.2", "In-Reply-To": "<20210901163216.120087-1-bruce.richardson@intel.com>", "References": "<20210826183301.333442-1-bruce.richardson@intel.com>\n <20210901163216.120087-1-bruce.richardson@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v2 2/6] app/test: add basic dmadev instance tests", "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", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Run basic sanity tests for configuring, starting and stopping a dmadev\ninstance to help validate drivers. This also provides the framework for\nfuture tests for data-path operation.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n app/test/test_dmadev.c | 81 ++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 81 insertions(+)", "diff": "diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c\nindex bb01e86483..12f7c69629 100644\n--- a/app/test/test_dmadev.c\n+++ b/app/test/test_dmadev.c\n@@ -2,6 +2,7 @@\n * Copyright(c) 2021 HiSilicon Limited.\n * Copyright(c) 2021 Intel Corporation.\n */\n+#include <inttypes.h>\n \n #include <rte_common.h>\n #include <rte_dev.h>\n@@ -13,6 +14,77 @@\n /* from test_dmadev_api.c */\n extern int test_dmadev_api(uint16_t dev_id);\n \n+#define PRINT_ERR(...) print_err(__func__, __LINE__, __VA_ARGS__)\n+\n+static inline int\n+__rte_format_printf(3, 4)\n+print_err(const char *func, int lineno, const char *format, ...)\n+{\n+\tva_list ap;\n+\tint ret;\n+\n+\tret = fprintf(stderr, \"In %s:%d - \", func, lineno);\n+\tva_start(ap, format);\n+\tret += vfprintf(stderr, format, ap);\n+\tva_end(ap);\n+\n+\treturn ret;\n+}\n+\n+static int\n+test_dmadev_instance(uint16_t dev_id)\n+{\n+#define TEST_RINGSIZE 512\n+\tstruct rte_dmadev_stats stats;\n+\tstruct rte_dmadev_info info;\n+\tconst struct rte_dmadev_conf conf = { .nb_vchans = 1};\n+\tconst struct rte_dmadev_vchan_conf qconf = {\n+\t\t\t.direction = RTE_DMA_DIR_MEM_TO_MEM,\n+\t\t\t.nb_desc = TEST_RINGSIZE,\n+\t};\n+\tconst int vchan = 0;\n+\n+\tprintf(\"\\n### Test dmadev instance %u\\n\", dev_id);\n+\n+\trte_dmadev_info_get(dev_id, &info);\n+\tif (info.max_vchans < 1) {\n+\t\tPRINT_ERR(\"Error, no channels available on device id %u\\n\", dev_id);\n+\t\treturn -1;\n+\t}\n+\tif (rte_dmadev_configure(dev_id, &conf) != 0) {\n+\t\tPRINT_ERR(\"Error with rte_dmadev_configure()\\n\");\n+\t\treturn -1;\n+\t}\n+\tif (rte_dmadev_vchan_setup(dev_id, vchan, &qconf) < 0) {\n+\t\tPRINT_ERR(\"Error with queue configuration\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\trte_dmadev_info_get(dev_id, &info);\n+\tif (info.nb_vchans != 1) {\n+\t\tPRINT_ERR(\"Error, no configured queues reported on device id %u\\n\", dev_id);\n+\t\treturn -1;\n+\t}\n+\n+\tif (rte_dmadev_start(dev_id) != 0) {\n+\t\tPRINT_ERR(\"Error with rte_dmadev_start()\\n\");\n+\t\treturn -1;\n+\t}\n+\tif (rte_dmadev_stats_get(dev_id, vchan, &stats) != 0) {\n+\t\tPRINT_ERR(\"Error with rte_dmadev_stats_get()\\n\");\n+\t\treturn -1;\n+\t}\n+\tif (stats.completed != 0 || stats.submitted != 0 || stats.errors != 0) {\n+\t\tPRINT_ERR(\"Error device stats are not all zero: completed = %\"PRIu64\", submitted = %\"PRIu64\", errors = %\"PRIu64\"\\n\",\n+\t\t\t\tstats.completed, stats.submitted, stats.errors);\n+\t\treturn -1;\n+\t}\n+\n+\trte_dmadev_stop(dev_id);\n+\trte_dmadev_stats_reset(dev_id, vchan);\n+\treturn 0;\n+}\n+\n static int\n test_apis(void)\n {\n@@ -35,10 +107,19 @@ test_apis(void)\n static int\n test_dmadev(void)\n {\n+\tint i;\n+\n \t/* basic sanity on dmadev infrastructure */\n \tif (test_apis() < 0)\n \t\treturn -1;\n \n+\tif (rte_dmadev_count() == 0)\n+\t\treturn TEST_SKIPPED;\n+\n+\tfor (i = 0; i < RTE_DMADEV_MAX_DEVS; i++)\n+\t\tif (rte_dmadevices[i].state == RTE_DMADEV_ATTACHED && test_dmadev_instance(i) < 0)\n+\t\t\treturn -1;\n+\n \treturn 0;\n }\n \n", "prefixes": [ "v2", "2/6" ] }{ "id": 97707, "url": "