get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 97482,
    "url": "https://patches.dpdk.org/api/patches/97482/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210827172048.558704-13-kevin.laatz@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": "<20210827172048.558704-13-kevin.laatz@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210827172048.558704-13-kevin.laatz@intel.com",
    "date": "2021-08-27T17:20:47",
    "name": "[12/13] dma/idxd: add operation statistic tracking",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e39b94c20aca07f36c1d3729e3a84992fbda74c0",
    "submitter": {
        "id": 921,
        "url": "https://patches.dpdk.org/api/people/921/?format=api",
        "name": "Kevin Laatz",
        "email": "kevin.laatz@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/20210827172048.558704-13-kevin.laatz@intel.com/mbox/",
    "series": [
        {
            "id": 18500,
            "url": "https://patches.dpdk.org/api/series/18500/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=18500",
            "date": "2021-08-27T17:20:35",
            "name": "add dmadev driver for idxd devices",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/18500/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/97482/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/97482/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B2B5BA0548;\n\tFri, 27 Aug 2021 19:22:27 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6F3E941296;\n\tFri, 27 Aug 2021 19:21:33 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by mails.dpdk.org (Postfix) with ESMTP id D0166411E7\n for <dev@dpdk.org>; Fri, 27 Aug 2021 19:21:30 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 27 Aug 2021 10:21:30 -0700",
            "from silpixa00401122.ir.intel.com ([10.55.128.10])\n by orsmga002.jf.intel.com with ESMTP; 27 Aug 2021 10:21:28 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10089\"; a=\"198235964\"",
            "E=Sophos;i=\"5.84,357,1620716400\"; d=\"scan'208\";a=\"198235964\"",
            "E=Sophos;i=\"5.84,357,1620716400\"; d=\"scan'208\";a=\"445009616\""
        ],
        "X-ExtLoop1": "1",
        "From": "Kevin Laatz <kevin.laatz@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "bruce.richardson@intel.com, fengchengwen@huawei.com, jerinj@marvell.com,\n conor.walsh@intel.com, Kevin Laatz <kevin.laatz@intel.com>",
        "Date": "Fri, 27 Aug 2021 17:20:47 +0000",
        "Message-Id": "<20210827172048.558704-13-kevin.laatz@intel.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20210827172048.558704-1-kevin.laatz@intel.com>",
        "References": "<20210827172048.558704-1-kevin.laatz@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 12/13] dma/idxd: add operation statistic tracking",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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": "Add statistic tracking for DSA devices.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nSigned-off-by: Kevin Laatz <kevin.laatz@intel.com>\n---\n doc/guides/dmadevs/idxd.rst      | 11 +++++++++++\n drivers/dma/idxd/idxd_bus.c      |  2 ++\n drivers/dma/idxd/idxd_common.c   | 23 +++++++++++++++++++++++\n drivers/dma/idxd/idxd_internal.h |  3 +++\n 4 files changed, 39 insertions(+)",
    "diff": "diff --git a/doc/guides/dmadevs/idxd.rst b/doc/guides/dmadevs/idxd.rst\nindex 8bf99ef453..ba8bbac8b7 100644\n--- a/doc/guides/dmadevs/idxd.rst\n+++ b/doc/guides/dmadevs/idxd.rst\n@@ -242,3 +242,14 @@ 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_dmadev_fill()`` function rather than the\n ``rte_dmadev_copy()`` function.\n+\n+Querying Device Statistics\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+The statistics from the IDXD dmadev device can be got via the stats functions in\n+the ``rte_dmadev`` library, i.e. ``rte_dmadev_stats_get()``. The statistics\n+returned for each device instance are:\n+\n+* ``submitted_count``\n+* ``completed_fail_count``\n+* ``completed_count``\ndiff --git a/drivers/dma/idxd/idxd_bus.c b/drivers/dma/idxd/idxd_bus.c\nindex ad4f076bad..9482dab9be 100644\n--- a/drivers/dma/idxd/idxd_bus.c\n+++ b/drivers/dma/idxd/idxd_bus.c\n@@ -98,6 +98,8 @@ static const struct rte_dmadev_ops idxd_vdev_ops = {\n \t\t.dev_configure = idxd_configure,\n \t\t.vchan_setup = idxd_vchan_setup,\n \t\t.dev_info_get = idxd_info_get,\n+\t\t.stats_get = idxd_stats_get,\n+\t\t.stats_reset = idxd_stats_reset,\n };\n \n static void *\ndiff --git a/drivers/dma/idxd/idxd_common.c b/drivers/dma/idxd/idxd_common.c\nindex 50b205d92f..2f5addb359 100644\n--- a/drivers/dma/idxd/idxd_common.c\n+++ b/drivers/dma/idxd/idxd_common.c\n@@ -66,6 +66,8 @@ __submit(struct idxd_dmadev *idxd)\n \tif (++idxd->batch_idx_write > idxd->max_batches)\n \t\tidxd->batch_idx_write = 0;\n \n+\tidxd->stats.submitted += idxd->batch_size;\n+\n \tidxd->batch_start += idxd->batch_size;\n \tidxd->batch_size = 0;\n \tidxd->batch_idx_ring[idxd->batch_idx_write] = idxd->batch_start;\n@@ -356,6 +358,7 @@ idxd_completed(struct rte_dmadev *dev, uint16_t qid __rte_unused, uint16_t max_o\n \t\tret += batch;\n \t} while (batch > 0 && *has_error == false);\n \n+\tidxd->stats.completed += ret;\n \t*last_idx = idxd->ids_returned - 1;\n \treturn ret;\n }\n@@ -373,6 +376,7 @@ idxd_completed_status(struct rte_dmadev *dev, uint16_t qid __rte_unused, uint16_\n \t\tret += batch;\n \t} while (batch > 0);\n \n+\tidxd->stats.completed += ret;\n \t*last_idx = idxd->ids_returned - 1;\n \treturn ret;\n }\n@@ -406,6 +410,25 @@ idxd_dump(const struct rte_dmadev *dev, FILE *f)\n \treturn 0;\n }\n \n+int\n+idxd_stats_get(const struct rte_dmadev *dev, uint16_t vchan __rte_unused,\n+\t\tstruct rte_dmadev_stats *stats, uint32_t stats_sz)\n+{\n+\tstruct idxd_dmadev *idxd = dev->dev_private;\n+\tif (stats_sz < sizeof(*stats))\n+\t\treturn -EINVAL;\n+\t*stats = idxd->stats;\n+\treturn 0;\n+}\n+\n+int\n+idxd_stats_reset(struct rte_dmadev *dev, uint16_t vchan __rte_unused)\n+{\n+\tstruct idxd_dmadev *idxd = dev->dev_private;\n+\tidxd->stats = (struct rte_dmadev_stats){0};\n+\treturn 0;\n+}\n+\n int\n idxd_info_get(const struct rte_dmadev *dev, struct rte_dmadev_info *info, uint32_t size)\n {\ndiff --git a/drivers/dma/idxd/idxd_internal.h b/drivers/dma/idxd/idxd_internal.h\nindex 4bcfe5372b..5079b4207d 100644\n--- a/drivers/dma/idxd/idxd_internal.h\n+++ b/drivers/dma/idxd/idxd_internal.h\n@@ -95,5 +95,8 @@ uint16_t idxd_completed(struct rte_dmadev *dev, uint16_t qid, uint16_t max_ops,\n uint16_t idxd_completed_status(struct rte_dmadev *dev, uint16_t qid __rte_unused,\n \t\tuint16_t max_ops, uint16_t *last_idx,\n \t\tenum rte_dma_status_code *status);\n+int idxd_stats_get(const struct rte_dmadev *dev, uint16_t vchan,\n+\t\tstruct rte_dmadev_stats *stats, uint32_t stats_sz);\n+int idxd_stats_reset(struct rte_dmadev *dev, uint16_t vchan);\n \n #endif /* _IDXD_INTERNAL_H_ */\n",
    "prefixes": [
        "12/13"
    ]
}