Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/84067/?format=api
http://patches.dpdk.org/api/patches/84067/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201112154902.54383-1-Cheng1.jiang@intel.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": "<20201112154902.54383-1-Cheng1.jiang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20201112154902.54383-1-Cheng1.jiang@intel.com", "date": "2020-11-12T15:49:02", "name": "[v5] examples/vhost: fix ioat dependency issue", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "69553e7ea4388e535675ec39aee21b6db62c46c1", "submitter": { "id": 1530, "url": "http://patches.dpdk.org/api/people/1530/?format=api", "name": "Jiang, Cheng1", "email": "Cheng1.jiang@intel.com" }, "delegate": { "id": 2642, "url": "http://patches.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20201112154902.54383-1-Cheng1.jiang@intel.com/mbox/", "series": [ { "id": 13847, "url": "http://patches.dpdk.org/api/series/13847/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13847", "date": "2020-11-12T15:49:02", "name": "[v5] examples/vhost: fix ioat dependency issue", "version": 5, "mbox": "http://patches.dpdk.org/series/13847/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/84067/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/84067/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 92284A09D3;\n\tThu, 12 Nov 2020 16:58:17 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A735C5AB3;\n\tThu, 12 Nov 2020 16:58:15 +0100 (CET)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by dpdk.org (Postfix) with ESMTP id 9A2FD56A3\n for <dev@dpdk.org>; Thu, 12 Nov 2020 16:58:14 +0100 (CET)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 12 Nov 2020 07:58:09 -0800", "from dpdk_jiangcheng.sh.intel.com ([10.67.119.112])\n by fmsmga006.fm.intel.com with ESMTP; 12 Nov 2020 07:58:07 -0800" ], "IronPort-SDR": [ "\n 6C/+IXwYrThg+rVs0hm3P3gzCWpI7hqiN/rPrt2c4AY/lM0r9pFJ9KGEfzomzexTce7mX9kiT9\n JEI77yNFZAgw==", "\n 4nxiOprSM/VM+1SK2raElopb77J180/5jmhgkBkfFR5QBUDVoVPatfmXrrbI0JL8trU6ucwql2\n SdRKM3uwF5Kw==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9803\"; a=\"150179741\"", "E=Sophos;i=\"5.77,472,1596524400\"; d=\"scan'208\";a=\"150179741\"", "E=Sophos;i=\"5.77,472,1596524400\"; d=\"scan'208\";a=\"530721775\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Cheng Jiang <Cheng1.jiang@intel.com>", "To": "maxime.coquelin@redhat.com,\n\tchenbo.xia@intel.com", "Cc": "dev@dpdk.org, patrick.fu@intel.com, YvonneX.Yang@intel.com,\n david.marchand@redhat.com, bruce.richardson@intel.com, Jiayu.Hu@intel.com,\n Cheng Jiang <Cheng1.jiang@intel.com>", "Date": "Thu, 12 Nov 2020 15:49:02 +0000", "Message-Id": "<20201112154902.54383-1-Cheng1.jiang@intel.com>", "X-Mailer": "git-send-email 2.29.2", "In-Reply-To": "<20201111111957.46090-1-Cheng1.jiang@intel.com>", "References": "<20201111111957.46090-1-Cheng1.jiang@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v5] examples/vhost: fix ioat dependency issue", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "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": "Fix vhost-switch compiling issue when ioat dependency is missing.\nChange 'RTE_x86' check into 'RTE_RAW_IOAT' check in meson build file.\nUse 'RTE_RAW_IOAT' to control conditional compiling in source file.\nClean some codes.\n\nFixes: abec60e7115d (\"examples/vhost: support vhost async data path\")\nFixes: 3a04ecb21420 (\"examples/vhost: add async vhost args parsing\")\n\nSigned-off-by: Cheng Jiang <Cheng1.jiang@intel.com>\n---\nv5:\n * Cleaned macro conditional compilation in ioat.c.\n\nv4:\n * Use macros in ioat.c for conditional compilation instead of changing Makefile.\n\nv3:\n * Added fixes lines in commit log.\n\nv2:\n * Cleaned some codes\n * Changed RTE_RAW_IOAT check method in Makefile\n * Added ioat function definition when RTE_RAW_IOAT is missing\n\n examples/vhost/Makefile | 2 +-\n examples/vhost/ioat.c | 6 +++++-\n examples/vhost/ioat.h | 32 +++++++++++++++++++++++++-------\n examples/vhost/main.c | 22 +++++++++++-----------\n examples/vhost/meson.build | 2 +-\n 5 files changed, 43 insertions(+), 21 deletions(-)\n\n--\n2.29.2", "diff": "diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile\nindex cec59d0e0..8c969caaa 100644\n--- a/examples/vhost/Makefile\n+++ b/examples/vhost/Makefile\n@@ -5,7 +5,7 @@\n APP = vhost-switch\n\n # all source are stored in SRCS-y\n-SRCS-y := main.c virtio_net.c\n+SRCS-y := main.c virtio_net.c ioat.c\n\n # Build using pkg-config variables if possible\n ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)\ndiff --git a/examples/vhost/ioat.c b/examples/vhost/ioat.c\nindex b2c74f653..fcd0597ea 100644\n--- a/examples/vhost/ioat.c\n+++ b/examples/vhost/ioat.c\n@@ -1,9 +1,11 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n * Copyright(c) 2010-2020 Intel Corporation\n */\n+\n+#include <sys/uio.h>\n+#ifdef RTE_RAW_IOAT\n #include <rte_rawdev.h>\n #include <rte_ioat_rawdev.h>\n-#include <sys/uio.h>\n\n #include \"ioat.h\"\n #include \"main.h\"\n@@ -199,3 +201,5 @@ ioat_check_completed_copies_cb(int vid, uint16_t queue_id,\n \t/* Opaque data is not supported */\n \treturn -1;\n }\n+\n+#endif /* RTE_RAW_IOAT */\ndiff --git a/examples/vhost/ioat.h b/examples/vhost/ioat.h\nindex 9664fcc3a..d6e1e2e07 100644\n--- a/examples/vhost/ioat.h\n+++ b/examples/vhost/ioat.h\n@@ -24,14 +24,8 @@ struct dma_for_vhost {\n \tuint16_t nr;\n };\n\n-#ifdef RTE_ARCH_X86\n+#ifdef RTE_RAW_IOAT\n int open_ioat(const char *value);\n-#else\n-static int open_ioat(const char *value __rte_unused)\n-{\n-\treturn -1;\n-}\n-#endif\n\n uint32_t\n ioat_transfer_data_cb(int vid, uint16_t queue_id,\n@@ -42,4 +36,28 @@ uint32_t\n ioat_check_completed_copies_cb(int vid, uint16_t queue_id,\n \t\tstruct rte_vhost_async_status *opaque_data,\n \t\tuint16_t max_packets);\n+#else\n+static int open_ioat(const char *value __rte_unused)\n+{\n+\treturn -1;\n+}\n+\n+static uint32_t\n+ioat_transfer_data_cb(int vid __rte_unused, uint16_t queue_id __rte_unused,\n+\t\tstruct rte_vhost_async_desc *descs __rte_unused,\n+\t\tstruct rte_vhost_async_status *opaque_data __rte_unused,\n+\t\tuint16_t count __rte_unused)\n+{\n+\treturn -1;\n+}\n+\n+static uint32_t\n+ioat_check_completed_copies_cb(int vid __rte_unused,\n+\t\tuint16_t queue_id __rte_unused,\n+\t\tstruct rte_vhost_async_status *opaque_data __rte_unused,\n+\t\tuint16_t max_packets __rte_unused)\n+{\n+\treturn -1;\n+}\n+#endif\n #endif /* _IOAT_H_ */\ndiff --git a/examples/vhost/main.c b/examples/vhost/main.c\nindex 59a1aff07..4dc6102ab 100644\n--- a/examples/vhost/main.c\n+++ b/examples/vhost/main.c\n@@ -1294,13 +1294,6 @@ new_device(int vid)\n \tint lcore, core_add = 0;\n \tuint32_t device_num_min = num_devices;\n \tstruct vhost_dev *vdev;\n-\n-\tstruct rte_vhost_async_channel_ops channel_ops = {\n-\t\t.transfer_data = ioat_transfer_data_cb,\n-\t\t.check_completed_copies = ioat_check_completed_copies_cb\n-\t};\n-\tstruct rte_vhost_async_features f;\n-\n \tvdev = rte_zmalloc(\"vhost device\", sizeof(*vdev), RTE_CACHE_LINE_SIZE);\n \tif (vdev == NULL) {\n \t\tRTE_LOG(INFO, VHOST_DATA,\n@@ -1342,10 +1335,17 @@ new_device(int vid)\n \t\tvid, vdev->coreid);\n\n \tif (async_vhost_driver) {\n-\t\tf.async_inorder = 1;\n-\t\tf.async_threshold = 256;\n-\t\treturn rte_vhost_async_channel_register(vid, VIRTIO_RXQ,\n-\t\t\tf.intval, &channel_ops);\n+\t\tstruct rte_vhost_async_features f;\n+\t\tstruct rte_vhost_async_channel_ops channel_ops;\n+\t\tif (strncmp(dma_type, \"ioat\", 4) == 0) {\n+\t\t\tchannel_ops.transfer_data = ioat_transfer_data_cb;\n+\t\t\tchannel_ops.check_completed_copies =\n+\t\t\t\tioat_check_completed_copies_cb;\n+\t\t\tf.async_inorder = 1;\n+\t\t\tf.async_threshold = 256;\n+\t\t\treturn rte_vhost_async_channel_register(vid, VIRTIO_RXQ,\n+\t\t\t\tf.intval, &channel_ops);\n+\t\t}\n \t}\n\n \treturn 0;\ndiff --git a/examples/vhost/meson.build b/examples/vhost/meson.build\nindex 24f1f7131..d5388a795 100644\n--- a/examples/vhost/meson.build\n+++ b/examples/vhost/meson.build\n@@ -15,7 +15,7 @@ sources = files(\n \t'main.c', 'virtio_net.c'\n )\n\n-if dpdk_conf.has('RTE_ARCH_X86')\n+if dpdk_conf.has('RTE_RAW_IOAT')\n \tdeps += 'raw_ioat'\n \tsources += files('ioat.c')\n endif\n", "prefixes": [ "v5" ] }{ "id": 84067, "url": "