get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 79040,
    "url": "http://patchwork.dpdk.org/api/patches/79040/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200928164245.84997-18-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20200928164245.84997-18-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200928164245.84997-18-bruce.richardson@intel.com",
    "date": "2020-09-28T16:42:37",
    "name": "[v4,17/25] raw/ioat: add configure function for idxd devices",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "57ee0d958ec7555ef2a1a5c36f104cf6bcc1f5c9",
    "submitter": {
        "id": 20,
        "url": "http://patchwork.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200928164245.84997-18-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 12560,
            "url": "http://patchwork.dpdk.org/api/series/12560/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=12560",
            "date": "2020-09-28T16:42:20",
            "name": "raw/ioat: enhancements and new hardware support",
            "version": 4,
            "mbox": "http://patchwork.dpdk.org/series/12560/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/79040/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/79040/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 94CAFA04DB;\n\tMon, 28 Sep 2020 18:49:08 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 59D901D9A8;\n\tMon, 28 Sep 2020 18:43:41 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n by dpdk.org (Postfix) with ESMTP id C75CC1D932\n for <dev@dpdk.org>; Mon, 28 Sep 2020 18:43:35 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 28 Sep 2020 09:43:32 -0700",
            "from silpixa00399126.ir.intel.com ([10.237.222.4])\n by fmsmga004.fm.intel.com with ESMTP; 28 Sep 2020 09:43:30 -0700"
        ],
        "IronPort-SDR": [
            "\n HmG7GlD1Bp1ECpaFs6EdU6GBSjsx60Gq1UOphLJzPmATtSv5s3ofEpisuGIvMuvgckj1LNmK4f\n HyMleP/N91oQ==",
            "\n XBHrZAGL/47PXi2GorkTvRK8vFQ0dhAjf3sRxpLDcYInWFR9tNS45j8DGewj9oquu8POUgAE/5\n GisifdXJ6OHg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9758\"; a=\"223619876\"",
            "E=Sophos;i=\"5.77,313,1596524400\"; d=\"scan'208\";a=\"223619876\"",
            "E=Sophos;i=\"5.77,313,1596524400\"; d=\"scan'208\";a=\"338250607\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "patrick.fu@intel.com, Bruce Richardson <bruce.richardson@intel.com>,\n Kevin Laatz <kevin.laatz@intel.com>",
        "Date": "Mon, 28 Sep 2020 17:42:37 +0100",
        "Message-Id": "<20200928164245.84997-18-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20200928164245.84997-1-bruce.richardson@intel.com>",
        "References": "<20200721095140.719297-1-bruce.richardson@intel.com>\n <20200928164245.84997-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v4 17/25] raw/ioat: add configure function for\n\tidxd devices",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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 configure function for idxd devices, taking the same parameters as the\nexisting configure function for ioat. The ring_size parameter is used to\ncompute the maximum number of bursts to be supported by the driver, given\nthat the hardware works on individual bursts of descriptors at a time.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nReviewed-by: Kevin Laatz <kevin.laatz@intel.com>\n---\n drivers/raw/ioat/idxd_pci.c            |  1 +\n drivers/raw/ioat/idxd_vdev.c           |  1 +\n drivers/raw/ioat/ioat_common.c         | 64 ++++++++++++++++++++++++++\n drivers/raw/ioat/ioat_private.h        |  3 ++\n drivers/raw/ioat/rte_ioat_rawdev_fns.h |  1 +\n 5 files changed, 70 insertions(+)",
    "diff": "diff --git a/drivers/raw/ioat/idxd_pci.c b/drivers/raw/ioat/idxd_pci.c\nindex 9bee927661..b173c5ae38 100644\n--- a/drivers/raw/ioat/idxd_pci.c\n+++ b/drivers/raw/ioat/idxd_pci.c\n@@ -55,6 +55,7 @@ static const struct rte_rawdev_ops idxd_pci_ops = {\n \t\t.dev_close = idxd_rawdev_close,\n \t\t.dev_selftest = idxd_rawdev_test,\n \t\t.dump = idxd_dev_dump,\n+\t\t.dev_configure = idxd_dev_configure,\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 ba78eee907..3dad1473b4 100644\n--- a/drivers/raw/ioat/idxd_vdev.c\n+++ b/drivers/raw/ioat/idxd_vdev.c\n@@ -34,6 +34,7 @@ static const struct rte_rawdev_ops idxd_vdev_ops = {\n \t\t.dev_close = idxd_rawdev_close,\n \t\t.dev_selftest = idxd_rawdev_test,\n \t\t.dump = idxd_dev_dump,\n+\t\t.dev_configure = idxd_dev_configure,\n };\n \n static void *\ndiff --git a/drivers/raw/ioat/ioat_common.c b/drivers/raw/ioat/ioat_common.c\nindex 672241351b..5173c331c9 100644\n--- a/drivers/raw/ioat/ioat_common.c\n+++ b/drivers/raw/ioat/ioat_common.c\n@@ -44,6 +44,70 @@ idxd_dev_dump(struct rte_rawdev *dev, FILE *f)\n \treturn 0;\n }\n \n+int\n+idxd_dev_configure(const struct rte_rawdev *dev,\n+\t\trte_rawdev_obj_t config, size_t config_size)\n+{\n+\tstruct idxd_rawdev *idxd = dev->dev_private;\n+\tstruct rte_idxd_rawdev *rte_idxd = &idxd->public;\n+\tstruct rte_ioat_rawdev_config *cfg = config;\n+\tuint16_t max_desc = cfg->ring_size;\n+\tuint16_t max_batches = max_desc / BATCH_SIZE;\n+\tuint16_t i;\n+\n+\tif (config_size != sizeof(*cfg))\n+\t\treturn -EINVAL;\n+\n+\tif (dev->started) {\n+\t\tIOAT_PMD_ERR(\"%s: Error, device is started.\", __func__);\n+\t\treturn -EAGAIN;\n+\t}\n+\n+\trte_idxd->hdls_disable = cfg->hdls_disable;\n+\n+\t/* limit the batches to what can be stored in hardware */\n+\tif (max_batches > idxd->max_batches) {\n+\t\tIOAT_PMD_DEBUG(\"Ring size of %u is too large for this device, need to limit to %u batches of %u\",\n+\t\t\t\tmax_desc, idxd->max_batches, BATCH_SIZE);\n+\t\tmax_batches = idxd->max_batches;\n+\t\tmax_desc = max_batches * BATCH_SIZE;\n+\t}\n+\tif (!rte_is_power_of_2(max_desc))\n+\t\tmax_desc = rte_align32pow2(max_desc);\n+\tIOAT_PMD_DEBUG(\"Rawdev %u using %u descriptors in %u batches\",\n+\t\t\tdev->dev_id, max_desc, max_batches);\n+\n+\t/* in case we are reconfiguring a device, free any existing memory */\n+\trte_free(rte_idxd->batch_ring);\n+\trte_free(rte_idxd->hdl_ring);\n+\n+\trte_idxd->batch_ring = rte_zmalloc(NULL,\n+\t\t\tsizeof(*rte_idxd->batch_ring) * max_batches, 0);\n+\tif (rte_idxd->batch_ring == NULL)\n+\t\treturn -ENOMEM;\n+\n+\trte_idxd->hdl_ring = rte_zmalloc(NULL,\n+\t\t\tsizeof(*rte_idxd->hdl_ring) * max_desc, 0);\n+\tif (rte_idxd->hdl_ring == NULL) {\n+\t\trte_free(rte_idxd->batch_ring);\n+\t\trte_idxd->batch_ring = NULL;\n+\t\treturn -ENOMEM;\n+\t}\n+\trte_idxd->batch_ring_sz = max_batches;\n+\trte_idxd->hdl_ring_sz = max_desc;\n+\n+\tfor (i = 0; i < rte_idxd->batch_ring_sz; i++) {\n+\t\tstruct rte_idxd_desc_batch *b = &rte_idxd->batch_ring[i];\n+\t\tb->batch_desc.completion = rte_mem_virt2iova(&b->comp);\n+\t\tb->batch_desc.desc_addr = rte_mem_virt2iova(&b->null_desc);\n+\t\tb->batch_desc.op_flags = (idxd_op_batch << IDXD_CMD_OP_SHIFT) |\n+\t\t\t\tIDXD_FLAG_COMPLETION_ADDR_VALID |\n+\t\t\t\tIDXD_FLAG_REQUEST_COMPLETION;\n+\t}\n+\n+\treturn 0;\n+}\n+\n int\n idxd_rawdev_create(const char *name, struct rte_device *dev,\n \t\t   const struct idxd_rawdev *base_idxd,\ndiff --git a/drivers/raw/ioat/ioat_private.h b/drivers/raw/ioat/ioat_private.h\nindex f521c85a1a..aba70d8d71 100644\n--- a/drivers/raw/ioat/ioat_private.h\n+++ b/drivers/raw/ioat/ioat_private.h\n@@ -59,6 +59,9 @@ extern int idxd_rawdev_create(const char *name, struct rte_device *dev,\n \n extern int idxd_rawdev_close(struct rte_rawdev *dev);\n \n+extern int idxd_dev_configure(const struct rte_rawdev *dev,\n+\t\trte_rawdev_obj_t config, size_t config_size);\n+\n extern int idxd_rawdev_test(uint16_t dev_id);\n \n extern int idxd_dev_dump(struct rte_rawdev *dev, FILE *f);\ndiff --git a/drivers/raw/ioat/rte_ioat_rawdev_fns.h b/drivers/raw/ioat/rte_ioat_rawdev_fns.h\nindex 178c432dd9..e9cdce0162 100644\n--- a/drivers/raw/ioat/rte_ioat_rawdev_fns.h\n+++ b/drivers/raw/ioat/rte_ioat_rawdev_fns.h\n@@ -187,6 +187,7 @@ struct rte_idxd_rawdev {\n \tuint16_t next_ret_hdl;   /* the next user hdl to return */\n \tuint16_t last_completed_hdl; /* the last user hdl that has completed */\n \tuint16_t next_free_hdl;  /* where the handle for next op will go */\n+\tuint16_t hdls_disable;   /* disable tracking completion handles */\n \n \tstruct rte_idxd_user_hdl *hdl_ring;\n \tstruct rte_idxd_desc_batch *batch_ring;\n",
    "prefixes": [
        "v4",
        "17/25"
    ]
}