get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 97489,
    "url": "http://patches.dpdk.org/api/patches/97489/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210827172550.1522362-6-conor.walsh@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": "<20210827172550.1522362-6-conor.walsh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210827172550.1522362-6-conor.walsh@intel.com",
    "date": "2021-08-27T17:25:47",
    "name": "[5/8] dma/ioat: add start and stop functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ea489fe5c8de693c13109be6d5b6480c3df511aa",
    "submitter": {
        "id": 1935,
        "url": "http://patches.dpdk.org/api/people/1935/?format=api",
        "name": "Conor Walsh",
        "email": "conor.walsh@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/20210827172550.1522362-6-conor.walsh@intel.com/mbox/",
    "series": [
        {
            "id": 18501,
            "url": "http://patches.dpdk.org/api/series/18501/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=18501",
            "date": "2021-08-27T17:25:42",
            "name": "dma: add dmadev driver for ioat devices",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/18501/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/97489/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/97489/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 DF2D7A0548;\n\tFri, 27 Aug 2021 19:26:25 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 844384126B;\n\tFri, 27 Aug 2021 19:26:07 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id 67B0941252\n for <dev@dpdk.org>; Fri, 27 Aug 2021 19:26:05 +0200 (CEST)",
            "from fmsmga007.fm.intel.com ([10.253.24.52])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 27 Aug 2021 10:26:05 -0700",
            "from silpixa00401160.ir.intel.com ([10.55.128.248])\n by fmsmga007.fm.intel.com with ESMTP; 27 Aug 2021 10:26:02 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10089\"; a=\"240219238\"",
            "E=Sophos;i=\"5.84,357,1620716400\"; d=\"scan'208\";a=\"240219238\"",
            "E=Sophos;i=\"5.84,357,1620716400\"; d=\"scan'208\";a=\"457609832\""
        ],
        "X-ExtLoop1": "1",
        "From": "Conor Walsh <conor.walsh@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "bruce.richardson@intel.com, fengchengwen@huawei.com, jerinj@marvell.com,\n kevin.laatz@intel.com, Conor Walsh <conor.walsh@intel.com>",
        "Date": "Fri, 27 Aug 2021 17:25:47 +0000",
        "Message-Id": "<20210827172550.1522362-6-conor.walsh@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210827172550.1522362-1-conor.walsh@intel.com>",
        "References": "<20210827172550.1522362-1-conor.walsh@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 5/8] dma/ioat: add start and stop functions",
        "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 start, stop and recover functions for IOAT devices.\n\nSigned-off-by: Conor Walsh <conor.walsh@intel.com>\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n doc/guides/dmadevs/ioat.rst    |  3 ++\n drivers/dma/ioat/ioat_dmadev.c | 82 ++++++++++++++++++++++++++++++++++\n 2 files changed, 85 insertions(+)",
    "diff": "diff --git a/doc/guides/dmadevs/ioat.rst b/doc/guides/dmadevs/ioat.rst\nindex b6d88fe966..f7742642b5 100644\n--- a/doc/guides/dmadevs/ioat.rst\n+++ b/doc/guides/dmadevs/ioat.rst\n@@ -86,3 +86,6 @@ The following code shows how the device is configured in ``test_dmadev.c``:\n    :start-after: Setup of the dmadev device. 8<\n    :end-before: >8 End of setup of the dmadev device.\n    :dedent: 1\n+\n+Once configured, the device can then be made ready for use by calling the\n+``rte_dmadev_start()`` API.\ndiff --git a/drivers/dma/ioat/ioat_dmadev.c b/drivers/dma/ioat/ioat_dmadev.c\nindex db862b72c0..6cf368c8a5 100644\n--- a/drivers/dma/ioat/ioat_dmadev.c\n+++ b/drivers/dma/ioat/ioat_dmadev.c\n@@ -65,6 +65,86 @@ ioat_vchan_setup(struct rte_dmadev *dev, uint16_t vchan __rte_unused,\n \treturn 0;\n }\n \n+/* Recover IOAT device. */\n+static inline int\n+__ioat_recover(struct ioat_dmadev *ioat)\n+{\n+\tuint32_t chanerr, retry = 0;\n+\tuint16_t mask = ioat->qcfg.nb_desc - 1;\n+\n+\t/* Clear any channel errors. Reading and writing to chanerr does this. */\n+\tchanerr = ioat->regs->chanerr;\n+\tioat->regs->chanerr = chanerr;\n+\n+\t/* Reset Channel. */\n+\tioat->regs->chancmd = IOAT_CHANCMD_RESET;\n+\n+\t/* Write new chain address to trigger state change. */\n+\tioat->regs->chainaddr = ioat->desc_ring[(ioat->next_read - 1) & mask].next;\n+\t/* Ensure channel control and status addr are correct. */\n+\tioat->regs->chanctrl = IOAT_CHANCTRL_ANY_ERR_ABORT_EN |\n+\t\t\tIOAT_CHANCTRL_ERR_COMPLETION_EN;\n+\tioat->regs->chancmp = ioat->status_addr;\n+\n+\t/* Allow HW time to move to the ARMED state. */\n+\tdo {\n+\t\trte_pause();\n+\t\tretry++;\n+\t} while (ioat->regs->chansts != IOAT_CHANSTS_ARMED && retry < 200);\n+\n+\t/* Exit as failure if device is still HALTED. */\n+\tif (ioat->regs->chansts != IOAT_CHANSTS_ARMED)\n+\t\treturn -1;\n+\n+\t/* Store next write as offset as recover will move HW and SW ring out of sync. */\n+\tioat->offset = ioat->next_read;\n+\n+\t/* Prime status register with previous address. */\n+\tioat->status = ioat->desc_ring[(ioat->next_read - 2) & mask].next;\n+\n+\treturn 0;\n+}\n+\n+/* Start a configured device. */\n+static int\n+ioat_dev_start(struct rte_dmadev *dev)\n+{\n+\tstruct ioat_dmadev *ioat = dev->dev_private;\n+\n+\tif (ioat->qcfg.nb_desc == 0 || ioat->desc_ring == NULL)\n+\t\treturn -EBUSY;\n+\n+\t/* Inform hardware of where the descriptor ring is. */\n+\tioat->regs->chainaddr = ioat->ring_addr;\n+\t/* Inform hardware of where to write the status/completions. */\n+\tioat->regs->chancmp = ioat->status_addr;\n+\n+\t/* Prime the status register to be set to the last element. */\n+\tioat->status = ioat->ring_addr + ((ioat->qcfg.nb_desc - 1) * DESC_SZ);\n+\n+\tprintf(\"IOAT.status: %s [%#lx]\\n\",\n+\t\t\tchansts_readable[ioat->status & IOAT_CHANSTS_STATUS],\n+\t\t\tioat->status);\n+\n+\tif ((ioat->regs->chansts & IOAT_CHANSTS_STATUS) == IOAT_CHANSTS_HALTED) {\n+\t\tIOAT_PMD_WARN(\"Device HALTED on start, attempting to recover\\n\");\n+\t\tif (__ioat_recover(ioat) != 0) {\n+\t\t\tIOAT_PMD_ERR(\"Device couldn't be recovered\");\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/* Stop a configured device. */\n+static int\n+ioat_dev_stop(struct rte_dmadev *dev)\n+{\n+\tRTE_SET_USED(dev);\n+\treturn 0;\n+}\n+\n /* Get device information of a device. */\n static int\n ioat_dev_info_get(const struct rte_dmadev *dev, struct rte_dmadev_info *info, uint32_t size)\n@@ -157,6 +237,8 @@ ioat_dmadev_create(const char *name, struct rte_pci_device *dev)\n \t\t.dev_configure = ioat_dev_configure,\n \t\t.dev_dump = ioat_dev_dump,\n \t\t.dev_info_get = ioat_dev_info_get,\n+\t\t.dev_start = ioat_dev_start,\n+\t\t.dev_stop = ioat_dev_stop,\n \t\t.vchan_setup = ioat_vchan_setup,\n \t};\n \n",
    "prefixes": [
        "5/8"
    ]
}