From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id C623FA045E for ; Thu, 30 May 2019 23:25:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8AAB35680; Thu, 30 May 2019 23:25:46 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 384B42B9A for ; Thu, 30 May 2019 23:25:41 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 May 2019 14:25:40 -0700 X-ExtLoop1: 1 Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga001.jf.intel.com with ESMTP; 30 May 2019 14:25:39 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Thu, 30 May 2019 22:25:18 +0100 Message-Id: <20190530212525.40370-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530212525.40370-1-bruce.richardson@intel.com> References: <20190530212525.40370-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 1/8] raw/ioat: add initial support for ioat rawdev driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- MAINTAINERS | 7 +- app/test/Makefile | 1 + app/test/meson.build | 1 + app/test/test_ioat_rawdev.c | 22 +++++ config/common_armv8a_linux | 1 + config/common_base | 5 ++ config/defconfig_arm-armv7a-linuxapp-gcc | 1 + config/defconfig_ppc_64-power8-linuxapp-gcc | 1 + doc/guides/rawdevs/index.rst | 1 + doc/guides/rawdevs/ioat_rawdev.rst | 25 ++++++ doc/guides/rel_notes/release_19_08.rst | 11 +++ drivers/raw/Makefile | 1 + drivers/raw/ioat/Makefile | 28 +++++++ drivers/raw/ioat/ioat_rawdev.c | 93 +++++++++++++++++++++ drivers/raw/ioat/meson.build | 8 ++ drivers/raw/ioat/rte_ioat_rawdev.h | 24 ++++++ drivers/raw/ioat/rte_pmd_ioat_version.map | 4 + drivers/raw/meson.build | 3 +- mk/rte.app.mk | 1 + 19 files changed, 236 insertions(+), 2 deletions(-) create mode 100644 app/test/test_ioat_rawdev.c create mode 100644 doc/guides/rawdevs/ioat_rawdev.rst create mode 100644 drivers/raw/ioat/Makefile create mode 100644 drivers/raw/ioat/ioat_rawdev.c create mode 100644 drivers/raw/ioat/meson.build create mode 100644 drivers/raw/ioat/rte_ioat_rawdev.h create mode 100644 drivers/raw/ioat/rte_pmd_ioat_version.map diff --git a/MAINTAINERS b/MAINTAINERS index 15d0829c5..b613a1e74 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1042,6 +1042,12 @@ M: Tianfei zhang F: drivers/raw/ifpga_rawdev/ F: doc/guides/rawdevs/ifpga_rawdev.rst +IOAT Rawdev +M: Bruce Richardson +F: drivers/raw/ioat/ +F: doc/guides/rawdevs/ioat_rawdev.rst +F: app/test/test_ioat_rawdev.c + NXP DPAA2 QDMA M: Nipun Gupta F: drivers/raw/dpaa2_qdma/ @@ -1052,7 +1058,6 @@ M: Nipun Gupta F: drivers/raw/dpaa2_cmdif/ F: doc/guides/rawdevs/dpaa2_cmdif.rst - Packet processing ----------------- diff --git a/app/test/Makefile b/app/test/Makefile index 68d6b4fbc..7fbdd0755 100644 --- a/app/test/Makefile +++ b/app/test/Makefile @@ -212,6 +212,7 @@ endif ifeq ($(CONFIG_RTE_LIBRTE_RAWDEV),y) SRCS-y += test_rawdev.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV) += test_ioat_rawdev.c endif SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) += test_kvargs.c diff --git a/app/test/meson.build b/app/test/meson.build index 83391cef0..9867619d3 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -52,6 +52,7 @@ test_sources = files('commands.c', 'test_hash_perf.c', 'test_hash_readwrite_lf.c', 'test_interrupts.c', + 'test_ioat_rawdev.c', 'test_ipsec.c', 'test_kni.c', 'test_kvargs.c', diff --git a/app/test/test_ioat_rawdev.c b/app/test/test_ioat_rawdev.c new file mode 100644 index 000000000..bd1bb2827 --- /dev/null +++ b/app/test/test_ioat_rawdev.c @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#include "test.h" + +#ifndef RTE_LIBRTE_PMD_IOAT_RAWDEV + +static int +test_ioat_rawdev(void) { return TEST_SKIPPED; } + +#else + +static int +test_ioat_rawdev(void) +{ + return 0; +} + +#endif /* RTE_LIBRTE_PMD_IOAT_RAWDEV */ + +REGISTER_TEST_COMMAND(ioat_rawdev_autotest, test_ioat_rawdev); diff --git a/config/common_armv8a_linux b/config/common_armv8a_linux index 72091de1c..481712ebc 100644 --- a/config/common_armv8a_linux +++ b/config/common_armv8a_linux @@ -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 diff --git a/config/common_base b/config/common_base index 6f19ad5d2..2b8db4880 100644 --- a/config/common_base +++ b/config/common_base @@ -741,6 +741,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 # diff --git a/config/defconfig_arm-armv7a-linuxapp-gcc b/config/defconfig_arm-armv7a-linuxapp-gcc index c9509b274..ee158ef9d 100644 --- a/config/defconfig_arm-armv7a-linuxapp-gcc +++ b/config/defconfig_arm-armv7a-linuxapp-gcc @@ -54,3 +54,4 @@ CONFIG_RTE_LIBRTE_QEDE_PMD=n CONFIG_RTE_LIBRTE_SFC_EFX_PMD=n CONFIG_RTE_LIBRTE_AVP_PMD=n CONFIG_RTE_LIBRTE_NFP_PMD=n +CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV=n diff --git a/config/defconfig_ppc_64-power8-linuxapp-gcc b/config/defconfig_ppc_64-power8-linuxapp-gcc index 7e248b755..9f3670ec0 100644 --- a/config/defconfig_ppc_64-power8-linuxapp-gcc +++ b/config/defconfig_ppc_64-power8-linuxapp-gcc @@ -56,3 +56,4 @@ CONFIG_RTE_LIBRTE_ENIC_PMD=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 diff --git a/doc/guides/rawdevs/index.rst b/doc/guides/rawdevs/index.rst index 7c3bd9586..0a21989e4 100644 --- a/doc/guides/rawdevs/index.rst +++ b/doc/guides/rawdevs/index.rst @@ -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 index 000000000..40ab1b466 --- /dev/null +++ b/doc/guides/rawdevs/ioat_rawdev.rst @@ -0,0 +1,25 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2019 Intel Corporation. + +.. include:: + +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) `_. +This PMD allows data copies, for example, cloning packet data, to be +accelerated by hardware rather than having to be done by software, freeing +up CPU cycles for other tasks. + +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. diff --git a/doc/guides/rel_notes/release_19_08.rst b/doc/guides/rel_notes/release_19_08.rst index a17e7dea5..a65f3514a 100644 --- a/doc/guides/rel_notes/release_19_08.rst +++ b/doc/guides/rel_notes/release_19_08.rst @@ -1,6 +1,8 @@ .. SPDX-License-Identifier: BSD-3-Clause Copyright 2019 The DPDK contributors +.. include:: + DPDK Release 19.08 ================== @@ -54,6 +56,15 @@ New Features Also, make sure to start the actual text at the margin. ========================================================= +* **Added Intel QuickData Technology PMD** + + The PMD for Intel\ |reg| QuickData Technology, part of + Intel\ |reg| I/O Acceleration Technology `(Intel I/OAT) + `_, + allows data copies to be done by hardware instead + of via software, reducing cycles spent copying large blocks of data in + applications. + Removed Items ------------- diff --git a/drivers/raw/Makefile b/drivers/raw/Makefile index 8e29b4a56..c1b85c8c7 100644 --- a/drivers/raw/Makefile +++ b/drivers/raw/Makefile @@ -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 index 000000000..7726e310a --- /dev/null +++ b/drivers/raw/ioat/Makefile @@ -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 index 000000000..d9fc3091a --- /dev/null +++ b/drivers/raw/ioat/ioat_rawdev.c @@ -0,0 +1,93 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#include +#include + +#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 0x2021 + +#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) }, + { .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 index 000000000..ba7620a68 --- /dev/null +++ b/drivers/raw/ioat/meson.build @@ -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 index 000000000..e77406403 --- /dev/null +++ b/drivers/raw/ioat/rte_ioat_rawdev.h @@ -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 index 000000000..9a61188cd --- /dev/null +++ b/drivers/raw/ioat/rte_pmd_ioat_version.map @@ -0,0 +1,4 @@ +DPDK_19.08 { + + local: *; +}; diff --git a/drivers/raw/meson.build b/drivers/raw/meson.build index a61cdccef..39eb54a90 100644 --- a/drivers/raw/meson.build +++ b/drivers/raw/meson.build @@ -1,7 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright 2018 NXP -drivers = ['skeleton_rawdev', 'dpaa2_cmdif', 'dpaa2_qdma', 'ifpga_rawdev'] +drivers = ['skeleton_rawdev', 'dpaa2_cmdif', 'dpaa2_qdma', + 'ifpga_rawdev', 'ioat'] std_deps = ['rawdev'] config_flag_fmt = 'RTE_LIBRTE_PMD_@0@_RAWDEV' driver_name_fmt = 'rte_pmd_@0@' diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 7c9b4b538..9232877b0 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -303,6 +303,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 -- 2.21.0