get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 102001,
    "url": "http://patches.dpdk.org/api/patches/102001/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211018122818.1579942-14-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-14-kevin.laatz@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211018122818.1579942-14-kevin.laatz@intel.com",
    "date": "2021-10-18T12:28:15",
    "name": "[v8,13/16] dma/idxd: add burst capacity API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "46760b2d91cfee018a305e08096555c20239bd1f",
    "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-14-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/102001/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/102001/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 CE273A0C43;\n\tMon, 18 Oct 2021 14:30:11 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D90F541165;\n\tMon, 18 Oct 2021 14:28:51 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by mails.dpdk.org (Postfix) with ESMTP id A20F54115F\n for <dev@dpdk.org>; Mon, 18 Oct 2021 14:28:48 +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:48 -0700",
            "from silpixa00401122.ir.intel.com ([10.55.128.10])\n by orsmga008.jf.intel.com with ESMTP; 18 Oct 2021 05:28:46 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10140\"; a=\"215401577\"",
            "E=Sophos;i=\"5.85,382,1624345200\"; d=\"scan'208\";a=\"215401577\"",
            "E=Sophos;i=\"5.85,382,1624345200\"; d=\"scan'208\";a=\"493562540\""
        ],
        "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:15 +0000",
        "Message-Id": "<20211018122818.1579942-14-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 13/16] dma/idxd: add burst capacity API",
        "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 support for the burst capacity API. This API will provide the calling\napplication with the remaining capacity of the current burst (limited by\nmax HW batch size).\n\nSigned-off-by: Kevin Laatz <kevin.laatz@intel.com>\nReviewed-by: Conor Walsh <conor.walsh@intel.com>\nReviewed-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n drivers/dma/idxd/idxd_common.c   | 21 +++++++++++++++++++++\n drivers/dma/idxd/idxd_internal.h |  1 +\n drivers/dma/idxd/idxd_pci.c      |  1 +\n 3 files changed, 23 insertions(+)",
    "diff": "diff --git a/drivers/dma/idxd/idxd_common.c b/drivers/dma/idxd/idxd_common.c\nindex 3c8cff15c0..ff4647f579 100644\n--- a/drivers/dma/idxd/idxd_common.c\n+++ b/drivers/dma/idxd/idxd_common.c\n@@ -468,6 +468,26 @@ idxd_info_get(const struct rte_dma_dev *dev, struct rte_dma_info *info, uint32_t\n \treturn 0;\n }\n \n+uint16_t\n+idxd_burst_capacity(const void *dev_private, uint16_t vchan __rte_unused)\n+{\n+\tconst struct idxd_dmadev *idxd = dev_private;\n+\tuint16_t write_idx = idxd->batch_start + idxd->batch_size;\n+\tuint16_t used_space;\n+\n+\t/* Check for space in the batch ring */\n+\tif ((idxd->batch_idx_read == 0 && idxd->batch_idx_write == idxd->max_batches) ||\n+\t\t\tidxd->batch_idx_write + 1 == idxd->batch_idx_read)\n+\t\treturn 0;\n+\n+\t/* For descriptors, check for wrap-around on write but not read */\n+\tif (idxd->ids_returned > write_idx)\n+\t\twrite_idx += idxd->desc_ring_mask + 1;\n+\tused_space = write_idx - idxd->ids_returned;\n+\n+\treturn RTE_MIN((idxd->desc_ring_mask - used_space), idxd->max_batch_size);\n+}\n+\n int\n idxd_configure(struct rte_dma_dev *dev __rte_unused, const struct rte_dma_conf *dev_conf,\n \t\tuint32_t conf_sz)\n@@ -553,6 +573,7 @@ idxd_dmadev_create(const char *name, struct rte_device *dev,\n \tdmadev->fp_obj->submit = idxd_submit;\n \tdmadev->fp_obj->completed = idxd_completed;\n \tdmadev->fp_obj->completed_status = idxd_completed_status;\n+\tdmadev->fp_obj->burst_capacity = idxd_burst_capacity;\n \n \tidxd = dmadev->data->dev_private;\n \t*idxd = *base_idxd; /* copy over the main fields already passed in */\ndiff --git a/drivers/dma/idxd/idxd_internal.h b/drivers/dma/idxd/idxd_internal.h\nindex 50acb82d3d..3375600217 100644\n--- a/drivers/dma/idxd/idxd_internal.h\n+++ b/drivers/dma/idxd/idxd_internal.h\n@@ -104,5 +104,6 @@ int idxd_stats_get(const struct rte_dma_dev *dev, uint16_t vchan,\n int idxd_stats_reset(struct rte_dma_dev *dev, uint16_t vchan);\n int idxd_vchan_status(const struct rte_dma_dev *dev, uint16_t vchan,\n \t\tenum rte_dma_vchan_status *status);\n+uint16_t idxd_burst_capacity(const void *dev_private, 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 23c10c0fb0..beef3848aa 100644\n--- a/drivers/dma/idxd/idxd_pci.c\n+++ b/drivers/dma/idxd/idxd_pci.c\n@@ -254,6 +254,7 @@ init_pci_device(struct rte_pci_device *dev, struct idxd_dmadev *idxd,\n \n \tidxd->u.pci = pci;\n \tidxd->max_batches = wq_size;\n+\tidxd->max_batch_size = 1 << lg2_max_batch;\n \n \t/* enable the device itself */\n \terr_code = idxd_pci_dev_command(idxd, idxd_enable_dev);\n",
    "prefixes": [
        "v8",
        "13/16"
    ]
}