raw/ioat: introduce IOAT driver
authorBruce Richardson <bruce.richardson@intel.com>
Tue, 2 Jul 2019 14:12:23 +0000 (15:12 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 4 Jul 2019 07:43:42 +0000 (09:43 +0200)
Add stubs for ioat rawdev driver support in DPDK, specifically:

  * makefile and meson build hooks
  * initial public header file
  * rawdev main C file, with probe and release functions
  * release note update announcing the driver
  * initial documentation for the new section in the rawdev doc
  * unit test stubs for device unit tests

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
17 files changed:
MAINTAINERS
app/test/test_rawdev.c
config/common_armv8a_linux
config/common_base
config/defconfig_arm-armv7a-linuxapp-gcc
config/defconfig_ppc_64-power8-linuxapp-gcc
doc/guides/rawdevs/index.rst
doc/guides/rawdevs/ioat_rawdev.rst [new file with mode: 0644]
doc/guides/rel_notes/release_19_08.rst
drivers/raw/Makefile
drivers/raw/ioat/Makefile [new file with mode: 0644]
drivers/raw/ioat/ioat_rawdev.c [new file with mode: 0644]
drivers/raw/ioat/meson.build [new file with mode: 0644]
drivers/raw/ioat/rte_ioat_rawdev.h [new file with mode: 0644]
drivers/raw/ioat/rte_pmd_ioat_version.map [new file with mode: 0644]
drivers/raw/meson.build
mk/rte.app.mk

index 9eb96eb..6054220 100644 (file)
@@ -1090,6 +1090,11 @@ M: Tianfei zhang <tianfei.zhang@intel.com>
 F: drivers/raw/ifpga_rawdev/
 F: doc/guides/rawdevs/ifpga_rawdev.rst
 
+IOAT Rawdev
+M: Bruce Richardson <bruce.richardson@intel.com>
+F: drivers/raw/ioat/
+F: doc/guides/rawdevs/ioat_rawdev.rst
+
 NXP DPAA2 QDMA
 M: Nipun Gupta <nipun.gupta@nxp.com>
 F: drivers/raw/dpaa2_qdma/
index 043a38a..88549fb 100644 (file)
@@ -25,3 +25,11 @@ test_rawdev_selftest_skeleton(void)
 }
 
 REGISTER_TEST_COMMAND(rawdev_autotest, test_rawdev_selftest_skeleton);
+
+static int
+test_rawdev_selftest_ioat(void)
+{
+       return TEST_SKIPPED;
+}
+
+REGISTER_TEST_COMMAND(ioat_rawdev_autotest, test_rawdev_selftest_ioat);
index 72091de..481712e 100644 (file)
@@ -34,5 +34,6 @@ CONFIG_RTE_ARCH_ARM64_MEMCPY=n
 CONFIG_RTE_LIBRTE_FM10K_PMD=n
 CONFIG_RTE_LIBRTE_SFC_EFX_PMD=n
 CONFIG_RTE_LIBRTE_AVP_PMD=n
+CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV=n
 
 CONFIG_RTE_SCHED_VECTOR=n
index 5318868..f68107e 100644 (file)
@@ -757,6 +757,11 @@ CONFIG_RTE_LIBRTE_PMD_DPAA2_QDMA_RAWDEV=n
 #
 CONFIG_RTE_LIBRTE_PMD_IFPGA_RAWDEV=y
 
+#
+# Compile PMD for Intel IOAT raw device
+#
+CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV=y
+
 #
 # Compile librte_ring
 #
index 562439c..26ab5c5 100644 (file)
@@ -55,3 +55,4 @@ CONFIG_RTE_LIBRTE_SFC_EFX_PMD=n
 CONFIG_RTE_LIBRTE_AVP_PMD=n
 CONFIG_RTE_LIBRTE_NFP_PMD=n
 CONFIG_RTE_LIBRTE_HINIC_PMD=n
+CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV=n
index cec4345..e8dafa3 100644 (file)
@@ -57,3 +57,4 @@ CONFIG_RTE_LIBRTE_FM10K_PMD=n
 CONFIG_RTE_LIBRTE_SFC_EFX_PMD=n
 CONFIG_RTE_LIBRTE_AVP_PMD=n
 CONFIG_RTE_LIBRTE_HINIC_PMD=n
+CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV=n
index 7c3bd95..0a21989 100644 (file)
@@ -14,3 +14,4 @@ application through rawdev API.
     dpaa2_cmdif
     dpaa2_qdma
     ifpga_rawdev
+    ioat_rawdev
diff --git a/doc/guides/rawdevs/ioat_rawdev.rst b/doc/guides/rawdevs/ioat_rawdev.rst
new file mode 100644 (file)
index 0000000..0c612e7
--- /dev/null
@@ -0,0 +1,63 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2019 Intel Corporation.
+
+.. include:: <isonum.txt>
+
+IOAT Rawdev Driver for Intel\ |reg| QuickData Technology
+======================================================================
+
+The ``ioat`` rawdev driver provides a poll-mode driver (PMD) for Intel\ |reg|
+QuickData Technology, part of Intel\ |reg| I/O Acceleration Technology
+`(Intel I/OAT)
+<https://www.intel.com/content/www/us/en/wireless-network/accel-technology.html>`_.
+This PMD, when used on supported hardware, allows data copies, for example,
+cloning packet data, to be accelerated by that hardware rather than having to
+be done by software, freeing up CPU cycles for other tasks.
+
+Hardware Requirements
+----------------------
+
+On Linux, the presence of an Intel\ |reg| QuickData Technology hardware can
+be detected by checking the output of the ``lspci`` command, where the
+hardware will be often listed as "Crystal Beach DMA" or "CBDMA". For
+example, on a system with Intel\ |reg| Xeon\ |reg| CPU E5-2699 v4 @2.20GHz,
+lspci shows:
+
+.. code-block:: console
+
+  # lspci | grep DMA
+  00:04.0 System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Crystal Beach DMA Channel 0 (rev 01)
+  00:04.1 System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Crystal Beach DMA Channel 1 (rev 01)
+  00:04.2 System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Crystal Beach DMA Channel 2 (rev 01)
+  00:04.3 System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Crystal Beach DMA Channel 3 (rev 01)
+  00:04.4 System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Crystal Beach DMA Channel 4 (rev 01)
+  00:04.5 System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Crystal Beach DMA Channel 5 (rev 01)
+  00:04.6 System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Crystal Beach DMA Channel 6 (rev 01)
+  00:04.7 System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Crystal Beach DMA Channel 7 (rev 01)
+
+On a system with Intel\ |reg| Xeon\ |reg| Gold 6154 CPU @ 3.00GHz, lspci
+shows:
+
+.. code-block:: console
+
+  # lspci | grep DMA
+  00:04.0 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)
+  00:04.1 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)
+  00:04.2 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)
+  00:04.3 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)
+  00:04.4 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)
+  00:04.5 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)
+  00:04.6 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)
+  00:04.7 System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)
+
+
+Compilation
+------------
+
+For builds done with ``make``, the driver compilation is enabled by the
+``CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV`` build configuration option. This is
+enabled by default in builds for x86 platforms, and disabled in other
+configurations.
+
+For builds using ``meson`` and ``ninja``, the driver will be built when the
+target platform is x86-based.
index 1392a4d..21934bf 100644 (file)
@@ -1,6 +1,8 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright 2019 The DPDK contributors
 
+.. include:: <isonum.txt>
+
 DPDK Release 19.08
 ==================
 
@@ -118,6 +120,15 @@ New Features
   * Enabled need_wakeup feature which can provide efficient support for case
     that application and driver executing on the same core.
 
+* **Added Intel QuickData Technology PMD**
+
+  The PMD for Intel\ |reg|  QuickData Technology, part of
+  Intel\ |reg|  I/O Acceleration Technology `(Intel I/OAT)
+  <https://www.intel.com/content/www/us/en/wireless-network/accel-technology.html>`_,
+  allows data copies to be done by hardware instead
+  of via software, reducing cycles spent copying large blocks of data in
+  applications.
+
 * **Updated telemetry library for global metrics support.**
 
   Updated ``librte_telemetry`` to fetch the global metrics from the
index 8e29b4a..c1b85c8 100644 (file)
@@ -10,5 +10,6 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF_RAWDEV) += dpaa2_cmdif
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_QDMA_RAWDEV) += dpaa2_qdma
 endif
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_IFPGA_RAWDEV) += ifpga_rawdev
+DIRS-$(CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV) += ioat
 
 include $(RTE_SDK)/mk/rte.subdir.mk
diff --git a/drivers/raw/ioat/Makefile b/drivers/raw/ioat/Makefile
new file mode 100644 (file)
index 0000000..7726e31
--- /dev/null
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+# library name
+LIB = librte_pmd_ioat_rawdev.a
+
+# build flags
+CFLAGS += -O3
+CFLAGS += $(WERROR_FLAGS)
+
+LDLIBS += -lrte_eal -lrte_rawdev
+LDLIBS += -lrte_pci -lrte_bus_pci
+
+# library version
+LIBABIVER := 1
+
+# versioning export map
+EXPORT_MAP := rte_pmd_ioat_version.map
+
+# library source files
+SRCS-$(CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV) += ioat_rawdev.c
+
+# export include files
+SYMLINK-y-include += rte_ioat_rawdev.h
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c
new file mode 100644 (file)
index 0000000..07f6d8d
--- /dev/null
@@ -0,0 +1,113 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019 Intel Corporation
+ */
+
+#include <rte_bus_pci.h>
+#include <rte_rawdev_pmd.h>
+
+#include "rte_ioat_rawdev.h"
+
+/* Dynamic log type identifier */
+int ioat_pmd_logtype;
+
+static struct rte_pci_driver ioat_pmd_drv;
+
+#define IOAT_VENDOR_ID         0x8086
+#define IOAT_DEVICE_ID_SKX     0x2021
+#define IOAT_DEVICE_ID_BDX0    0x6f20
+#define IOAT_DEVICE_ID_BDX1    0x6f21
+#define IOAT_DEVICE_ID_BDX2    0x6f22
+#define IOAT_DEVICE_ID_BDX3    0x6f23
+#define IOAT_DEVICE_ID_BDX4    0x6f24
+#define IOAT_DEVICE_ID_BDX5    0x6f25
+#define IOAT_DEVICE_ID_BDX6    0x6f26
+#define IOAT_DEVICE_ID_BDX7    0x6f27
+#define IOAT_DEVICE_ID_BDXE    0x6f2E
+#define IOAT_DEVICE_ID_BDXF    0x6f2F
+
+#define IOAT_PMD_LOG(level, fmt, args...) rte_log(RTE_LOG_ ## level, \
+       ioat_pmd_logtype, "%s(): " fmt "\n", __func__, ##args)
+
+#define IOAT_PMD_DEBUG(fmt, args...)  IOAT_PMD_LOG(DEBUG, fmt, ## args)
+#define IOAT_PMD_INFO(fmt, args...)   IOAT_PMD_LOG(INFO, fmt, ## args)
+#define IOAT_PMD_ERR(fmt, args...)    IOAT_PMD_LOG(ERR, fmt, ## args)
+#define IOAT_PMD_WARN(fmt, args...)   IOAT_PMD_LOG(WARNING, fmt, ## args)
+
+static int
+ioat_rawdev_create(const char *name, struct rte_pci_device *dev)
+{
+       RTE_SET_USED(name);
+       RTE_SET_USED(dev);
+       return 0;
+}
+
+static int
+ioat_rawdev_destroy(const char *name)
+{
+       RTE_SET_USED(name);
+       return 0;
+}
+
+static int
+ioat_rawdev_probe(struct rte_pci_driver *drv, struct rte_pci_device *dev)
+{
+       char name[32];
+       int ret = 0;
+
+
+       rte_pci_device_name(&dev->addr, name, sizeof(name));
+       IOAT_PMD_INFO("Init %s on NUMA node %d", name, dev->device.numa_node);
+
+       dev->device.driver = &drv->driver;
+       ret = ioat_rawdev_create(name, dev);
+       return ret;
+}
+
+static int
+ioat_rawdev_remove(struct rte_pci_device *dev)
+{
+       char name[32];
+       int ret;
+
+       rte_pci_device_name(&dev->addr, name, sizeof(name));
+
+       IOAT_PMD_INFO("Closing %s on NUMA node %d",
+                       name, dev->device.numa_node);
+
+       ret = ioat_rawdev_destroy(name);
+       return ret;
+}
+
+static const struct rte_pci_id pci_id_ioat_map[] = {
+       { RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_SKX) },
+       { RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX0) },
+       { RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX1) },
+       { RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX2) },
+       { RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX3) },
+       { RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX4) },
+       { RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX5) },
+       { RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX6) },
+       { RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDX7) },
+       { RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDXE) },
+       { RTE_PCI_DEVICE(IOAT_VENDOR_ID, IOAT_DEVICE_ID_BDXF) },
+       { .vendor_id = 0, /* sentinel */ },
+};
+
+static struct rte_pci_driver ioat_pmd_drv = {
+       .id_table = pci_id_ioat_map,
+       .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
+                    RTE_PCI_DRV_IOVA_AS_VA,
+       .probe = ioat_rawdev_probe,
+       .remove = ioat_rawdev_remove,
+};
+
+RTE_PMD_REGISTER_PCI(IOAT_PMD_RAWDEV_NAME, ioat_pmd_drv);
+RTE_PMD_REGISTER_PCI_TABLE(IOAT_PMD_RAWDEV_NAME, pci_id_ioat_map);
+RTE_PMD_REGISTER_KMOD_DEP(IOAT_PMD_RAWDEV_NAME, "* igb_uio | uio_pci_generic");
+
+RTE_INIT(ioat_pmd_init_log)
+{
+       ioat_pmd_logtype = rte_log_register(IOAT_PMD_LOG_NAME);
+       if (ioat_pmd_logtype >= 0)
+               rte_log_set_level(ioat_pmd_logtype, RTE_LOG_INFO);
+}
diff --git a/drivers/raw/ioat/meson.build b/drivers/raw/ioat/meson.build
new file mode 100644 (file)
index 0000000..ba7620a
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2019 Intel Corporation
+
+build = dpdk_conf.has('RTE_ARCH_X86')
+sources = files('ioat_rawdev.c')
+deps += ['rawdev', 'bus_pci']
+
+install_headers('rte_ioat_rawdev.h')
diff --git a/drivers/raw/ioat/rte_ioat_rawdev.h b/drivers/raw/ioat/rte_ioat_rawdev.h
new file mode 100644 (file)
index 0000000..e774064
--- /dev/null
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019 Intel Corporation
+ */
+
+#ifndef _RTE_IOAT_RAWDEV_H_
+#define _RTE_IOAT_RAWDEV_H_
+
+/**
+ * @file rte_ioat_rawdev.h
+ *
+ * Definitions for using the ioat rawdev device driver
+ *
+ * @warning
+ * @b EXPERIMENTAL: these structures and APIs may change without prior notice
+ */
+
+/** Name of the device driver */
+#define IOAT_PMD_RAWDEV_NAME rawdev_ioat
+/** String reported as the device driver name by rte_rawdev_info_get() */
+#define IOAT_PMD_RAWDEV_NAME_STR "rawdev_ioat"
+/** Name used to adjust the log level for this driver */
+#define IOAT_PMD_LOG_NAME "rawdev.ioat"
+
+#endif
diff --git a/drivers/raw/ioat/rte_pmd_ioat_version.map b/drivers/raw/ioat/rte_pmd_ioat_version.map
new file mode 100644 (file)
index 0000000..9a61188
--- /dev/null
@@ -0,0 +1,4 @@
+DPDK_19.08 {
+
+       local: *;
+};
index a61cdcc..2af8a70 100644 (file)
@@ -1,7 +1,9 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-drivers = ['skeleton_rawdev', 'dpaa2_cmdif', 'dpaa2_qdma', 'ifpga_rawdev']
+drivers = ['dpaa2_cmdif', 'dpaa2_qdma',
+       'ifpga_rawdev', 'ioat',
+       'skeleton_rawdev']
 std_deps = ['rawdev']
 config_flag_fmt = 'RTE_LIBRTE_PMD_@0@_RAWDEV'
 driver_name_fmt = 'rte_pmd_@0@'
index 55ffba4..30f9a12 100644 (file)
@@ -309,6 +309,7 @@ ifeq ($(CONFIG_RTE_LIBRTE_IFPGA_BUS),y)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_IFPGA_RAWDEV)   += -lrte_pmd_ifpga_rawdev
 _LDLIBS-$(CONFIG_RTE_LIBRTE_IPN3KE_PMD)       += -lrte_pmd_ipn3ke
 endif # CONFIG_RTE_LIBRTE_IFPGA_BUS
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV)   += -lrte_pmd_ioat_rawdev
 endif # CONFIG_RTE_LIBRTE_RAWDEV
 
 endif # !CONFIG_RTE_BUILD_SHARED_LIBS