Show a patch.

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

{
    "id": 74553,
    "url": "https://patches.dpdk.org/api/patches/74553/",
    "web_url": "https://patches.dpdk.org/patch/74553/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20200721095140.719297-15-bruce.richardson@intel.com>",
    "date": "2020-07-21T09:51:34",
    "name": "[20.11,14/20] raw/ioat: add start and stop functions for idxd devices",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "9edd65cf16f5a262a26b17eda3315b0ff1b65289",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/patch/74553/mbox/",
    "series": [
        {
            "id": 11200,
            "url": "https://patches.dpdk.org/api/series/11200/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11200",
            "date": "2020-07-21T09:51:20",
            "name": "raw/ioat: enhancements and new hardware support",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/11200/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74553/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/74553/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9688\"; a=\"138191453\"",
            "E=Sophos;i=\"5.75,378,1589266800\"; d=\"scan'208\";a=\"138191453\"",
            "E=Sophos;i=\"5.75,378,1589266800\"; d=\"scan'208\";a=\"488024464\""
        ],
        "IronPort-SDR": [
            "\n EysIruXBYgVZwuR/yzCJPEwxQJstlvPSTz1RjgL5b0KGR+dgjMvzYnBAAU6CfKSrAekx2H1tm5\n qAM4Wa3jYVHg==",
            "\n 5wWzcCB+mdpSWH3toItmKTYsk0u5zbKRk8fK0KAjX2WUIMJmpbCAIc4jDzlzp4ktyO1G6ntyAB\n xkHQQf4ggIeQ=="
        ],
        "X-Amp-File-Uploaded": "False",
        "Precedence": "list",
        "X-Mailman-Version": "2.1.15",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "MIME-Version": "1.0",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<20200721095140.719297-1-bruce.richardson@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 20.11 14/20] raw/ioat: add start and stop\n\tfunctions for idxd devices",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id EEEC7A0526;\n\tTue, 21 Jul 2020 11:56:47 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 41FF61C07E;\n\tTue, 21 Jul 2020 11:56:16 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by dpdk.org (Postfix) with ESMTP id 39D3C1C02D\n for <dev@dpdk.org>; Tue, 21 Jul 2020 11:56:13 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Jul 2020 02:56:12 -0700",
            "from silpixa00399126.ir.intel.com ([10.237.222.36])\n by fmsmga005.fm.intel.com with ESMTP; 21 Jul 2020 02:56:11 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Mailer": "git-send-email 2.25.1",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-ExtLoop1": "1",
        "Date": "Tue, 21 Jul 2020 10:51:34 +0100",
        "Content-Transfer-Encoding": "8bit",
        "To": "dev@dpdk.org",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "In-Reply-To": "<20200721095140.719297-1-bruce.richardson@intel.com>",
        "Cc": "cheng1.jiang@intel.com, patrick.fu@intel.com, kevin.laatz@intel.com,\n Bruce Richardson <bruce.richardson@intel.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200721095140.719297-15-bruce.richardson@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "Add the start and stop functions for DSA hardware devices.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nSigned-off-by: Kevin Laatz <kevin.laatz@intel.com>\n---\n drivers/raw/ioat/idxd_pci.c  | 52 ++++++++++++++++++++++++++++++++++++\n drivers/raw/ioat/idxd_vdev.c | 50 ++++++++++++++++++++++++++++++++++\n 2 files changed, 102 insertions(+)",
    "diff": "diff --git a/drivers/raw/ioat/idxd_pci.c b/drivers/raw/ioat/idxd_pci.c\nindex 762efd5ac..6655cf9b7 100644\n--- a/drivers/raw/ioat/idxd_pci.c\n+++ b/drivers/raw/ioat/idxd_pci.c\n@@ -51,10 +51,62 @@ idxd_is_wq_enabled(struct idxd_rawdev *idxd)\n \treturn (state & WQ_STATE_MASK) == 0x1;\n }\n \n+static void\n+idxd_pci_dev_stop(struct rte_rawdev *dev)\n+{\n+\tstruct idxd_rawdev *idxd = dev->dev_private;\n+\tuint8_t err_code;\n+\n+\tif (!idxd_is_wq_enabled(idxd)) {\n+\t\tIOAT_PMD_ERR(\"Work queue %d already disabled\", idxd->qid);\n+\t\treturn;\n+\t}\n+\n+\terr_code = idxd_pci_dev_command(idxd, idxd_disable_wq);\n+\tif (err_code || idxd_is_wq_enabled(idxd)) {\n+\t\tIOAT_PMD_ERR(\"Failed disabling work queue %d, error code: %#x\",\n+\t\t\t\tidxd->qid, err_code);\n+\t\treturn;\n+\t}\n+\tIOAT_PMD_DEBUG(\"Work queue %d disabled OK\", idxd->qid);\n+\n+\treturn;\n+}\n+\n+static int\n+idxd_pci_dev_start(struct rte_rawdev *dev)\n+{\n+\tstruct idxd_rawdev *idxd = dev->dev_private;\n+\tuint8_t err_code;\n+\n+\tif (idxd_is_wq_enabled(idxd)) {\n+\t\tIOAT_PMD_WARN(\"WQ %d already enabled\", idxd->qid);\n+\t\treturn 0;\n+\t}\n+\n+\tif (idxd->public.batch_ring == NULL) {\n+\t\tIOAT_PMD_ERR(\"WQ %d has not been fully configured\", idxd->qid);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\terr_code = idxd_pci_dev_command(idxd, idxd_enable_wq);\n+\tif (err_code || !idxd_is_wq_enabled(idxd)) {\n+\t\tIOAT_PMD_ERR(\"Failed enabling work queue %d, error code: %#x\",\n+\t\t\t\tidxd->qid, err_code);\n+\t\treturn err_code == 0 ? -1 : err_code;\n+\t}\n+\n+\tIOAT_PMD_DEBUG(\"Work queue %d enabled OK\", idxd->qid);\n+\n+\treturn 0;\n+}\n+\n static const struct rte_rawdev_ops idxd_pci_ops = {\n \t\t.dev_selftest = idxd_rawdev_test,\n \t\t.dump = idxd_dev_dump,\n \t\t.dev_configure = idxd_dev_configure,\n+\t\t.dev_start = idxd_pci_dev_start,\n+\t\t.dev_stop = idxd_pci_dev_stop,\n };\n \n /* each portal uses 4 x 4k pages */\ndiff --git a/drivers/raw/ioat/idxd_vdev.c b/drivers/raw/ioat/idxd_vdev.c\nindex 90ad11006..ab7efd216 100644\n--- a/drivers/raw/ioat/idxd_vdev.c\n+++ b/drivers/raw/ioat/idxd_vdev.c\n@@ -32,10 +32,60 @@ struct idxd_vdev_args {\n \tuint8_t wq_id;\n };\n \n+static void\n+idxd_vdev_stop(struct rte_rawdev *dev)\n+{\n+\tstruct idxd_rawdev *idxd = dev->dev_private;\n+\tint ret;\n+\n+\tif (!accfg_wq_is_enabled(idxd->u.vdev.wq)) {\n+\t\tIOAT_PMD_ERR(\"Work queue %s already disabled\",\n+\t\t\t\taccfg_wq_get_devname(idxd->u.vdev.wq));\n+\t\treturn;\n+\t}\n+\n+\tret = accfg_wq_disable(idxd->u.vdev.wq);\n+\tif (ret) {\n+\t\tIOAT_PMD_INFO(\"Work queue %s not disabled, continuing...\",\n+\t\t\t\taccfg_wq_get_devname(idxd->u.vdev.wq));\n+\t\treturn;\n+\t}\n+\tIOAT_PMD_DEBUG(\"Disabling work queue %s OK\",\n+\t\t\taccfg_wq_get_devname(idxd->u.vdev.wq));\n+\n+\treturn;\n+}\n+\n+static int\n+idxd_vdev_start(struct rte_rawdev *dev)\n+{\n+\tstruct idxd_rawdev *idxd = dev->dev_private;\n+\tint ret;\n+\n+\tif (accfg_wq_is_enabled(idxd->u.vdev.wq)) {\n+\t\tIOAT_PMD_ERR(\"Work queue %s already enabled\",\n+\t\t\t\taccfg_wq_get_devname(idxd->u.vdev.wq));\n+\t\treturn 0;\n+\t}\n+\n+\tret = accfg_wq_enable(idxd->u.vdev.wq);\n+\tif (ret) {\n+\t\tIOAT_PMD_ERR(\"Error enabling work queue %s\",\n+\t\t\t\taccfg_wq_get_devname(idxd->u.vdev.wq));\n+\t\treturn -1;\n+\t}\n+\tIOAT_PMD_DEBUG(\"Enabling work queue %s OK\",\n+\t\t\taccfg_wq_get_devname(idxd->u.vdev.wq));\n+\n+\treturn 0;\n+}\n+\n static const struct rte_rawdev_ops idxd_vdev_ops = {\n \t\t.dev_selftest = idxd_rawdev_test,\n \t\t.dump = idxd_dev_dump,\n \t\t.dev_configure = idxd_dev_configure,\n+\t\t.dev_start = idxd_vdev_start,\n+\t\t.dev_stop = idxd_vdev_stop,\n };\n \n static void *\n",
    "prefixes": [
        "20.11",
        "14/20"
    ]
}