Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/74548/?format=api
https://patches.dpdk.org/api/patches/74548/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200721095140.719297-10-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": "<20200721095140.719297-10-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200721095140.719297-10-bruce.richardson@intel.com", "date": "2020-07-21T09:51:29", "name": "[20.11,09/20] raw/ioat: add vdev probe for DSA/idxd devices", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "a94653f8713873ad7a8d97021bffd73dffc171ba", "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/20200721095140.719297-10-bruce.richardson@intel.com/mbox/", "series": [ { "id": 11200, "url": "https://patches.dpdk.org/api/series/11200/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11200", "date": "2020-07-21T09:51:20", "name": "raw/ioat: enhancements and new hardware support", "version": 1, "mbox": "https://patches.dpdk.org/series/11200/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/74548/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/74548/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 CF523A0526;\n\tTue, 21 Jul 2020 11:53:29 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 626031C02A;\n\tTue, 21 Jul 2020 11:53:17 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by dpdk.org (Postfix) with ESMTP id 91C4B1C02A\n for <dev@dpdk.org>; Tue, 21 Jul 2020 11:53:13 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Jul 2020 02:53:13 -0700", "from silpixa00399126.ir.intel.com ([10.237.222.36])\n by fmsmga005.fm.intel.com with ESMTP; 21 Jul 2020 02:53:11 -0700" ], "IronPort-SDR": [ "\n Vv9yHgdfCJnqwLa+8LfCtpFz0udLw0ohK2ZBapNwAIIoWh1HWl64PIz7J3WV6Ga5m97GoV/QJm\n wj0XFdhMLV0Q==", "\n BXkmIKEHRNcLmhO/VJmPs9y62VOzEbDgJ9rYN+YVvcsvjMVJ+vhgHxTlSpRlaEG5WPrAI7Ft1D\n obnWSVlvSxIw==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9688\"; a=\"138191214\"", "E=Sophos;i=\"5.75,378,1589266800\"; d=\"scan'208\";a=\"138191214\"", "E=Sophos;i=\"5.75,378,1589266800\"; d=\"scan'208\";a=\"488023880\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "dev@dpdk.org", "Cc": "cheng1.jiang@intel.com, patrick.fu@intel.com, kevin.laatz@intel.com,\n Bruce Richardson <bruce.richardson@intel.com>", "Date": "Tue, 21 Jul 2020 10:51:29 +0100", "Message-Id": "<20200721095140.719297-10-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20200721095140.719297-1-bruce.richardson@intel.com>", "References": "<20200721095140.719297-1-bruce.richardson@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH 20.11 09/20] raw/ioat: add vdev probe for\n\tDSA/idxd devices", "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": "From: Kevin Laatz <kevin.laatz@intel.com>\n\nThe Intel DSA devices can be exposed to userspace via kernel driver, so can\nbe used without having to bind them to vfio/uio. Therefore we add support\nfor using those kernel-configured devices as vdevs, taking as parameter the\nindividual HW work queue to be used by the vdev.\n\nSigned-off-by: Kevin Laatz <kevin.laatz@intel.com>\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n drivers/raw/ioat/idxd_vdev.c | 127 +++++++++++++++++++++++++++++++++++\n drivers/raw/ioat/meson.build | 6 +-\n 2 files changed, 132 insertions(+), 1 deletion(-)\n create mode 100644 drivers/raw/ioat/idxd_vdev.c", "diff": "diff --git a/drivers/raw/ioat/idxd_vdev.c b/drivers/raw/ioat/idxd_vdev.c\nnew file mode 100644\nindex 000000000..73fce6d87\n--- /dev/null\n+++ b/drivers/raw/ioat/idxd_vdev.c\n@@ -0,0 +1,127 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2020 Intel Corporation\n+ */\n+\n+#include <rte_bus_vdev.h>\n+#include <rte_kvargs.h>\n+#include <rte_string_fns.h>\n+#include <rte_rawdev_pmd.h>\n+\n+#include \"ioat_private.h\"\n+\n+/** Name of the device driver */\n+#define IDXD_PMD_RAWDEV_NAME rawdev_idxd\n+/* takes a work queue(WQ) as parameter */\n+#define IDXD_ARG_WQ\t\t\"wq\"\n+\n+extern struct rte_vdev_driver idxd_rawdev_drv_vdev;\n+\n+static const char * const valid_args[] = {\n+\tIDXD_ARG_WQ,\n+\tNULL\n+};\n+\n+struct idxd_vdev_args {\n+\tuint8_t device_id;\n+\tuint8_t wq_id;\n+};\n+\n+static int\n+idxd_rawdev_parse_wq(const char *key __rte_unused, const char *value,\n+\t\t\t void *extra_args)\n+{\n+\tstruct idxd_vdev_args *args = (struct idxd_vdev_args *)extra_args;\n+\tint dev, wq, bytes = -1;\n+\tint read = sscanf(value, \"%d.%d%n\", &dev, &wq, &bytes);\n+\n+\tif (read != 2 || bytes != (int)strlen(value)) {\n+\t\tIOAT_PMD_ERR(\"Error parsing work-queue id. Must be in <dev_id>.<queue_id> format\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (dev >= UINT8_MAX || wq >= UINT8_MAX) {\n+\t\tIOAT_PMD_ERR(\"Device or work queue id out of range\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\targs->device_id = dev;\n+\targs->wq_id = wq;\n+\n+\treturn 0;\n+}\n+\n+static int\n+idxd_vdev_parse_params(struct rte_kvargs *kvlist, struct idxd_vdev_args *args)\n+{\n+\tif (rte_kvargs_count(kvlist, IDXD_ARG_WQ) == 1) {\n+\t\tif (rte_kvargs_process(kvlist, IDXD_ARG_WQ,\n+\t\t\t\t&idxd_rawdev_parse_wq, args) < 0) {\n+\t\t\tIOAT_PMD_ERR(\"Error parsing %s\", IDXD_ARG_WQ);\n+\t\t\tgoto free;\n+\t\t}\n+\t} else {\n+\t\tIOAT_PMD_ERR(\"%s is a mandatory arg\", IDXD_ARG_WQ);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn 0;\n+\n+free:\n+\tif (kvlist)\n+\t\trte_kvargs_free(kvlist);\n+\treturn -EINVAL;\n+}\n+\n+static int\n+idxd_rawdev_probe_vdev(struct rte_vdev_device *vdev)\n+{\n+\tstruct rte_kvargs *kvlist;\n+\tstruct idxd_vdev_args vdev_args;\n+\tconst char *name;\n+\tint ret = 0;\n+\n+\tname = rte_vdev_device_name(vdev);\n+\tif (name == NULL)\n+\t\treturn -EINVAL;\n+\n+\tIOAT_PMD_INFO(\"Initializing pmd_idxd for %s\", name);\n+\n+\tkvlist = rte_kvargs_parse(rte_vdev_device_args(vdev), valid_args);\n+\tif (kvlist == NULL) {\n+\t\tIOAT_PMD_ERR(\"Invalid kvargs key\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tret = idxd_vdev_parse_params(kvlist, &vdev_args);\n+\tif (ret) {\n+\t\tIOAT_PMD_ERR(\"Failed to parse kvargs\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tvdev->device.driver = &idxd_rawdev_drv_vdev.driver;\n+\n+\treturn 0;\n+}\n+\n+static int\n+idxd_rawdev_remove_vdev(struct rte_vdev_device *vdev)\n+{\n+\tconst char *name;\n+\n+\tname = rte_vdev_device_name(vdev);\n+\tif (name == NULL)\n+\t\treturn -EINVAL;\n+\n+\tIOAT_PMD_INFO(\"Remove DSA vdev %p\", name);\n+\n+\treturn 0;\n+}\n+\n+struct rte_vdev_driver idxd_rawdev_drv_vdev = {\n+\t.probe = idxd_rawdev_probe_vdev,\n+\t.remove = idxd_rawdev_remove_vdev,\n+};\n+\n+RTE_PMD_REGISTER_VDEV(IDXD_PMD_RAWDEV_NAME, idxd_rawdev_drv_vdev);\n+RTE_PMD_REGISTER_PARAM_STRING(IDXD_PMD_RAWDEV_NAME,\n+\t\t\t \"wq=<string>\");\ndiff --git a/drivers/raw/ioat/meson.build b/drivers/raw/ioat/meson.build\nindex 3529635e9..b343b7367 100644\n--- a/drivers/raw/ioat/meson.build\n+++ b/drivers/raw/ioat/meson.build\n@@ -5,9 +5,13 @@ build = dpdk_conf.has('RTE_ARCH_X86')\n reason = 'only supported on x86'\n sources = files(\n \t'idxd_pci.c',\n+\t'idxd_vdev.c',\n \t'ioat_rawdev.c',\n \t'ioat_rawdev_test.c')\n-deps += ['rawdev', 'bus_pci', 'mbuf']\n+deps += ['bus_pci',\n+\t'bus_vdev',\n+\t'mbuf',\n+\t'rawdev']\n \n install_headers('rte_ioat_rawdev.h',\n \t\t'rte_ioat_rawdev_fns.h')\n", "prefixes": [ "20.11", "09/20" ] }{ "id": 74548, "url": "