get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 79932,
    "url": "http://patchwork.dpdk.org/api/patches/79932/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20201007163023.2817-22-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20201007163023.2817-22-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201007163023.2817-22-bruce.richardson@intel.com",
    "date": "2020-10-07T16:30:19",
    "name": "[v5,21/25] raw/ioat: create separate statistics structure",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "330c4b43060d9a6061974144946ec98d5b4fc522",
    "submitter": {
        "id": 20,
        "url": "http://patchwork.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20201007163023.2817-22-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 12759,
            "url": "http://patchwork.dpdk.org/api/series/12759/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=12759",
            "date": "2020-10-07T16:30:01",
            "name": "raw/ioat: enhancements and new hardware support",
            "version": 5,
            "mbox": "http://patchwork.dpdk.org/series/12759/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/79932/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/79932/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 ACA00A04BA;\n\tWed,  7 Oct 2020 18:40:20 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 881B71BD06;\n\tWed,  7 Oct 2020 18:38:30 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by dpdk.org (Postfix) with ESMTP id 3987B1BCAB\n for <dev@dpdk.org>; Wed,  7 Oct 2020 18:38:25 +0200 (CEST)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 07 Oct 2020 09:31:28 -0700",
            "from silpixa00399126.ir.intel.com ([10.237.222.4])\n by orsmga007.jf.intel.com with ESMTP; 07 Oct 2020 09:31:26 -0700"
        ],
        "IronPort-SDR": [
            "\n v8vIm2IFLSN/0vbR6icxDGfU2GZtOfn1IROVsQnhJpvFfqrhcldRnJUW1k1OnhVKjiF9JSypxd\n RWx3D75oVcog==",
            "\n MSjDxtQzpXfnvt7pUKEYCEbJ7X5e2ThqR+38he/NMQaiOwtIGw4qFDJ1z6gk4UNbyG11W9vFMu\n /HJERnjK6s9Q=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9767\"; a=\"249724531\"",
            "E=Sophos;i=\"5.77,347,1596524400\"; d=\"scan'208\";a=\"249724531\"",
            "E=Sophos;i=\"5.77,347,1596524400\"; d=\"scan'208\";a=\"354966036\""
        ],
        "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, thomas@monjalon.net,\n Bruce Richardson <bruce.richardson@intel.com>,\n Kevin Laatz <kevin.laatz@intel.com>, Radu Nicolau <radu.nicolau@intel.com>",
        "Date": "Wed,  7 Oct 2020 17:30:19 +0100",
        "Message-Id": "<20201007163023.2817-22-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20201007163023.2817-1-bruce.richardson@intel.com>",
        "References": "<20200721095140.719297-1-bruce.richardson@intel.com>\n <20201007163023.2817-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v5 21/25] raw/ioat: create separate statistics\n\tstructure",
        "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 xstats as fields inside the main driver structure,\ncreate a separate structure type for them.\n\nAs part of the change, when updating the stats functions referring to the\nstats by the old path, we can simplify them to use the id to directly index\ninto the stats structure, making the code shorter and simpler.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nReviewed-by: Kevin Laatz <kevin.laatz@intel.com>\nAcked-by: Radu Nicolau <radu.nicolau@intel.com>\n---\n drivers/raw/ioat/ioat_rawdev.c         | 40 +++++++-------------------\n drivers/raw/ioat/rte_ioat_rawdev_fns.h | 30 ++++++++++++-------\n 2 files changed, 29 insertions(+), 41 deletions(-)",
    "diff": "diff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c\nindex 0097be87e..4ea913fff 100644\n--- a/drivers/raw/ioat/ioat_rawdev.c\n+++ b/drivers/raw/ioat/ioat_rawdev.c\n@@ -132,16 +132,14 @@ ioat_xstats_get(const struct rte_rawdev *dev, const unsigned int ids[],\n \t\tuint64_t values[], unsigned int n)\n {\n \tconst struct rte_ioat_rawdev *ioat = dev->dev_private;\n+\tconst uint64_t *stats = (const void *)&ioat->xstats;\n \tunsigned int i;\n \n \tfor (i = 0; i < n; i++) {\n-\t\tswitch (ids[i]) {\n-\t\tcase 0: values[i] = ioat->enqueue_failed; break;\n-\t\tcase 1: values[i] = ioat->enqueued; break;\n-\t\tcase 2: values[i] = ioat->started; break;\n-\t\tcase 3: values[i] = ioat->completed; break;\n-\t\tdefault: values[i] = 0; break;\n-\t\t}\n+\t\tif (ids[i] < sizeof(ioat->xstats)/sizeof(*stats))\n+\t\t\tvalues[i] = stats[ids[i]];\n+\t\telse\n+\t\t\tvalues[i] = 0;\n \t}\n \treturn n;\n }\n@@ -167,35 +165,17 @@ static int\n ioat_xstats_reset(struct rte_rawdev *dev, const uint32_t *ids, uint32_t nb_ids)\n {\n \tstruct rte_ioat_rawdev *ioat = dev->dev_private;\n+\tuint64_t *stats = (void *)&ioat->xstats;\n \tunsigned int i;\n \n \tif (!ids) {\n-\t\tioat->enqueue_failed = 0;\n-\t\tioat->enqueued = 0;\n-\t\tioat->started = 0;\n-\t\tioat->completed = 0;\n+\t\tmemset(&ioat->xstats, 0, sizeof(ioat->xstats));\n \t\treturn 0;\n \t}\n \n-\tfor (i = 0; i < nb_ids; i++) {\n-\t\tswitch (ids[i]) {\n-\t\tcase 0:\n-\t\t\tioat->enqueue_failed = 0;\n-\t\t\tbreak;\n-\t\tcase 1:\n-\t\t\tioat->enqueued = 0;\n-\t\t\tbreak;\n-\t\tcase 2:\n-\t\t\tioat->started = 0;\n-\t\t\tbreak;\n-\t\tcase 3:\n-\t\t\tioat->completed = 0;\n-\t\t\tbreak;\n-\t\tdefault:\n-\t\t\tIOAT_PMD_WARN(\"Invalid xstat id - cannot reset value\");\n-\t\t\tbreak;\n-\t\t}\n-\t}\n+\tfor (i = 0; i < nb_ids; i++)\n+\t\tif (ids[i] < sizeof(ioat->xstats)/sizeof(*stats))\n+\t\t\tstats[ids[i]] = 0;\n \n \treturn 0;\n }\ndiff --git a/drivers/raw/ioat/rte_ioat_rawdev_fns.h b/drivers/raw/ioat/rte_ioat_rawdev_fns.h\nindex 36ba876ea..89bfc8d21 100644\n--- a/drivers/raw/ioat/rte_ioat_rawdev_fns.h\n+++ b/drivers/raw/ioat/rte_ioat_rawdev_fns.h\n@@ -49,17 +49,31 @@ enum rte_ioat_dev_type {\n \tRTE_IDXD_DEV,\n };\n \n+/**\n+ * @internal\n+ * some statistics for tracking, if added/changed update xstats fns\n+ */\n+struct rte_ioat_xstats {\n+\tuint64_t enqueue_failed;\n+\tuint64_t enqueued;\n+\tuint64_t started;\n+\tuint64_t completed;\n+};\n+\n /**\n  * @internal\n  * Structure representing an IOAT device instance\n  */\n struct rte_ioat_rawdev {\n+\t/* common fields at the top - match those in rte_idxd_rawdev */\n \tenum rte_ioat_dev_type type;\n+\tstruct rte_ioat_xstats xstats;\n+\n \tstruct rte_rawdev *rawdev;\n \tconst struct rte_memzone *mz;\n \tconst struct rte_memzone *desc_mz;\n \n-\tvolatile uint16_t *doorbell;\n+\tvolatile uint16_t *doorbell __rte_cache_aligned;\n \tphys_addr_t status_addr;\n \tphys_addr_t ring_addr;\n \n@@ -72,12 +86,6 @@ struct rte_ioat_rawdev {\n \tunsigned short next_read;\n \tunsigned short next_write;\n \n-\t/* some statistics for tracking, if added/changed update xstats fns*/\n-\tuint64_t enqueue_failed __rte_cache_aligned;\n-\tuint64_t enqueued;\n-\tuint64_t started;\n-\tuint64_t completed;\n-\n \t/* to report completions, the device will write status back here */\n \tvolatile uint64_t status __rte_cache_aligned;\n \n@@ -209,7 +217,7 @@ __ioat_enqueue_copy(int dev_id, phys_addr_t src, phys_addr_t dst,\n \tstruct rte_ioat_generic_hw_desc *desc;\n \n \tif (space == 0) {\n-\t\tioat->enqueue_failed++;\n+\t\tioat->xstats.enqueue_failed++;\n \t\treturn 0;\n \t}\n \n@@ -228,7 +236,7 @@ __ioat_enqueue_copy(int dev_id, phys_addr_t src, phys_addr_t dst,\n \t\t\t\t\t(int64_t)src_hdl);\n \trte_prefetch0(&ioat->desc_ring[ioat->next_write & mask]);\n \n-\tioat->enqueued++;\n+\tioat->xstats.enqueued++;\n \treturn 1;\n }\n \n@@ -261,7 +269,7 @@ __ioat_perform_ops(int dev_id)\n \t\t\t.control.completion_update = 1;\n \trte_compiler_barrier();\n \t*ioat->doorbell = ioat->next_write;\n-\tioat->started = ioat->enqueued;\n+\tioat->xstats.started = ioat->xstats.enqueued;\n }\n \n /**\n@@ -328,7 +336,7 @@ __ioat_completed_ops(int dev_id, uint8_t max_copies,\n \n end:\n \tioat->next_read = read;\n-\tioat->completed += count;\n+\tioat->xstats.completed += count;\n \treturn count;\n }\n \n",
    "prefixes": [
        "v5",
        "21/25"
    ]
}