get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 99180,
    "url": "https://patches.dpdk.org/api/patches/99180/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210917140252.2999006-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": "<20210917140252.2999006-13-kevin.laatz@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210917140252.2999006-13-kevin.laatz@intel.com",
    "date": "2021-09-17T14:02:48",
    "name": "[v4,12/16] dma/idxd: add vchan status function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "884ef9988d2a81b189b3358c646d93188969b5a2",
    "submitter": {
        "id": 921,
        "url": "https://patches.dpdk.org/api/people/921/?format=api",
        "name": "Kevin Laatz",
        "email": "kevin.laatz@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210917140252.2999006-13-kevin.laatz@intel.com/mbox/",
    "series": [
        {
            "id": 19018,
            "url": "https://patches.dpdk.org/api/series/19018/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19018",
            "date": "2021-09-17T14:02:36",
            "name": "add dmadev driver for idxd devices",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/19018/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/99180/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/99180/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 E2A00A0C46;\n\tFri, 17 Sep 2021 16:04:46 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5E0F541187;\n\tFri, 17 Sep 2021 16:03:40 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id D27B94116F\n for <dev@dpdk.org>; Fri, 17 Sep 2021 16:03:35 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 17 Sep 2021 07:03:35 -0700",
            "from silpixa00401122.ir.intel.com ([10.55.128.10])\n by fmsmga006.fm.intel.com with ESMTP; 17 Sep 2021 07:03:34 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10109\"; a=\"219614946\"",
            "E=Sophos;i=\"5.85,301,1624345200\"; d=\"scan'208\";a=\"219614946\"",
            "E=Sophos;i=\"5.85,301,1624345200\"; d=\"scan'208\";a=\"699496289\""
        ],
        "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, 17 Sep 2021 14:02:48 +0000",
        "Message-Id": "<20210917140252.2999006-13-kevin.laatz@intel.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20210917140252.2999006-1-kevin.laatz@intel.com>",
        "References": "<20210827172048.558704-1-kevin.laatz@intel.com>\n <20210917140252.2999006-1-kevin.laatz@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v4 12/16] dma/idxd: add vchan status function",
        "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": "When testing dmadev drivers, it is useful to have the HW device in a known\nstate. This patch adds the implementation of the function which will wait\nfor the device to be idle (all jobs completed) before proceeding.\n\nSigned-off-by: Kevin Laatz <kevin.laatz@intel.com>\nReviewed-by: Conor Walsh <conor.walsh@intel.com>\n\n---\nv3: update API name to vchan_status\n---\n drivers/dma/idxd/idxd_bus.c      |  1 +\n drivers/dma/idxd/idxd_common.c   | 17 +++++++++++++++++\n drivers/dma/idxd/idxd_internal.h |  2 ++\n drivers/dma/idxd/idxd_pci.c      |  1 +\n 4 files changed, 21 insertions(+)",
    "diff": "diff --git a/drivers/dma/idxd/idxd_bus.c b/drivers/dma/idxd/idxd_bus.c\nindex b52ea02854..e6caa048a9 100644\n--- a/drivers/dma/idxd/idxd_bus.c\n+++ b/drivers/dma/idxd/idxd_bus.c\n@@ -101,6 +101,7 @@ static const struct rte_dma_dev_ops idxd_bus_ops = {\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+\t\t.vchan_status = idxd_vchan_status,\n };\n \n static void *\ndiff --git a/drivers/dma/idxd/idxd_common.c b/drivers/dma/idxd/idxd_common.c\nindex d86c58c12a..87d84c081e 100644\n--- a/drivers/dma/idxd/idxd_common.c\n+++ b/drivers/dma/idxd/idxd_common.c\n@@ -162,6 +162,23 @@ get_comp_status(struct idxd_completion *c)\n \t}\n }\n \n+int\n+idxd_vchan_status(const struct rte_dma_dev *dev, uint16_t vchan __rte_unused,\n+\t\tenum rte_dma_vchan_status *status)\n+{\n+\tstruct idxd_dmadev *idxd = dev->dev_private;\n+\tuint16_t last_batch_write = idxd->batch_idx_write == 0 ? idxd->max_batches :\n+\t\t\tidxd->batch_idx_write - 1;\n+\tuint8_t bstatus = (idxd->batch_comp_ring[last_batch_write].status != 0);\n+\n+\t/* An IDXD device will always be either active or idle.\n+\t * RTE_DMA_VCHAN_HALTED_ERROR is therefore not supported by IDXD.\n+\t */\n+\t*status = bstatus ? RTE_DMA_VCHAN_IDLE : RTE_DMA_VCHAN_ACTIVE;\n+\n+\treturn 0;\n+}\n+\n static __rte_always_inline int\n batch_ok(struct idxd_dmadev *idxd, uint8_t max_ops, enum rte_dma_status_code *status)\n {\ndiff --git a/drivers/dma/idxd/idxd_internal.h b/drivers/dma/idxd/idxd_internal.h\nindex e2a1119ef7..a291ad26d9 100644\n--- a/drivers/dma/idxd/idxd_internal.h\n+++ b/drivers/dma/idxd/idxd_internal.h\n@@ -101,5 +101,7 @@ uint16_t idxd_completed_status(struct rte_dma_dev *dev, uint16_t qid __rte_unuse\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+int idxd_vchan_status(const struct rte_dma_dev *dev, uint16_t vchan,\n+\t\tenum rte_dma_vchan_status *status);\n \n #endif /* _IDXD_INTERNAL_H_ */\ndiff --git a/drivers/dma/idxd/idxd_pci.c b/drivers/dma/idxd/idxd_pci.c\nindex d73845aa3d..2464d4a06c 100644\n--- a/drivers/dma/idxd/idxd_pci.c\n+++ b/drivers/dma/idxd/idxd_pci.c\n@@ -118,6 +118,7 @@ static const struct rte_dma_dev_ops idxd_pci_ops = {\n \t.stats_reset = idxd_stats_reset,\n \t.dev_start = idxd_pci_dev_start,\n \t.dev_stop = idxd_pci_dev_stop,\n+\t.vchan_status = idxd_vchan_status,\n };\n \n /* each portal uses 4 x 4k pages */\n",
    "prefixes": [
        "v4",
        "12/16"
    ]
}