Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/78831/?format=api
https://patches.dpdk.org/api/patches/78831/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200925110910.284098-26-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": "<20200925110910.284098-26-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200925110910.284098-26-bruce.richardson@intel.com", "date": "2020-09-25T11:09:10", "name": "[v3,25/25] raw/ioat: add fill operation", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "729c561fca94d590ca62282b56f754da67d2a320", "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/20200925110910.284098-26-bruce.richardson@intel.com/mbox/", "series": [ { "id": 12509, "url": "https://patches.dpdk.org/api/series/12509/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=12509", "date": "2020-09-25T11:08:45", "name": "raw/ioat: enhancements and new hardware support", "version": 3, "mbox": "https://patches.dpdk.org/series/12509/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/78831/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/78831/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 B185CA04C0;\n\tFri, 25 Sep 2020 13:14:33 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BF41C1E993;\n\tFri, 25 Sep 2020 13:10:59 +0200 (CEST)", "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by dpdk.org (Postfix) with ESMTP id AC7291E98A\n for <dev@dpdk.org>; Fri, 25 Sep 2020 13:10:56 +0200 (CEST)", "from orsmga004.jf.intel.com ([10.7.209.38])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 25 Sep 2020 04:10:53 -0700", "from unknown (HELO silpixa00399126.ir.intel.com) ([10.237.222.4])\n by orsmga004.jf.intel.com with ESMTP; 25 Sep 2020 04:10:51 -0700" ], "IronPort-SDR": [ "\n ATp45IMs+zEswKL8mzfomrqht4OZKEAIKElBJ2PidgNG3IFPaEoSuwHjz24qUyIGodVZe/DCAd\n I1erKZjUtkpQ==", "\n pMfqRe4XF4YQbWQJzDNUsmTcaF9hH1jC8XmJdQOIES3tcGRz7UjjkCN8vd0GlrdthfpvpGUUN8\n uCcLRawUlE+g==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9754\"; a=\"225651754\"", "E=Sophos;i=\"5.77,301,1596524400\"; d=\"scan'208\";a=\"225651754\"", "E=Sophos;i=\"5.77,301,1596524400\"; d=\"scan'208\";a=\"455788163\"" ], "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": "patrick.fu@intel.com, Kevin Laatz <kevin.laatz@intel.com>,\n Bruce Richardson <bruce.richardson@intel.com>", "Date": "Fri, 25 Sep 2020 12:09:10 +0100", "Message-Id": "<20200925110910.284098-26-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20200925110910.284098-1-bruce.richardson@intel.com>", "References": "<20200721095140.719297-1-bruce.richardson@intel.com>\n <20200925110910.284098-1-bruce.richardson@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v3 25/25] raw/ioat: add fill operation", "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\nAdd fill operation enqueue support for IOAT and IDXD. The fill enqueue is\nsimilar to the copy enqueue, but takes a 'pattern' rather than a source\naddress to transfer to the destination address. This patch also includes an\nadditional test case for the new operation type.\n\nSigned-off-by: Kevin Laatz <kevin.laatz@intel.com>\nReviewed-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n doc/guides/rawdevs/ioat.rst | 10 ++++\n doc/guides/rel_notes/release_20_11.rst | 2 +\n drivers/raw/ioat/ioat_rawdev_test.c | 44 +++++++++++++++++\n drivers/raw/ioat/rte_ioat_rawdev.h | 26 +++++++++++\n drivers/raw/ioat/rte_ioat_rawdev_fns.h | 65 ++++++++++++++++++++++++--\n 5 files changed, 142 insertions(+), 5 deletions(-)", "diff": "diff --git a/doc/guides/rawdevs/ioat.rst b/doc/guides/rawdevs/ioat.rst\nindex 7c2a2d457..250cfc48a 100644\n--- a/doc/guides/rawdevs/ioat.rst\n+++ b/doc/guides/rawdevs/ioat.rst\n@@ -285,6 +285,16 @@ is correct before freeing the data buffers using the returned handles:\n }\n \n \n+Filling an Area of Memory\n+~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+The IOAT driver also has support for the ``fill`` operation, where an area\n+of memory is overwritten, or filled, with a short pattern of data.\n+Fill operations can be performed in much the same was as copy operations\n+described above, just using the ``rte_ioat_enqueue_fill()`` function rather\n+than the ``rte_ioat_enqueue_copy()`` function.\n+\n+\n Querying Device Statistics\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~\n \ndiff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst\nindex 4d8b78154..dd65b779d 100644\n--- a/doc/guides/rel_notes/release_20_11.rst\n+++ b/doc/guides/rel_notes/release_20_11.rst\n@@ -84,6 +84,8 @@ New Features\n \n * Added support for Intel\\ |reg| Data Streaming Accelerator hardware.\n For more information, see https://01.org/blogs/2019/introducing-intel-data-streaming-accelerator\n+ * Added support for the fill operation via the API ``rte_ioat_enqueue_fill()``,\n+ where the hardware fills an area of memory with a repeating pattern.\n * Added a per-device configuration flag to disable management of user-provided completion handles\n * Renamed the ``rte_ioat_do_copies()`` API to ``rte_ioat_perform_ops()``,\n and renamed the ``rte_ioat_completed_copies()`` API to ``rte_ioat_completed_ops()``\ndiff --git a/drivers/raw/ioat/ioat_rawdev_test.c b/drivers/raw/ioat/ioat_rawdev_test.c\nindex 7be6f2a2d..64269af55 100644\n--- a/drivers/raw/ioat/ioat_rawdev_test.c\n+++ b/drivers/raw/ioat/ioat_rawdev_test.c\n@@ -152,6 +152,46 @@ test_enqueue_copies(int dev_id)\n \treturn 0;\n }\n \n+static int\n+test_enqueue_fill(int dev_id)\n+{\n+\tconst unsigned int length[] = {8, 64, 1024, 50, 100, 89};\n+\tstruct rte_mbuf *dst = rte_pktmbuf_alloc(pool);\n+\tchar *dst_data = rte_pktmbuf_mtod(dst, char *);\n+\tuint64_t pattern = 0xfedcba9876543210;\n+\tunsigned int i, j;\n+\n+\tfor (i = 0; i < RTE_DIM(length); i++) {\n+\t\t/* reset dst_data */\n+\t\tmemset(dst_data, 0, length[i]);\n+\n+\t\t/* perform the fill operation */\n+\t\tif (rte_ioat_enqueue_fill(dev_id, pattern,\n+\t\t\t\tdst->buf_iova + dst->data_off, length[i],\n+\t\t\t\t(uintptr_t)dst) != 1) {\n+\t\t\tPRINT_ERR(\"Error with rte_ioat_enqueue_fill\\n\");\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\trte_ioat_perform_ops(dev_id);\n+\t\tusleep(100);\n+\n+\t\t/* check the result */\n+\t\tfor (j = 0; j < length[i]; j++) {\n+\t\t\tchar pat_byte = ((char *)&pattern)[j % 8];\n+\t\t\tif (dst_data[j] != pat_byte) {\n+\t\t\t\tPRINT_ERR(\"Error with fill operation (length = %u): got (%x), not (%x)\\n\",\n+\t\t\t\t\t\tlength[i], dst_data[j],\n+\t\t\t\t\t\tpat_byte);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\trte_pktmbuf_free(dst);\n+\treturn 0;\n+}\n+\n int\n ioat_rawdev_test(uint16_t dev_id)\n {\n@@ -238,6 +278,10 @@ ioat_rawdev_test(uint16_t dev_id)\n \t}\n \tprintf(\"\\n\");\n \n+\t/* test enqueue fill operation */\n+\tif (test_enqueue_fill(dev_id) != 0)\n+\t\tgoto err;\n+\n \trte_rawdev_stop(dev_id);\n \tif (rte_rawdev_xstats_reset(dev_id, NULL, 0) != 0) {\n \t\tPRINT_ERR(\"Error resetting xstat values\\n\");\ndiff --git a/drivers/raw/ioat/rte_ioat_rawdev.h b/drivers/raw/ioat/rte_ioat_rawdev.h\nindex 6b891cd44..b7632ebf3 100644\n--- a/drivers/raw/ioat/rte_ioat_rawdev.h\n+++ b/drivers/raw/ioat/rte_ioat_rawdev.h\n@@ -37,6 +37,32 @@ struct rte_ioat_rawdev_config {\n \tbool hdls_disable; /**< if set, ignore user-supplied handle params */\n };\n \n+/**\n+ * Enqueue a fill operation onto the ioat device\n+ *\n+ * This queues up a fill operation to be performed by hardware, but does not\n+ * trigger hardware to begin that operation.\n+ *\n+ * @param dev_id\n+ * The rawdev device id of the ioat instance\n+ * @param pattern\n+ * The pattern to populate the destination buffer with\n+ * @param dst\n+ * The physical address of the destination buffer\n+ * @param length\n+ * The length of the destination buffer\n+ * @param dst_hdl\n+ * An opaque handle for the destination data, to be returned when this\n+ * operation has been completed and the user polls for the completion details.\n+ * NOTE: If hdls_disable configuration option for the device is set, this\n+ * parameter is ignored.\n+ * @return\n+ * Number of operations enqueued, either 0 or 1\n+ */\n+static inline int\n+rte_ioat_enqueue_fill(int dev_id, uint64_t pattern, phys_addr_t dst,\n+\t\tunsigned int length, uintptr_t dst_hdl);\n+\n /**\n * Enqueue a copy operation onto the ioat device\n *\ndiff --git a/drivers/raw/ioat/rte_ioat_rawdev_fns.h b/drivers/raw/ioat/rte_ioat_rawdev_fns.h\nindex d0045d8a4..c2c4601ca 100644\n--- a/drivers/raw/ioat/rte_ioat_rawdev_fns.h\n+++ b/drivers/raw/ioat/rte_ioat_rawdev_fns.h\n@@ -115,6 +115,13 @@ enum rte_idxd_ops {\n #define IDXD_FLAG_REQUEST_COMPLETION (1 << 3)\n #define IDXD_FLAG_CACHE_CONTROL (1 << 8)\n \n+#define IOAT_COMP_UPDATE_SHIFT\t3\n+#define IOAT_CMD_OP_SHIFT\t24\n+enum rte_ioat_ops {\n+\tioat_op_copy = 0,\t/* Standard DMA Operation */\n+\tioat_op_fill\t\t/* Block Fill */\n+};\n+\n /**\n * Hardware descriptor used by DSA hardware, for both bursts and\n * for individual operations.\n@@ -203,11 +210,8 @@ struct rte_idxd_rawdev {\n \tstruct rte_idxd_desc_batch *batch_ring;\n };\n \n-/*\n- * Enqueue a copy operation onto the ioat device\n- */\n static __rte_always_inline int\n-__ioat_enqueue_copy(int dev_id, phys_addr_t src, phys_addr_t dst,\n+__ioat_write_desc(int dev_id, uint32_t op, uint64_t src, phys_addr_t dst,\n \t\tunsigned int length, uintptr_t src_hdl, uintptr_t dst_hdl)\n {\n \tstruct rte_ioat_rawdev *ioat =\n@@ -229,7 +233,8 @@ __ioat_enqueue_copy(int dev_id, phys_addr_t src, phys_addr_t dst,\n \tdesc = &ioat->desc_ring[write];\n \tdesc->size = length;\n \t/* set descriptor write-back every 16th descriptor */\n-\tdesc->u.control_raw = (uint32_t)((!(write & 0xF)) << 3);\n+\tdesc->u.control_raw = (uint32_t)((op << IOAT_CMD_OP_SHIFT) |\n+\t\t\t(!(write & 0xF) << IOAT_COMP_UPDATE_SHIFT));\n \tdesc->src_addr = src;\n \tdesc->dest_addr = dst;\n \n@@ -242,6 +247,27 @@ __ioat_enqueue_copy(int dev_id, phys_addr_t src, phys_addr_t dst,\n \treturn 1;\n }\n \n+static __rte_always_inline int\n+__ioat_enqueue_fill(int dev_id, uint64_t pattern, phys_addr_t dst,\n+\t\tunsigned int length, uintptr_t dst_hdl)\n+{\n+\tstatic const uintptr_t null_hdl;\n+\n+\treturn __ioat_write_desc(dev_id, ioat_op_fill, pattern, dst, length,\n+\t\t\tnull_hdl, dst_hdl);\n+}\n+\n+/*\n+ * Enqueue a copy operation onto the ioat device\n+ */\n+static __rte_always_inline int\n+__ioat_enqueue_copy(int dev_id, phys_addr_t src, phys_addr_t dst,\n+\t\tunsigned int length, uintptr_t src_hdl, uintptr_t dst_hdl)\n+{\n+\treturn __ioat_write_desc(dev_id, ioat_op_copy, src, dst, length,\n+\t\t\tsrc_hdl, dst_hdl);\n+}\n+\n /* add fence to last written descriptor */\n static __rte_always_inline int\n __ioat_fence(int dev_id)\n@@ -380,6 +406,23 @@ __idxd_write_desc(int dev_id, const struct rte_idxd_hw_desc *desc,\n \treturn 0;\n }\n \n+static __rte_always_inline int\n+__idxd_enqueue_fill(int dev_id, uint64_t pattern, rte_iova_t dst,\n+\t\tunsigned int length, uintptr_t dst_hdl)\n+{\n+\tconst struct rte_idxd_hw_desc desc = {\n+\t\t\t.op_flags = (idxd_op_fill << IDXD_CMD_OP_SHIFT) |\n+\t\t\t\tIDXD_FLAG_CACHE_CONTROL,\n+\t\t\t.src = pattern,\n+\t\t\t.dst = dst,\n+\t\t\t.size = length\n+\t};\n+\tconst struct rte_idxd_user_hdl hdl = {\n+\t\t\t.dst = dst_hdl\n+\t};\n+\treturn __idxd_write_desc(dev_id, &desc, &hdl);\n+}\n+\n static __rte_always_inline int\n __idxd_enqueue_copy(int dev_id, rte_iova_t src, rte_iova_t dst,\n \t\tunsigned int length, uintptr_t src_hdl, uintptr_t dst_hdl)\n@@ -475,6 +518,18 @@ __idxd_completed_ops(int dev_id, uint8_t max_ops,\n \treturn n;\n }\n \n+static inline int\n+rte_ioat_enqueue_fill(int dev_id, uint64_t pattern, phys_addr_t dst,\n+\t\tunsigned int len, uintptr_t dst_hdl)\n+{\n+\tenum rte_ioat_dev_type *type =\n+\t\t\t(enum rte_ioat_dev_type *)rte_rawdevs[dev_id].dev_private;\n+\tif (*type == RTE_IDXD_DEV)\n+\t\treturn __idxd_enqueue_fill(dev_id, pattern, dst, len, dst_hdl);\n+\telse\n+\t\treturn __ioat_enqueue_fill(dev_id, pattern, dst, len, dst_hdl);\n+}\n+\n static inline int\n rte_ioat_enqueue_copy(int dev_id, phys_addr_t src, phys_addr_t dst,\n \t\tunsigned int length, uintptr_t src_hdl, uintptr_t dst_hdl)\n", "prefixes": [ "v3", "25/25" ] }{ "id": 78831, "url": "