get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 79045,
    "url": "http://patchwork.dpdk.org/api/patches/79045/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200928164245.84997-23-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": "<20200928164245.84997-23-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200928164245.84997-23-bruce.richardson@intel.com",
    "date": "2020-09-28T16:42:42",
    "name": "[v4,22/25] raw/ioat: move xstats functions to common file",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "3d04ea7c7338f950023c075d4cd930e70f8780dc",
    "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/20200928164245.84997-23-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 12560,
            "url": "http://patchwork.dpdk.org/api/series/12560/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=12560",
            "date": "2020-09-28T16:42:20",
            "name": "raw/ioat: enhancements and new hardware support",
            "version": 4,
            "mbox": "http://patchwork.dpdk.org/series/12560/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/79045/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/79045/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 2E8A2A04DB;\n\tMon, 28 Sep 2020 18:50:53 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3F1671D9FD;\n\tMon, 28 Sep 2020 18:43:51 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n by dpdk.org (Postfix) with ESMTP id F279F1D9BF\n for <dev@dpdk.org>; Mon, 28 Sep 2020 18:43:42 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 28 Sep 2020 09:43:42 -0700",
            "from silpixa00399126.ir.intel.com ([10.237.222.4])\n by fmsmga004.fm.intel.com with ESMTP; 28 Sep 2020 09:43:40 -0700"
        ],
        "IronPort-SDR": [
            "\n aOzHpIXcBKKOYnojt5aHkIDrn8mNeSNrtrEM9F4r0NH10Av3/8F4wVkBLhCgbaNacGy1irkjt2\n PpYkg4HgDBoA==",
            "\n mK9jza6p9H5WVDJ4W8mTbB3qx+ZsHn0SRN8Ml+HPeXjCJGIatneOWDuhRcP5gswvKUQaYPtonG\n FTs9Tt38Dwow=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9758\"; a=\"223619934\"",
            "E=Sophos;i=\"5.77,313,1596524400\"; d=\"scan'208\";a=\"223619934\"",
            "E=Sophos;i=\"5.77,313,1596524400\"; d=\"scan'208\";a=\"338250683\""
        ],
        "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": "Mon, 28 Sep 2020 17:42:42 +0100",
        "Message-Id": "<20200928164245.84997-23-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20200928164245.84997-1-bruce.richardson@intel.com>",
        "References": "<20200721095140.719297-1-bruce.richardson@intel.com>\n <20200928164245.84997-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v4 22/25] raw/ioat: move xstats functions to\n\tcommon file",
        "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": "The xstats functions can be used by all ioat devices so move them from the\nioat_rawdev.c file to ioat_common.c, and add the function prototypes to the\ninternal header file.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nReviewed-by: Kevin Laatz <kevin.laatz@intel.com>\n---\n drivers/raw/ioat/ioat_common.c  | 59 +++++++++++++++++++++++++++++++++\n drivers/raw/ioat/ioat_private.h | 10 ++++++\n drivers/raw/ioat/ioat_rawdev.c  | 58 --------------------------------\n 3 files changed, 69 insertions(+), 58 deletions(-)",
    "diff": "diff --git a/drivers/raw/ioat/ioat_common.c b/drivers/raw/ioat/ioat_common.c\nindex b5cea2fda0..142e171bc9 100644\n--- a/drivers/raw/ioat/ioat_common.c\n+++ b/drivers/raw/ioat/ioat_common.c\n@@ -5,9 +5,68 @@\n #include <rte_rawdev_pmd.h>\n #include <rte_memzone.h>\n #include <rte_common.h>\n+#include <rte_string_fns.h>\n \n #include \"ioat_private.h\"\n \n+static const char * const xstat_names[] = {\n+\t\t\"failed_enqueues\", \"successful_enqueues\",\n+\t\t\"copies_started\", \"copies_completed\"\n+};\n+\n+int\n+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\tif (ids[i] > sizeof(ioat->xstats)/sizeof(*stats))\n+\t\t\tvalues[i] = 0;\n+\t\telse\n+\t\t\tvalues[i] = stats[ids[i]];\n+\t}\n+\treturn n;\n+}\n+\n+int\n+ioat_xstats_get_names(const struct rte_rawdev *dev,\n+\t\tstruct rte_rawdev_xstats_name *names,\n+\t\tunsigned int size)\n+{\n+\tunsigned int i;\n+\n+\tRTE_SET_USED(dev);\n+\tif (size < RTE_DIM(xstat_names))\n+\t\treturn RTE_DIM(xstat_names);\n+\n+\tfor (i = 0; i < RTE_DIM(xstat_names); i++)\n+\t\tstrlcpy(names[i].name, xstat_names[i], sizeof(names[i]));\n+\n+\treturn RTE_DIM(xstat_names);\n+}\n+\n+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\tmemset(&ioat->xstats, 0, sizeof(ioat->xstats));\n+\t\treturn 0;\n+\t}\n+\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+}\n+\n int\n idxd_rawdev_close(struct rte_rawdev *dev __rte_unused)\n {\ndiff --git a/drivers/raw/ioat/ioat_private.h b/drivers/raw/ioat/ioat_private.h\nindex 0f80d60bf6..ab9a3e6cce 100644\n--- a/drivers/raw/ioat/ioat_private.h\n+++ b/drivers/raw/ioat/ioat_private.h\n@@ -53,6 +53,16 @@ struct idxd_rawdev {\n \t} u;\n };\n \n+int ioat_xstats_get(const struct rte_rawdev *dev, const unsigned int ids[],\n+\t\tuint64_t values[], unsigned int n);\n+\n+int ioat_xstats_get_names(const struct rte_rawdev *dev,\n+\t\tstruct rte_rawdev_xstats_name *names,\n+\t\tunsigned int size);\n+\n+int ioat_xstats_reset(struct rte_rawdev *dev, const uint32_t *ids,\n+\t\tuint32_t nb_ids);\n+\n extern int idxd_rawdev_create(const char *name, struct rte_device *dev,\n \t\t       const struct idxd_rawdev *idxd,\n \t\t       const struct rte_rawdev_ops *ops);\ndiff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c\nindex 4ea913fff1..dd2543c809 100644\n--- a/drivers/raw/ioat/ioat_rawdev.c\n+++ b/drivers/raw/ioat/ioat_rawdev.c\n@@ -122,64 +122,6 @@ ioat_dev_info_get(struct rte_rawdev *dev, rte_rawdev_obj_t dev_info,\n \treturn 0;\n }\n \n-static const char * const xstat_names[] = {\n-\t\t\"failed_enqueues\", \"successful_enqueues\",\n-\t\t\"copies_started\", \"copies_completed\"\n-};\n-\n-static int\n-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\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-\n-static int\n-ioat_xstats_get_names(const struct rte_rawdev *dev,\n-\t\tstruct rte_rawdev_xstats_name *names,\n-\t\tunsigned int size)\n-{\n-\tunsigned int i;\n-\n-\tRTE_SET_USED(dev);\n-\tif (size < RTE_DIM(xstat_names))\n-\t\treturn RTE_DIM(xstat_names);\n-\n-\tfor (i = 0; i < RTE_DIM(xstat_names); i++)\n-\t\tstrlcpy(names[i].name, xstat_names[i], sizeof(names[i]));\n-\n-\treturn RTE_DIM(xstat_names);\n-}\n-\n-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\tmemset(&ioat->xstats, 0, sizeof(ioat->xstats));\n-\t\treturn 0;\n-\t}\n-\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-}\n-\n static int\n ioat_dev_close(struct rte_rawdev *dev __rte_unused)\n {\n",
    "prefixes": [
        "v4",
        "22/25"
    ]
}