get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/102006/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 102006,
    "url": "http://patches.dpdk.org/api/patches/102006/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211018123835.1080174-2-conor.walsh@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": "<20211018123835.1080174-2-conor.walsh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211018123835.1080174-2-conor.walsh@intel.com",
    "date": "2021-10-18T12:38:24",
    "name": "[v8,01/12] dma/ioat: add device probe and removal functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "749426a5acc8205eed1d17226184b669e1ac1ae3",
    "submitter": {
        "id": 1935,
        "url": "http://patches.dpdk.org/api/people/1935/?format=api",
        "name": "Conor Walsh",
        "email": "conor.walsh@intel.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/20211018123835.1080174-2-conor.walsh@intel.com/mbox/",
    "series": [
        {
            "id": 19738,
            "url": "http://patches.dpdk.org/api/series/19738/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19738",
            "date": "2021-10-18T12:38:23",
            "name": "dma: add dmadev driver for ioat devices",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/19738/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/102006/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/102006/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 27052A0C43;\n\tMon, 18 Oct 2021 14:38:51 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2DEB7410F7;\n\tMon, 18 Oct 2021 14:38:46 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id BDF0940141\n for <dev@dpdk.org>; Mon, 18 Oct 2021 14:38:43 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 18 Oct 2021 05:38:43 -0700",
            "from silpixa00401160.ir.intel.com ([10.55.129.96])\n by orsmga005.jf.intel.com with ESMTP; 18 Oct 2021 05:38:40 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10140\"; a=\"228117623\"",
            "E=Sophos;i=\"5.85,382,1624345200\"; d=\"scan'208\";a=\"228117623\"",
            "E=Sophos;i=\"5.85,382,1624345200\"; d=\"scan'208\";a=\"661361048\""
        ],
        "X-ExtLoop1": "1",
        "From": "Conor Walsh <conor.walsh@intel.com>",
        "To": "bruce.richardson@intel.com, thomas@monjalon.net, fengchengwen@huawei.com,\n jerinj@marvell.com, kevin.laatz@intel.com",
        "Cc": "dev@dpdk.org,\n\tConor Walsh <conor.walsh@intel.com>",
        "Date": "Mon, 18 Oct 2021 12:38:24 +0000",
        "Message-Id": "<20211018123835.1080174-2-conor.walsh@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20211018123835.1080174-1-conor.walsh@intel.com>",
        "References": "<20210827172550.1522362-1-conor.walsh@intel.com>\n <20211018123835.1080174-1-conor.walsh@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v8 01/12] dma/ioat: add device probe and removal\n functions",
        "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": "Add the basic device probe/remove skeleton code and initial documentation\nfor new IOAT DMA driver. Maintainers update is also included in this\npatch.\n\nSigned-off-by: Conor Walsh <conor.walsh@intel.com>\nReviewed-by: Kevin Laatz <kevin.laatz@intel.com>\nReviewed-by: Chengwen Feng <fengchengwen@huawei.com>\n---\n MAINTAINERS                            |  6 +++\n doc/guides/dmadevs/index.rst           |  2 +\n doc/guides/dmadevs/ioat.rst            | 69 ++++++++++++++++++++++++++\n doc/guides/rel_notes/release_21_11.rst |  6 +++\n drivers/dma/ioat/ioat_dmadev.c         | 69 ++++++++++++++++++++++++++\n drivers/dma/ioat/ioat_hw_defs.h        | 35 +++++++++++++\n drivers/dma/ioat/ioat_internal.h       | 20 ++++++++\n drivers/dma/ioat/meson.build           |  7 +++\n drivers/dma/ioat/version.map           |  3 ++\n drivers/dma/meson.build                |  1 +\n 10 files changed, 218 insertions(+)\n create mode 100644 doc/guides/dmadevs/ioat.rst\n create mode 100644 drivers/dma/ioat/ioat_dmadev.c\n create mode 100644 drivers/dma/ioat/ioat_hw_defs.h\n create mode 100644 drivers/dma/ioat/ioat_internal.h\n create mode 100644 drivers/dma/ioat/meson.build\n create mode 100644 drivers/dma/ioat/version.map",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 423d8a73ce..283c70f7d7 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -1209,6 +1209,12 @@ M: Kevin Laatz <kevin.laatz@intel.com>\n F: drivers/dma/idxd/\n F: doc/guides/dmadevs/idxd.rst\n \n+Intel IOAT\n+M: Bruce Richardson <bruce.richardson@intel.com>\n+M: Conor Walsh <conor.walsh@intel.com>\n+F: drivers/dma/ioat/\n+F: doc/guides/dmadevs/ioat.rst\n+\n \n RegEx Drivers\n -------------\ndiff --git a/doc/guides/dmadevs/index.rst b/doc/guides/dmadevs/index.rst\nindex 5d4abf880e..c59f4b5c92 100644\n--- a/doc/guides/dmadevs/index.rst\n+++ b/doc/guides/dmadevs/index.rst\n@@ -12,3 +12,5 @@ an application through DMA API.\n    :numbered:\n \n    idxd\n+   ioat\n+\ndiff --git a/doc/guides/dmadevs/ioat.rst b/doc/guides/dmadevs/ioat.rst\nnew file mode 100644\nindex 0000000000..9ae1d8a2ad\n--- /dev/null\n+++ b/doc/guides/dmadevs/ioat.rst\n@@ -0,0 +1,69 @@\n+..  SPDX-License-Identifier: BSD-3-Clause\n+    Copyright(c) 2021 Intel Corporation.\n+\n+.. include:: <isonum.txt>\n+\n+IOAT DMA Device Driver\n+=======================\n+\n+The ``ioat`` dmadev driver provides a poll-mode driver (PMD) for Intel\\\n+|reg| QuickData Technology which is part of part of Intel\\ |reg| I/O\n+Acceleration Technology (`Intel I/OAT\n+<https://www.intel.com/content/www/us/en/wireless-network/accel-technology.html>`_).\n+This PMD, when used on supported hardware, allows data copies, for example,\n+cloning packet data, to be accelerated by IOAT hardware rather than having to\n+be done by software, freeing up CPU cycles for other tasks.\n+\n+Hardware Requirements\n+----------------------\n+\n+The ``dpdk-devbind.py`` script, included with DPDK, can be used to show the\n+presence of supported hardware. Running ``dpdk-devbind.py --status-dev dma``\n+will show all the DMA devices on the system, IOAT devices are included in this\n+list. For Intel\\ |reg| IOAT devices, the hardware will often be listed as\n+\"Crystal Beach DMA\", or \"CBDMA\" or on some newer systems '0b00' due to the\n+absence of pci-id database entries for them at this point.\n+\n+.. note::\n+        Error handling is not supported by this driver on hardware prior to\n+        Intel Ice Lake. Unsupported systems include Broadwell, Skylake and\n+        Cascade Lake.\n+\n+Compilation\n+------------\n+\n+For builds using ``meson`` and ``ninja``, the driver will be built when the\n+target platform is x86-based. No additional compilation steps are necessary.\n+\n+Device Setup\n+-------------\n+\n+Intel\\ |reg| IOAT devices will need to be bound to a suitable DPDK-supported\n+user-space IO driver such as ``vfio-pci`` in order to be used by DPDK.\n+\n+The ``dpdk-devbind.py`` script can be used to view the state of the devices using::\n+\n+   $ dpdk-devbind.py --status-dev dma\n+\n+The ``dpdk-devbind.py`` script can also be used to bind devices to a suitable driver.\n+For example::\n+\n+\t$ dpdk-devbind.py -b vfio-pci 00:01.0 00:01.1\n+\n+Device Probing and Initialization\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+For devices bound to a suitable DPDK-supported driver (``vfio-pci``), the HW\n+devices will be found as part of the device scan done at application\n+initialization time without the need to pass parameters to the application.\n+\n+If the application does not require all the devices available an allowlist can\n+be used in the same way that other DPDK devices use them.\n+\n+For example::\n+\n+\t$ dpdk-test -a <b:d:f>\n+\n+Once probed successfully, the device will appear as a ``dmadev``, that is a\n+\"DMA device type\" inside DPDK, and can be accessed using APIs from the\n+``rte_dmadev`` library.\ndiff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst\nindex f8678efa94..3a85f2b33e 100644\n--- a/doc/guides/rel_notes/release_21_11.rst\n+++ b/doc/guides/rel_notes/release_21_11.rst\n@@ -80,6 +80,12 @@ New Features\n   The IDXD dmadev driver provide device drivers for the Intel DSA devices.\n   This device driver can be used through the generic dmadev API.\n \n+* **Added IOAT dmadev driver implementation.**\n+\n+  The Intel I/O Acceleration Technology (IOAT) dmadev driver provides a device\n+  driver for Intel IOAT devices such as Crystal Beach DMA (CBDMA) on Ice Lake,\n+  Skylake and Broadwell. This device driver can be used through the generic dmadev API.\n+\n * **Added new RSS offload types for IPv4/L4 checksum in RSS flow.**\n \n   Added macros ETH_RSS_IPV4_CHKSUM and ETH_RSS_L4_CHKSUM, now IPv4 and\ndiff --git a/drivers/dma/ioat/ioat_dmadev.c b/drivers/dma/ioat/ioat_dmadev.c\nnew file mode 100644\nindex 0000000000..f3491d45b1\n--- /dev/null\n+++ b/drivers/dma/ioat/ioat_dmadev.c\n@@ -0,0 +1,69 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2021 Intel Corporation\n+ */\n+\n+#include <rte_bus_pci.h>\n+#include <rte_dmadev_pmd.h>\n+\n+#include \"ioat_internal.h\"\n+\n+static struct rte_pci_driver ioat_pmd_drv;\n+\n+RTE_LOG_REGISTER_DEFAULT(ioat_pmd_logtype, INFO);\n+\n+#define IOAT_PMD_NAME dmadev_ioat\n+#define IOAT_PMD_NAME_STR RTE_STR(IOAT_PMD_NAME)\n+\n+/* Probe DMA device. */\n+static int\n+ioat_dmadev_probe(struct rte_pci_driver *drv, struct rte_pci_device *dev)\n+{\n+\tchar name[32];\n+\n+\trte_pci_device_name(&dev->addr, name, sizeof(name));\n+\tIOAT_PMD_INFO(\"Init %s on NUMA node %d\", name, dev->device.numa_node);\n+\n+\tdev->device.driver = &drv->driver;\n+\treturn 0;\n+}\n+\n+/* Remove DMA device. */\n+static int\n+ioat_dmadev_remove(struct rte_pci_device *dev)\n+{\n+\tchar name[32];\n+\n+\trte_pci_device_name(&dev->addr, name, sizeof(name));\n+\n+\tIOAT_PMD_INFO(\"Closing %s on NUMA node %d\",\n+\t\t\tname, dev->device.numa_node);\n+\n+\treturn 0;\n+}\n+\n+static const struct rte_pci_id pci_id_ioat_map[] = {\n+\t{ RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_SKX) },\n+\t{ RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX0) },\n+\t{ RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX1) },\n+\t{ RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX2) },\n+\t{ RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX3) },\n+\t{ RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX4) },\n+\t{ RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX5) },\n+\t{ RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX6) },\n+\t{ RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX7) },\n+\t{ RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDXE) },\n+\t{ RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDXF) },\n+\t{ RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_ICX) },\n+\t{ .vendor_id = 0, /* sentinel */ },\n+};\n+\n+static struct rte_pci_driver ioat_pmd_drv = {\n+\t.id_table = pci_id_ioat_map,\n+\t.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,\n+\t.probe = ioat_dmadev_probe,\n+\t.remove = ioat_dmadev_remove,\n+};\n+\n+RTE_PMD_REGISTER_PCI(IOAT_PMD_NAME, ioat_pmd_drv);\n+RTE_PMD_REGISTER_PCI_TABLE(IOAT_PMD_NAME, pci_id_ioat_map);\n+RTE_PMD_REGISTER_KMOD_DEP(IOAT_PMD_NAME, \"* igb_uio | uio_pci_generic | vfio-pci\");\ndiff --git a/drivers/dma/ioat/ioat_hw_defs.h b/drivers/dma/ioat/ioat_hw_defs.h\nnew file mode 100644\nindex 0000000000..eeabba41ef\n--- /dev/null\n+++ b/drivers/dma/ioat/ioat_hw_defs.h\n@@ -0,0 +1,35 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2021 Intel Corporation\n+ */\n+\n+#ifndef IOAT_HW_DEFS_H\n+#define IOAT_HW_DEFS_H\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include <stdint.h>\n+\n+#define IOAT_VER_3_0\t0x30\n+#define IOAT_VER_3_3\t0x33\n+\n+#define IOAT_VENDOR_ID\t\t0x8086\n+#define IOAT_DEVICE_ID_SKX\t0x2021\n+#define IOAT_DEVICE_ID_BDX0\t0x6f20\n+#define IOAT_DEVICE_ID_BDX1\t0x6f21\n+#define IOAT_DEVICE_ID_BDX2\t0x6f22\n+#define IOAT_DEVICE_ID_BDX3\t0x6f23\n+#define IOAT_DEVICE_ID_BDX4\t0x6f24\n+#define IOAT_DEVICE_ID_BDX5\t0x6f25\n+#define IOAT_DEVICE_ID_BDX6\t0x6f26\n+#define IOAT_DEVICE_ID_BDX7\t0x6f27\n+#define IOAT_DEVICE_ID_BDXE\t0x6f2E\n+#define IOAT_DEVICE_ID_BDXF\t0x6f2F\n+#define IOAT_DEVICE_ID_ICX\t0x0b00\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* IOAT_HW_DEFS_H */\ndiff --git a/drivers/dma/ioat/ioat_internal.h b/drivers/dma/ioat/ioat_internal.h\nnew file mode 100644\nindex 0000000000..f1ec12a919\n--- /dev/null\n+++ b/drivers/dma/ioat/ioat_internal.h\n@@ -0,0 +1,20 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2021 Intel Corporation\n+ */\n+\n+#ifndef _IOAT_INTERNAL_H_\n+#define _IOAT_INTERNAL_H_\n+\n+#include \"ioat_hw_defs.h\"\n+\n+extern int ioat_pmd_logtype;\n+\n+#define IOAT_PMD_LOG(level, fmt, args...) rte_log(RTE_LOG_ ## level, \\\n+\t\tioat_pmd_logtype, \"IOAT: %s(): \" fmt \"\\n\", __func__, ##args)\n+\n+#define IOAT_PMD_DEBUG(fmt, args...)  IOAT_PMD_LOG(DEBUG, fmt, ## args)\n+#define IOAT_PMD_INFO(fmt, args...)   IOAT_PMD_LOG(INFO, fmt, ## args)\n+#define IOAT_PMD_ERR(fmt, args...)    IOAT_PMD_LOG(ERR, fmt, ## args)\n+#define IOAT_PMD_WARN(fmt, args...)   IOAT_PMD_LOG(WARNING, fmt, ## args)\n+\n+#endif /* _IOAT_INTERNAL_H_ */\ndiff --git a/drivers/dma/ioat/meson.build b/drivers/dma/ioat/meson.build\nnew file mode 100644\nindex 0000000000..d67fac96fb\n--- /dev/null\n+++ b/drivers/dma/ioat/meson.build\n@@ -0,0 +1,7 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright 2021 Intel Corporation\n+\n+build = dpdk_conf.has('RTE_ARCH_X86')\n+reason = 'only supported on x86'\n+sources = files('ioat_dmadev.c')\n+deps += ['bus_pci', 'dmadev']\ndiff --git a/drivers/dma/ioat/version.map b/drivers/dma/ioat/version.map\nnew file mode 100644\nindex 0000000000..c2e0723b4c\n--- /dev/null\n+++ b/drivers/dma/ioat/version.map\n@@ -0,0 +1,3 @@\n+DPDK_22 {\n+\tlocal: *;\n+};\ndiff --git a/drivers/dma/meson.build b/drivers/dma/meson.build\nindex 411be7a240..a69418ce9b 100644\n--- a/drivers/dma/meson.build\n+++ b/drivers/dma/meson.build\n@@ -3,6 +3,7 @@\n \n drivers = [\n         'idxd',\n+        'ioat',\n         'skeleton',\n ]\n std_deps = ['dmadev']\n",
    "prefixes": [
        "v8",
        "01/12"
    ]
}