get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 42657,
    "url": "http://patches.dpdk.org/api/patches/42657/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1531183311-32619-6-git-send-email-fiona.trahe@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": "<1531183311-32619-6-git-send-email-fiona.trahe@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1531183311-32619-6-git-send-email-fiona.trahe@intel.com",
    "date": "2018-07-10T00:41:40",
    "name": "[v4,05/16] compress/qat: create fw request and process response",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "60492ed85dc88f71a3773348a8962f86e59d9a36",
    "submitter": {
        "id": 423,
        "url": "http://patches.dpdk.org/api/people/423/?format=api",
        "name": "Fiona Trahe",
        "email": "fiona.trahe@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/1531183311-32619-6-git-send-email-fiona.trahe@intel.com/mbox/",
    "series": [
        {
            "id": 425,
            "url": "http://patches.dpdk.org/api/series/425/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=425",
            "date": "2018-07-05T17:32:44",
            "name": "compress/qat: add compression PMD",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/425/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/42657/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/42657/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 DC28A1B1ED;\n\tTue, 10 Jul 2018 02:42:34 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id 858CA1B14C\n\tfor <dev@dpdk.org>; Tue, 10 Jul 2018 02:42:29 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t09 Jul 2018 17:42:27 -0700",
            "from sivswdev01.ir.intel.com (HELO localhost.localdomain)\n\t([10.237.217.45])\n\tby fmsmga006.fm.intel.com with ESMTP; 09 Jul 2018 17:42:20 -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,332,1526367600\"; d=\"scan'208\";a=\"244345494\"",
        "From": "Fiona Trahe <fiona.trahe@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "pablo.de.lara.guarch@intel.com, fiona.trahe@intel.com,\n\ttomaszx.jozwiak@intel.com",
        "Date": "Tue, 10 Jul 2018 01:41:40 +0100",
        "Message-Id": "<1531183311-32619-6-git-send-email-fiona.trahe@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": "<1530811980-24334-1-git-send-email-fiona.trahe@intel.com>",
        "References": "<1530811980-24334-1-git-send-email-fiona.trahe@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 05/16] compress/qat: create fw request and\n\tprocess response",
        "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": "Add functions to create the request message to send to\nfirmware and to process the firmware response.\n\nSigned-off-by: Fiona Trahe <fiona.trahe@intel.com>\nSigned-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>\n---\n drivers/compress/qat/qat_comp.c     | 101 ++++++++++++++++++++++++++++++++++++\n drivers/compress/qat/qat_comp.h     |   8 +++\n drivers/compress/qat/qat_comp_pmd.h |   1 +\n 3 files changed, 110 insertions(+)",
    "diff": "diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c\nindex cb2005a..a32d6ef 100644\n--- a/drivers/compress/qat/qat_comp.c\n+++ b/drivers/compress/qat/qat_comp.c\n@@ -19,6 +19,107 @@\n #include \"qat_comp.h\"\n #include \"qat_comp_pmd.h\"\n \n+\n+int\n+qat_comp_build_request(void *in_op, uint8_t *out_msg,\n+\t\t       void *op_cookie __rte_unused,\n+\t\t       enum qat_device_gen qat_dev_gen __rte_unused)\n+{\n+\tstruct rte_comp_op *op = in_op;\n+\tstruct qat_comp_xform *qat_xform = op->private_xform;\n+\tconst uint8_t *tmpl = (uint8_t *)&qat_xform->qat_comp_req_tmpl;\n+\tstruct icp_qat_fw_comp_req *comp_req =\n+\t    (struct icp_qat_fw_comp_req *)out_msg;\n+\n+\tif (unlikely(op->op_type != RTE_COMP_OP_STATELESS)) {\n+\t\tQAT_DP_LOG(ERR, \"QAT PMD only supports stateless compression \"\n+\t\t\t\t\"operation requests, op (%p) is not a \"\n+\t\t\t\t\"stateless operation.\", op);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\trte_mov128(out_msg, tmpl);\n+\tcomp_req->comn_mid.opaque_data = (uint64_t)(uintptr_t)op;\n+\n+\t/* common for sgl and flat buffers */\n+\tcomp_req->comp_pars.comp_len = op->src.length;\n+\tcomp_req->comp_pars.out_buffer_sz = rte_pktmbuf_pkt_len(op->m_dst);\n+\n+\t/* sgl */\n+\tif (op->m_src->next != NULL || op->m_dst->next != NULL) {\n+\t\tQAT_DP_LOG(ERR, \"QAT PMD doesn't support scatter gather\");\n+\t\treturn -EINVAL;\n+\n+\t} else {\n+\t\tICP_QAT_FW_COMN_PTR_TYPE_SET(comp_req->comn_hdr.comn_req_flags,\n+\t\t\t\tQAT_COMN_PTR_TYPE_FLAT);\n+\t\tcomp_req->comn_mid.src_length = rte_pktmbuf_data_len(op->m_src);\n+\t\tcomp_req->comn_mid.dst_length = rte_pktmbuf_data_len(op->m_dst);\n+\n+\t\tcomp_req->comn_mid.src_data_addr =\n+\t\t    rte_pktmbuf_mtophys_offset(op->m_src, op->src.offset);\n+\t\tcomp_req->comn_mid.dest_data_addr =\n+\t\t    rte_pktmbuf_mtophys_offset(op->m_dst, op->dst.offset);\n+\t}\n+\n+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG\n+\tQAT_DP_LOG(DEBUG, \"Direction: %s\",\n+\t    qat_xform->qat_comp_request_type == QAT_COMP_REQUEST_DECOMPRESS ?\n+\t\t\t    \"decompression\" : \"compression\");\n+\tQAT_DP_HEXDUMP_LOG(DEBUG, \"qat compression message:\", comp_req,\n+\t\t    sizeof(struct icp_qat_fw_comp_req));\n+#endif\n+\treturn 0;\n+}\n+\n+int\n+qat_comp_process_response(void **op, uint8_t *resp)\n+{\n+\tstruct icp_qat_fw_comp_resp *resp_msg =\n+\t\t\t(struct icp_qat_fw_comp_resp *)resp;\n+\tstruct rte_comp_op *rx_op = (struct rte_comp_op *)(uintptr_t)\n+\t\t\t(resp_msg->opaque_data);\n+\n+#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG\n+\tQAT_DP_LOG(DEBUG, \"Direction: %s\",\n+\t    qat_xform->qat_comp_request_type == QAT_COMP_REQUEST_DECOMPRESS ?\n+\t    \"decompression\" : \"compression\");\n+\tQAT_DP_HEXDUMP_LOG(DEBUG,  \"qat_response:\", (uint8_t *)resp_msg,\n+\t\t\tsizeof(struct icp_qat_fw_comp_resp));\n+#endif\n+\n+\tif ((ICP_QAT_FW_COMN_RESP_CMP_STAT_GET(resp_msg->comn_resp.comn_status)\n+\t\t| ICP_QAT_FW_COMN_RESP_XLAT_STAT_GET(\n+\t\t\t\tresp_msg->comn_resp.comn_status)) !=\n+\t\t\t\tICP_QAT_FW_COMN_STATUS_FLAG_OK) {\n+\n+\t\trx_op->status = RTE_COMP_OP_STATUS_ERROR;\n+\t\trx_op->debug_status =\n+\t\t\t*((uint16_t *)(&resp_msg->comn_resp.comn_error));\n+\t} else {\n+\t\tstruct qat_comp_xform *qat_xform = rx_op->private_xform;\n+\t\tstruct icp_qat_fw_resp_comp_pars *comp_resp =\n+\t\t  (struct icp_qat_fw_resp_comp_pars *)&resp_msg->comp_resp_pars;\n+\n+\t\trx_op->status = RTE_COMP_OP_STATUS_SUCCESS;\n+\t\trx_op->consumed = comp_resp->input_byte_counter;\n+\t\trx_op->produced = comp_resp->output_byte_counter;\n+\n+\t\tif (qat_xform->checksum_type != RTE_COMP_CHECKSUM_NONE) {\n+\t\t\tif (qat_xform->checksum_type == RTE_COMP_CHECKSUM_CRC32)\n+\t\t\t\trx_op->output_chksum = comp_resp->curr_crc32;\n+\t\t\telse if (qat_xform->checksum_type ==\n+\t\t\t\t\tRTE_COMP_CHECKSUM_ADLER32)\n+\t\t\t\trx_op->output_chksum = comp_resp->curr_adler_32;\n+\t\t\telse\n+\t\t\t\trx_op->output_chksum = comp_resp->curr_chksum;\n+\t\t}\n+\t}\n+\t*op = (void *)rx_op;\n+\n+\treturn 0;\n+}\n+\n unsigned int\n qat_comp_xform_size(void)\n {\ndiff --git a/drivers/compress/qat/qat_comp.h b/drivers/compress/qat/qat_comp.h\nindex 0f58a76..46105b4 100644\n--- a/drivers/compress/qat/qat_comp.h\n+++ b/drivers/compress/qat/qat_comp.h\n@@ -10,6 +10,7 @@\n #include <rte_compressdev.h>\n #include <rte_compressdev_pmd.h>\n \n+#include \"qat_common.h\"\n #include \"icp_qat_hw.h\"\n #include \"icp_qat_fw_comp.h\"\n #include \"icp_qat_fw_la.h\"\n@@ -28,6 +29,13 @@ struct qat_comp_xform {\n \tenum rte_comp_checksum_type checksum_type;\n };\n \n+int\n+qat_comp_build_request(void *in_op, uint8_t *out_msg, void *op_cookie,\n+\t\t       enum qat_device_gen qat_dev_gen __rte_unused);\n+\n+int\n+qat_comp_process_response(void **op, uint8_t *resp);\n+\n \n int\n qat_comp_private_xform_create(struct rte_compressdev *dev,\ndiff --git a/drivers/compress/qat/qat_comp_pmd.h b/drivers/compress/qat/qat_comp_pmd.h\nindex fd97cbf..cd04f11 100644\n--- a/drivers/compress/qat/qat_comp_pmd.h\n+++ b/drivers/compress/qat/qat_comp_pmd.h\n@@ -10,6 +10,7 @@\n #include <rte_compressdev.h>\n #include <rte_compressdev_pmd.h>\n \n+#include \"qat_device.h\"\n \n /** private data structure for a QAT compression device.\n  * This QAT device is a device offering only a compression service,\n",
    "prefixes": [
        "v4",
        "05/16"
    ]
}