get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 78814,
    "url": "http://patches.dpdk.org/api/patches/78814/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200925110910.284098-9-bruce.richardson@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": "<20200925110910.284098-9-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200925110910.284098-9-bruce.richardson@intel.com",
    "date": "2020-09-25T11:08:53",
    "name": "[v3,08/25] raw/ioat: add separate API for fence call",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f32308c541dec017674c004cb899b978210db0c7",
    "submitter": {
        "id": 20,
        "url": "http://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@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/20200925110910.284098-9-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 12509,
            "url": "http://patches.dpdk.org/api/series/12509/?format=api",
            "web_url": "http://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": "http://patches.dpdk.org/series/12509/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/78814/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/78814/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 86795A04C0;\n\tFri, 25 Sep 2020 13:11:00 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 8D2D61E916;\n\tFri, 25 Sep 2020 13:09:56 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id E7D411E8FB\n for <dev@dpdk.org>; Fri, 25 Sep 2020 13:09:47 +0200 (CEST)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 25 Sep 2020 04:09:47 -0700",
            "from unknown (HELO silpixa00399126.ir.intel.com) ([10.237.222.4])\n by orsmga004.jf.intel.com with ESMTP; 25 Sep 2020 04:09:46 -0700"
        ],
        "IronPort-SDR": [
            "\n Hsl+AiltHho8eZ2rCwxVDbZXcQIfWwQSPDZXpyLDvl3EKRXHC1ZTjRjwKFiVQdNpsdhvXjz6Bs\n 6pA6xfZ4fNSw==",
            "\n UwR8i0lkDv26gz/Vvn3yq/SyDDPqICe2qcq4ujTxpDyaozBeV9QdylTG+qQBweKCrxJAUyOnRX\n S/Hifwghm42Q=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9754\"; a=\"149263086\"",
            "E=Sophos;i=\"5.77,301,1596524400\"; d=\"scan'208\";a=\"149263086\"",
            "E=Sophos;i=\"5.77,301,1596524400\"; d=\"scan'208\";a=\"455787865\""
        ],
        "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, Bruce Richardson <bruce.richardson@intel.com>,\n Kevin Laatz <kevin.laatz@intel.com>",
        "Date": "Fri, 25 Sep 2020 12:08:53 +0100",
        "Message-Id": "<20200925110910.284098-9-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 08/25] raw/ioat: add separate API for fence\n\tcall",
        "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": "Rather than having the fence signalled via a flag on a descriptor - which\nrequires reading the docs to find out whether the flag needs to go on the\nlast descriptor before, or the first descriptor after the fence - we can\ninstead add a separate fence API call. This becomes unambiguous to use,\nsince the fence call explicitly comes between two other enqueue calls. It\nalso allows more freedom of implementation in the driver code.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nReviewed-by: Kevin Laatz <kevin.laatz@intel.com>\n---\n doc/guides/rawdevs/ioat.rst            |  3 +--\n doc/guides/rel_notes/release_20_11.rst |  4 ++++\n drivers/raw/ioat/ioat_rawdev_test.c    |  6 ++----\n drivers/raw/ioat/rte_ioat_rawdev.h     | 26 ++++++++++++++++++++------\n drivers/raw/ioat/rte_ioat_rawdev_fns.h | 22 +++++++++++++++++++---\n examples/ioat/ioatfwd.c                | 12 ++++--------\n 6 files changed, 50 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/doc/guides/rawdevs/ioat.rst b/doc/guides/rawdevs/ioat.rst\nindex 3db5f5d09..71bca0b28 100644\n--- a/doc/guides/rawdevs/ioat.rst\n+++ b/doc/guides/rawdevs/ioat.rst\n@@ -203,8 +203,7 @@ a burst of copies to the device and start the hardware processing of them:\n                                 dsts[i]->buf_iova + dsts[i]->data_off,\n                                 length,\n                                 (uintptr_t)srcs[i],\n-                                (uintptr_t)dsts[i],\n-                                0 /* nofence */) != 1) {\n+                                (uintptr_t)dsts[i]) != 1) {\n                         printf(\"Error with rte_ioat_enqueue_copy for buffer %u\\n\",\n                                         i);\n                         return -1;\ndiff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst\nindex c99c0b33f..3868529ac 100644\n--- a/doc/guides/rel_notes/release_20_11.rst\n+++ b/doc/guides/rel_notes/release_20_11.rst\n@@ -88,6 +88,10 @@ New Features\n     to better reflect the APIs' purposes, and remove the implication that\n     they are limited to copy operations only.\n     [Note: The old API is still provided but marked as deprecated in the code]\n+  * Added a new API ``rte_ioat_fence()`` to add a fence between operations.\n+    This API replaces the ``fence`` flag parameter in the ``rte_ioat_enqueue_copies()`` function,\n+    and is clearer as there is no ambiguity as to whether the flag should be\n+    set on the last operation before the fence or the first operation after it.\n \n \n Removed Items\ndiff --git a/drivers/raw/ioat/ioat_rawdev_test.c b/drivers/raw/ioat/ioat_rawdev_test.c\nindex bb40eab6b..8ff546803 100644\n--- a/drivers/raw/ioat/ioat_rawdev_test.c\n+++ b/drivers/raw/ioat/ioat_rawdev_test.c\n@@ -57,8 +57,7 @@ test_enqueue_copies(int dev_id)\n \t\t\t\tdst->buf_iova + dst->data_off,\n \t\t\t\tlength,\n \t\t\t\t(uintptr_t)src,\n-\t\t\t\t(uintptr_t)dst,\n-\t\t\t\t0 /* no fence */) != 1) {\n+\t\t\t\t(uintptr_t)dst) != 1) {\n \t\t\tPRINT_ERR(\"Error with rte_ioat_enqueue_copy\\n\");\n \t\t\treturn -1;\n \t\t}\n@@ -109,8 +108,7 @@ test_enqueue_copies(int dev_id)\n \t\t\t\t\tdsts[i]->buf_iova + dsts[i]->data_off,\n \t\t\t\t\tlength,\n \t\t\t\t\t(uintptr_t)srcs[i],\n-\t\t\t\t\t(uintptr_t)dsts[i],\n-\t\t\t\t\t0 /* nofence */) != 1) {\n+\t\t\t\t\t(uintptr_t)dsts[i]) != 1) {\n \t\t\t\tPRINT_ERR(\"Error with rte_ioat_enqueue_copy for buffer %u\\n\",\n \t\t\t\t\t\ti);\n \t\t\t\treturn -1;\ndiff --git a/drivers/raw/ioat/rte_ioat_rawdev.h b/drivers/raw/ioat/rte_ioat_rawdev.h\nindex 5b2c47e8c..6b891cd44 100644\n--- a/drivers/raw/ioat/rte_ioat_rawdev.h\n+++ b/drivers/raw/ioat/rte_ioat_rawdev.h\n@@ -61,17 +61,31 @@ struct rte_ioat_rawdev_config {\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- * @param fence\n- *   A flag parameter indicating that hardware should not begin to perform any\n- *   subsequently enqueued copy operations until after this operation has\n- *   completed\n  * @return\n  *   Number of operations enqueued, either 0 or 1\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-\t\tint fence);\n+\t\tunsigned int length, uintptr_t src_hdl, uintptr_t dst_hdl);\n+\n+/**\n+ * Add a fence to force ordering between operations\n+ *\n+ * This adds a fence to a sequence of operations to enforce ordering, such that\n+ * all operations enqueued before the fence must be completed before operations\n+ * after the fence.\n+ * NOTE: Since this fence may be added as a flag to the last operation enqueued,\n+ * this API may not function correctly when called immediately after an\n+ * \"rte_ioat_perform_ops\" call i.e. before any new operations are enqueued.\n+ *\n+ * @param dev_id\n+ *   The rawdev device id of the ioat instance\n+ * @return\n+ *   Number of fences enqueued, either 0 or 1\n+ */\n+static inline int\n+rte_ioat_fence(int dev_id);\n+\n \n /**\n  * Trigger hardware to begin performing enqueued operations\ndiff --git a/drivers/raw/ioat/rte_ioat_rawdev_fns.h b/drivers/raw/ioat/rte_ioat_rawdev_fns.h\nindex b155d79c4..466721a23 100644\n--- a/drivers/raw/ioat/rte_ioat_rawdev_fns.h\n+++ b/drivers/raw/ioat/rte_ioat_rawdev_fns.h\n@@ -47,8 +47,7 @@ struct rte_ioat_rawdev {\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-\t\tint fence)\n+\t\tunsigned int length, uintptr_t src_hdl, uintptr_t dst_hdl)\n {\n \tstruct rte_ioat_rawdev *ioat =\n \t\t\t(struct rte_ioat_rawdev *)rte_rawdevs[dev_id].dev_private;\n@@ -69,7 +68,7 @@ rte_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)((!!fence << 4) | (!(write & 0xF)) << 3);\n+\tdesc->u.control_raw = (uint32_t)((!(write & 0xF)) << 3);\n \tdesc->src_addr = src;\n \tdesc->dest_addr = dst;\n \n@@ -82,6 +81,23 @@ rte_ioat_enqueue_copy(int dev_id, phys_addr_t src, phys_addr_t dst,\n \treturn 1;\n }\n \n+/* add fence to last written descriptor */\n+static inline int\n+rte_ioat_fence(int dev_id)\n+{\n+\tstruct rte_ioat_rawdev *ioat =\n+\t\t\t(struct rte_ioat_rawdev *)rte_rawdevs[dev_id].dev_private;\n+\tunsigned short write = ioat->next_write;\n+\tunsigned short mask = ioat->ring_size - 1;\n+\tstruct rte_ioat_generic_hw_desc *desc;\n+\n+\twrite = (write - 1) & mask;\n+\tdesc = &ioat->desc_ring[write];\n+\n+\tdesc->u.control.fence = 1;\n+\treturn 0;\n+}\n+\n /*\n  * Trigger hardware to begin performing enqueued operations\n  */\ndiff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c\nindex 67f75737b..e6d1d1236 100644\n--- a/examples/ioat/ioatfwd.c\n+++ b/examples/ioat/ioatfwd.c\n@@ -361,15 +361,11 @@ ioat_enqueue_packets(struct rte_mbuf **pkts,\n \tfor (i = 0; i < nb_rx; i++) {\n \t\t/* Perform data copy */\n \t\tret = rte_ioat_enqueue_copy(dev_id,\n-\t\t\tpkts[i]->buf_iova\n-\t\t\t- addr_offset,\n-\t\t\tpkts_copy[i]->buf_iova\n-\t\t\t- addr_offset,\n-\t\t\trte_pktmbuf_data_len(pkts[i])\n-\t\t\t+ addr_offset,\n+\t\t\tpkts[i]->buf_iova - addr_offset,\n+\t\t\tpkts_copy[i]->buf_iova - addr_offset,\n+\t\t\trte_pktmbuf_data_len(pkts[i]) + addr_offset,\n \t\t\t(uintptr_t)pkts[i],\n-\t\t\t(uintptr_t)pkts_copy[i],\n-\t\t\t0 /* nofence */);\n+\t\t\t(uintptr_t)pkts_copy[i]);\n \n \t\tif (ret != 1)\n \t\t\tbreak;\n",
    "prefixes": [
        "v3",
        "08/25"
    ]
}