get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 43037,
    "url": "http://patches.dpdk.org/api/patches/43037/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180713022825.33106-15-pablo.de.lara.guarch@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": "<20180713022825.33106-15-pablo.de.lara.guarch@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180713022825.33106-15-pablo.de.lara.guarch@intel.com",
    "date": "2018-07-13T02:28:23",
    "name": "[v7,14/16] compress/qat: add fns to create and destroy the PMD",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a02489e4840fe58ed3d4c84b0b4c6582fe6175be",
    "submitter": {
        "id": 9,
        "url": "http://patches.dpdk.org/api/people/9/?format=api",
        "name": "De Lara Guarch, Pablo",
        "email": "pablo.de.lara.guarch@intel.com"
    },
    "delegate": {
        "id": 22,
        "url": "http://patches.dpdk.org/api/users/22/?format=api",
        "username": "pdelarag",
        "first_name": "Pablo",
        "last_name": "de Lara Guarch",
        "email": "pablo.de.lara.guarch@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180713022825.33106-15-pablo.de.lara.guarch@intel.com/mbox/",
    "series": [
        {
            "id": 561,
            "url": "http://patches.dpdk.org/api/series/561/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=561",
            "date": "2018-07-13T02:28:09",
            "name": "compress/qat: add compression PMD",
            "version": 7,
            "mbox": "http://patches.dpdk.org/series/561/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/43037/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/43037/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2D16B1B439;\n\tFri, 13 Jul 2018 12:34:48 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 416235F65\n\tfor <dev@dpdk.org>; Fri, 13 Jul 2018 12:34:26 +0200 (CEST)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Jul 2018 03:34:25 -0700",
            "from silpixa00399466.ir.intel.com (HELO\n\tsilpixa00399466.ger.corp.intel.com) ([10.237.223.220])\n\tby orsmga004.jf.intel.com with ESMTP; 13 Jul 2018 03:34:24 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,347,1526367600\"; d=\"scan'208\";a=\"215718236\"",
        "From": "Pablo de Lara <pablo.de.lara.guarch@intel.com>",
        "To": "fiona.trahe@intel.com, tomaszx.jozwiak@intel.com, john.griffin@intel.com,\n\tdeepak.k.jain@intel.com",
        "Cc": "dev@dpdk.org",
        "Date": "Fri, 13 Jul 2018 03:28:23 +0100",
        "Message-Id": "<20180713022825.33106-15-pablo.de.lara.guarch@intel.com>",
        "X-Mailer": "git-send-email 2.14.4",
        "In-Reply-To": "<20180713022825.33106-1-pablo.de.lara.guarch@intel.com>",
        "References": "<1531411499-13156-1-git-send-email-fiona.trahe@intel.com>\n\t<20180713022825.33106-1-pablo.de.lara.guarch@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v7 14/16] compress/qat: add fns to create and\n\tdestroy the PMD",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Fiona Trahe <fiona.trahe@intel.com>\n\nNow that all the device operations are available,\nadd the functions to create and destroy the pmd.\nCalled on probe and remove of the qat pci device, these\nregister the device with the compressdev API\nand plug in all the device functionality.\n\nSigned-off-by: Fiona Trahe <fiona.trahe@intel.com>\nSigned-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>\n---\n drivers/common/qat/qat_device.h     |  4 ++\n drivers/common/qat/qat_qp.c         | 11 ++++-\n drivers/common/qat/qat_qp.h         |  5 ++\n drivers/compress/qat/qat_comp_pmd.c | 98 +++++++++++++++++++++++++++++++++++--\n drivers/compress/qat/qat_comp_pmd.h | 11 ++---\n 5 files changed, 117 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/drivers/common/qat/qat_device.h b/drivers/common/qat/qat_device.h\nindex 0cb370c72..9599fc596 100644\n--- a/drivers/common/qat/qat_device.h\n+++ b/drivers/common/qat/qat_device.h\n@@ -25,6 +25,8 @@\n  *  - runtime data\n  */\n struct qat_sym_dev_private;\n+struct qat_comp_dev_private;\n+\n struct qat_pci_device {\n \n \t/* Data used by all services */\n@@ -55,6 +57,8 @@ struct qat_pci_device {\n \t */\n \n \t/* Data relating to compression service */\n+\tstruct qat_comp_dev_private *comp_dev;\n+\t/**< link back to compressdev private data */\n \n \t/* Data relating to asymmetric crypto service */\n \ndiff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c\nindex 32c17596b..7ca7a45eb 100644\n--- a/drivers/common/qat/qat_qp.c\n+++ b/drivers/common/qat/qat_qp.c\n@@ -15,6 +15,7 @@\n #include \"qat_device.h\"\n #include \"qat_qp.h\"\n #include \"qat_sym.h\"\n+#include \"qat_comp.h\"\n #include \"adf_transport_access_macros.h\"\n \n \n@@ -606,8 +607,8 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops)\n \n \t\tif (tmp_qp->service_type == QAT_SERVICE_SYMMETRIC)\n \t\t\tqat_sym_process_response(ops, resp_msg);\n-\t\t/* add qat_asym_process_response here */\n-\t\t/* add qat_comp_process_response here */\n+\t\telse if (tmp_qp->service_type == QAT_SERVICE_COMPRESSION)\n+\t\t\tqat_comp_process_response(ops, resp_msg);\n \n \t\thead = adf_modulo(head + rx_queue->msg_size,\n \t\t\t\t  rx_queue->modulo_mask);\n@@ -633,3 +634,9 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops)\n \t}\n \treturn resp_counter;\n }\n+\n+__attribute__((weak)) int\n+qat_comp_process_response(void **op __rte_unused, uint8_t *resp __rte_unused)\n+{\n+\treturn  0;\n+}\ndiff --git a/drivers/common/qat/qat_qp.h b/drivers/common/qat/qat_qp.h\nindex 59db945e7..69f8a6131 100644\n--- a/drivers/common/qat/qat_qp.h\n+++ b/drivers/common/qat/qat_qp.h\n@@ -103,4 +103,9 @@ qat_qp_setup(struct qat_pci_device *qat_dev,\n int\n qat_qps_per_service(const struct qat_qp_hw_data *qp_hw_data,\n \t\t\tenum qat_service_type service);\n+\n+/* Needed for weak function*/\n+int\n+qat_comp_process_response(void **op __rte_unused, uint8_t *resp __rte_unused);\n+\n #endif /* _QAT_QP_H_ */\ndiff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c\nindex 013ff6e8d..9bb98974c 100644\n--- a/drivers/compress/qat/qat_comp_pmd.c\n+++ b/drivers/compress/qat/qat_comp_pmd.c\n@@ -5,6 +5,18 @@\n #include \"qat_comp.h\"\n #include \"qat_comp_pmd.h\"\n \n+static const struct rte_compressdev_capabilities qat_comp_gen_capabilities[] = {\n+\t{/* COMPRESSION - deflate */\n+\t .algo = RTE_COMP_ALGO_DEFLATE,\n+\t .comp_feature_flags = RTE_COMP_FF_MULTI_PKT_CHECKSUM |\n+\t\t\t\tRTE_COMP_FF_CRC32_CHECKSUM |\n+\t\t\t\tRTE_COMP_FF_ADLER32_CHECKSUM |\n+\t\t\t\tRTE_COMP_FF_CRC32_ADLER32_CHECKSUM |\n+\t\t\t\tRTE_COMP_FF_SHAREABLE_PRIV_XFORM |\n+\t\t\t\tRTE_COMP_FF_HUFFMAN_FIXED,\n+\t .window_size = {.min = 15, .max = 15, .increment = 0} },\n+\t{RTE_COMP_ALGO_LIST_END, 0, {0, 0, 0} } };\n+\n static void\n qat_comp_stats_get(struct rte_compressdev *dev,\n \t\tstruct rte_compressdev_stats *stats)\n@@ -225,14 +237,14 @@ qat_comp_dev_info_get(struct rte_compressdev *dev,\n \t}\n }\n \n-uint16_t\n+static uint16_t\n qat_comp_pmd_enqueue_op_burst(void *qp, struct rte_comp_op **ops,\n \t\tuint16_t nb_ops)\n {\n \treturn qat_enqueue_op_burst(qp, (void **)ops, nb_ops);\n }\n \n-uint16_t\n+static uint16_t\n qat_comp_pmd_dequeue_op_burst(void *qp, struct rte_comp_op **ops,\n \t\t\t      uint16_t nb_ops)\n {\n@@ -240,7 +252,7 @@ qat_comp_pmd_dequeue_op_burst(void *qp, struct rte_comp_op **ops,\n }\n \n \n-struct rte_compressdev_ops compress_qat_ops = {\n+static struct rte_compressdev_ops compress_qat_ops = {\n \n \t/* Device related operations */\n \t.dev_configure\t\t= qat_comp_dev_config,\n@@ -258,3 +270,83 @@ struct rte_compressdev_ops compress_qat_ops = {\n \t.private_xform_create\t= qat_comp_private_xform_create,\n \t.private_xform_free\t= qat_comp_private_xform_free\n };\n+\n+int\n+qat_comp_dev_create(struct qat_pci_device *qat_pci_dev)\n+{\n+\tif (qat_pci_dev->qat_dev_gen == QAT_GEN1) {\n+\t\tQAT_LOG(ERR, \"Compression PMD not supported on QAT dh895xcc\");\n+\t\treturn 0;\n+\t}\n+\n+\tstruct rte_compressdev_pmd_init_params init_params = {\n+\t\t.name = \"\",\n+\t\t.socket_id = qat_pci_dev->pci_dev->device.numa_node,\n+\t};\n+\tchar name[RTE_COMPRESSDEV_NAME_MAX_LEN];\n+\tstruct rte_compressdev *compressdev;\n+\tstruct qat_comp_dev_private *comp_dev;\n+\n+\tsnprintf(name, RTE_COMPRESSDEV_NAME_MAX_LEN, \"%s_%s\",\n+\t\t\tqat_pci_dev->name, \"comp\");\n+\tQAT_LOG(DEBUG, \"Creating QAT COMP device %s\", name);\n+\n+\tcompressdev = rte_compressdev_pmd_create(name,\n+\t\t\t&qat_pci_dev->pci_dev->device,\n+\t\t\tsizeof(struct qat_comp_dev_private),\n+\t\t\t&init_params);\n+\n+\tif (compressdev == NULL)\n+\t\treturn -ENODEV;\n+\n+\tcompressdev->dev_ops = &compress_qat_ops;\n+\n+\tcompressdev->enqueue_burst = qat_comp_pmd_enqueue_op_burst;\n+\tcompressdev->dequeue_burst = qat_comp_pmd_dequeue_op_burst;\n+\n+\tcompressdev->feature_flags = RTE_COMPDEV_FF_HW_ACCELERATED;\n+\n+\tcomp_dev = compressdev->data->dev_private;\n+\tcomp_dev->qat_dev = qat_pci_dev;\n+\tcomp_dev->compressdev = compressdev;\n+\tqat_pci_dev->comp_dev = comp_dev;\n+\n+\tswitch (qat_pci_dev->qat_dev_gen) {\n+\tcase QAT_GEN1:\n+\tcase QAT_GEN2:\n+\t\tcomp_dev->qat_dev_capabilities = qat_comp_gen_capabilities;\n+\t\tbreak;\n+\tdefault:\n+\t\tcomp_dev->qat_dev_capabilities = qat_comp_gen_capabilities;\n+\t\tQAT_LOG(DEBUG,\n+\t\t\t\"QAT gen %d capabilities unknown, default to GEN1\",\n+\t\t\t\t\tqat_pci_dev->qat_dev_gen);\n+\t\tbreak;\n+\t}\n+\n+\tQAT_LOG(DEBUG,\n+\t\t    \"Created QAT COMP device %s as compressdev instance %d\",\n+\t\t\tname, compressdev->data->dev_id);\n+\treturn 0;\n+}\n+\n+int\n+qat_comp_dev_destroy(struct qat_pci_device *qat_pci_dev)\n+{\n+\tstruct qat_comp_dev_private *comp_dev;\n+\n+\tif (qat_pci_dev == NULL)\n+\t\treturn -ENODEV;\n+\n+\tcomp_dev = qat_pci_dev->comp_dev;\n+\tif (comp_dev == NULL)\n+\t\treturn 0;\n+\n+\t/* clean up any resources used by the device */\n+\tqat_comp_dev_close(comp_dev->compressdev);\n+\n+\trte_compressdev_pmd_destroy(comp_dev->compressdev);\n+\tqat_pci_dev->comp_dev = NULL;\n+\n+\treturn 0;\n+}\ndiff --git a/drivers/compress/qat/qat_comp_pmd.h b/drivers/compress/qat/qat_comp_pmd.h\nindex 7ba1b8dc6..9ad2a2836 100644\n--- a/drivers/compress/qat/qat_comp_pmd.h\n+++ b/drivers/compress/qat/qat_comp_pmd.h\n@@ -27,16 +27,13 @@ struct qat_comp_dev_private {\n \t/**< The device's memory for intermediate buffers */\n \tstruct rte_mempool *xformpool;\n \t/**< The device's pool for qat_comp_xforms */\n-\n };\n \n-uint16_t\n-qat_comp_pmd_enqueue_op_burst(void *qp, struct rte_comp_op **ops,\n-\t\tuint16_t nb_ops);\n+int\n+qat_comp_dev_create(struct qat_pci_device *qat_pci_dev);\n \n-uint16_t\n-qat_comp_pmd_dequeue_op_burst(void *qp, struct rte_comp_op **ops,\n-\t\tuint16_t nb_ops);\n+int\n+qat_comp_dev_destroy(struct qat_pci_device *qat_pci_dev);\n \n #endif\n #endif /* _QAT_COMP_PMD_H_ */\n",
    "prefixes": [
        "v7",
        "14/16"
    ]
}