get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 101999,
    "url": "http://patches.dpdk.org/api/patches/101999/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211018122818.1579942-12-kevin.laatz@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": "<20211018122818.1579942-12-kevin.laatz@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211018122818.1579942-12-kevin.laatz@intel.com",
    "date": "2021-10-18T12:28:13",
    "name": "[v8,11/16] dma/idxd: add operation statistic tracking",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "903240b1a881167d689e4e385d5fed5bb1dd1361",
    "submitter": {
        "id": 921,
        "url": "http://patches.dpdk.org/api/people/921/?format=api",
        "name": "Kevin Laatz",
        "email": "kevin.laatz@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/20211018122818.1579942-12-kevin.laatz@intel.com/mbox/",
    "series": [
        {
            "id": 19737,
            "url": "http://patches.dpdk.org/api/series/19737/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19737",
            "date": "2021-10-18T12:28:02",
            "name": "add dmadev driver for idxd devices",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/19737/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/101999/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/101999/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 C1EB5A0C43;\n\tMon, 18 Oct 2021 14:29:54 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 885C141156;\n\tMon, 18 Oct 2021 14:28:47 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by mails.dpdk.org (Postfix) with ESMTP id EBF3741149\n for <dev@dpdk.org>; Mon, 18 Oct 2021 14:28:44 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 18 Oct 2021 05:28:44 -0700",
            "from silpixa00401122.ir.intel.com ([10.55.128.10])\n by orsmga008.jf.intel.com with ESMTP; 18 Oct 2021 05:28:42 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10140\"; a=\"215401560\"",
            "E=Sophos;i=\"5.85,382,1624345200\"; d=\"scan'208\";a=\"215401560\"",
            "E=Sophos;i=\"5.85,382,1624345200\"; d=\"scan'208\";a=\"493562511\""
        ],
        "X-ExtLoop1": "1",
        "From": "Kevin Laatz <kevin.laatz@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, bruce.richardson@intel.com, fengchengwen@huawei.com,\n jerinj@marvell.com, conor.walsh@intel.com,\n Kevin Laatz <kevin.laatz@intel.com>",
        "Date": "Mon, 18 Oct 2021 12:28:13 +0000",
        "Message-Id": "<20211018122818.1579942-12-kevin.laatz@intel.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20211018122818.1579942-1-kevin.laatz@intel.com>",
        "References": "<20210827172048.558704-1-kevin.laatz@intel.com>\n <20211018122818.1579942-1-kevin.laatz@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v8 11/16] dma/idxd: add operation statistic\n 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\nThe dmadev library documentation is also updated to add a generic section\nfor using the library's statistics APIs.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nSigned-off-by: Kevin Laatz <kevin.laatz@intel.com>\nReviewed-by: Conor Walsh <conor.walsh@intel.com>\nReviewed-by: Chengwen Feng <fengchengwen@huawei.com>\n---\n doc/guides/prog_guide/dmadev.rst | 11 +++++++++++\n drivers/dma/idxd/idxd_bus.c      |  2 ++\n drivers/dma/idxd/idxd_common.c   | 27 +++++++++++++++++++++++++++\n drivers/dma/idxd/idxd_internal.h |  5 +++++\n drivers/dma/idxd/idxd_pci.c      |  2 ++\n 5 files changed, 47 insertions(+)",
    "diff": "diff --git a/doc/guides/prog_guide/dmadev.rst b/doc/guides/prog_guide/dmadev.rst\nindex e853ffda3a..139eaff299 100644\n--- a/doc/guides/prog_guide/dmadev.rst\n+++ b/doc/guides/prog_guide/dmadev.rst\n@@ -107,3 +107,14 @@ completed operations along with the status of each operation (filled into the\n ``status`` array passed by user). These two APIs can also return the last\n completed operation's ``ring_idx`` which could help user track operations within\n their own application-defined rings.\n+\n+\n+Querying Device Statistics\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+The statistics from a dmadev device can be got via the statistics functions,\n+i.e. ``rte_dma_stats_get()``. The statistics returned for each device instance are:\n+\n+* ``submitted``: The number of operations submitted to the device.\n+* ``completed``: The number of operations which have completed (successful and failed).\n+* ``errors``: The number of operations that completed with error.\ndiff --git a/drivers/dma/idxd/idxd_bus.c b/drivers/dma/idxd/idxd_bus.c\nindex b2acdac4f9..b52ea02854 100644\n--- a/drivers/dma/idxd/idxd_bus.c\n+++ b/drivers/dma/idxd/idxd_bus.c\n@@ -99,6 +99,8 @@ static const struct rte_dma_dev_ops idxd_bus_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 76bc2e1364..fd81418b7c 100644\n--- a/drivers/dma/idxd/idxd_common.c\n+++ b/drivers/dma/idxd/idxd_common.c\n@@ -65,6 +65,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@@ -276,6 +278,8 @@ batch_completed_status(struct idxd_dmadev *idxd, uint16_t max_ops, enum rte_dma_\n \tconst uint16_t b_len = b_end - b_start;\n \tif (b_len == 1) {/* not a batch */\n \t\t*status = get_comp_status(&idxd->batch_comp_ring[idxd->batch_idx_read]);\n+\t\tif (status != RTE_DMA_STATUS_SUCCESSFUL)\n+\t\t\tidxd->stats.errors++;\n \t\tidxd->ids_avail++;\n \t\tidxd->ids_returned++;\n \t\tidxd->batch_idx_read = next_batch;\n@@ -297,6 +301,8 @@ batch_completed_status(struct idxd_dmadev *idxd, uint16_t max_ops, enum rte_dma_\n \t\tstruct idxd_completion *c = (void *)\n \t\t\t\t&idxd->desc_ring[(b_start + ret) & idxd->desc_ring_mask];\n \t\tstatus[ret] = (ret < bcount) ? get_comp_status(c) : RTE_DMA_STATUS_NOT_ATTEMPTED;\n+\t\tif (status[ret] != RTE_DMA_STATUS_SUCCESSFUL)\n+\t\t\tidxd->stats.errors++;\n \t}\n \tidxd->ids_avail = idxd->ids_returned += ret;\n \n@@ -355,6 +361,7 @@ idxd_completed(void *dev_private, uint16_t qid __rte_unused, uint16_t max_ops,\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@@ -371,6 +378,7 @@ idxd_completed_status(void *dev_private, uint16_t qid __rte_unused, uint16_t max\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@@ -404,6 +412,25 @@ idxd_dump(const struct rte_dma_dev *dev, FILE *f)\n \treturn 0;\n }\n \n+int\n+idxd_stats_get(const struct rte_dma_dev *dev, uint16_t vchan __rte_unused,\n+\t\tstruct rte_dma_stats *stats, uint32_t stats_sz)\n+{\n+\tstruct idxd_dmadev *idxd = dev->fp_obj->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_dma_dev *dev, uint16_t vchan __rte_unused)\n+{\n+\tstruct idxd_dmadev *idxd = dev->fp_obj->dev_private;\n+\tidxd->stats = (struct rte_dma_stats){0};\n+\treturn 0;\n+}\n+\n int\n idxd_info_get(const struct rte_dma_dev *dev, struct rte_dma_info *info, uint32_t size)\n {\ndiff --git a/drivers/dma/idxd/idxd_internal.h b/drivers/dma/idxd/idxd_internal.h\nindex 4208b0dee8..a85a1fb79e 100644\n--- a/drivers/dma/idxd/idxd_internal.h\n+++ b/drivers/dma/idxd/idxd_internal.h\n@@ -59,6 +59,8 @@ struct idxd_dmadev {\n \tstruct idxd_completion *batch_comp_ring;\n \tunsigned short *batch_idx_ring; /* store where each batch ends */\n \n+\tstruct rte_dma_stats stats;\n+\n \trte_iova_t batch_iova; /* base address of the batch comp ring */\n \trte_iova_t desc_iova; /* base address of desc ring, needed for completions */\n \n@@ -97,5 +99,8 @@ uint16_t idxd_completed(void *dev_private, uint16_t qid, uint16_t max_ops,\n uint16_t idxd_completed_status(void *dev_private, 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_dma_dev *dev, uint16_t vchan,\n+\t\tstruct rte_dma_stats *stats, uint32_t stats_sz);\n+int idxd_stats_reset(struct rte_dma_dev *dev, uint16_t vchan);\n \n #endif /* _IDXD_INTERNAL_H_ */\ndiff --git a/drivers/dma/idxd/idxd_pci.c b/drivers/dma/idxd/idxd_pci.c\nindex ed5bf99425..9d7f0531d5 100644\n--- a/drivers/dma/idxd/idxd_pci.c\n+++ b/drivers/dma/idxd/idxd_pci.c\n@@ -136,6 +136,8 @@ static const struct rte_dma_dev_ops idxd_pci_ops = {\n \t.dev_configure = idxd_configure,\n \t.vchan_setup = idxd_vchan_setup,\n \t.dev_info_get = idxd_info_get,\n+\t.stats_get = idxd_stats_get,\n+\t.stats_reset = idxd_stats_reset,\n \t.dev_start = idxd_pci_dev_start,\n \t.dev_stop = idxd_pci_dev_stop,\n };\n",
    "prefixes": [
        "v8",
        "11/16"
    ]
}