get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 118784,
    "url": "http://patches.dpdk.org/api/patches/118784/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221020111453.1982947-6-ktejasree@marvell.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": "<20221020111453.1982947-6-ktejasree@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221020111453.1982947-6-ktejasree@marvell.com",
    "date": "2022-10-20T11:14:52",
    "name": "[12/13] crypto/cnxk: verify IV length during session create",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "8cd637e352c868185c58731303bceef12661c79f",
    "submitter": {
        "id": 1789,
        "url": "http://patches.dpdk.org/api/people/1789/?format=api",
        "name": "Tejasree Kondoj",
        "email": "ktejasree@marvell.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20221020111453.1982947-6-ktejasree@marvell.com/mbox/",
    "series": [
        {
            "id": 25341,
            "url": "http://patches.dpdk.org/api/series/25341/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=25341",
            "date": "2022-10-20T11:14:47",
            "name": "fixes and improvements to cnxk crypto PMD",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/25341/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/118784/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/118784/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 9E67BA0552;\n\tThu, 20 Oct 2022 13:15:28 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A176042D5D;\n\tThu, 20 Oct 2022 13:15:10 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id AE65942D5D\n for <dev@dpdk.org>; Thu, 20 Oct 2022 13:15:08 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id\n 29K8KTLu021245\n for <dev@dpdk.org>; Thu, 20 Oct 2022 04:15:07 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3kb2qx8jcx-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Thu, 20 Oct 2022 04:15:07 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Thu, 20 Oct 2022 04:15:06 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Thu, 20 Oct 2022 04:15:06 -0700",
            "from hyd1554.marvell.com (unknown [10.29.57.11])\n by maili.marvell.com (Postfix) with ESMTP id 5F35D3F707D;\n Thu, 20 Oct 2022 04:15:04 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=Q1FxSLIwrLrbG0xqGVCT3BwyHu4/TwbqjHpdj9dHIUE=;\n b=a1wtd0jydTpkJylqrA5XDHWplBqIBufRQ34DkTv1qwalFKj7mBoaHbML4D2nCnYvIaqW\n OEsmNOHMW61yt3gZ5o/YLz+//vWxEauKrS5+kbTjIM2JtHdkS+r2qsQhgB9WoB8WGm3u\n gLDh2VpyToODZt/KkCA+MsGqCCg3zmTuee8fLz1Eujnv+OOEzVUzjtbIyJkmCjYztHn+\n hWGcL3NlJ4cMBLoKHVJiJJxVOcH0VQjFAgd7RJ5hZBc47Kt+TG9zCPLfUIVjznhwJPd8\n oEAfcuTDDjQZQSpF+Ke53g3ljZV+S25dUq/hfQky8fhluJf8GdzvoODW/CrjL+XcS9Sv Ag==",
        "From": "Tejasree Kondoj <ktejasree@marvell.com>",
        "To": "Akhil Goyal <gakhil@marvell.com>",
        "CC": "Anoob Joseph <anoobj@marvell.com>, Vidya Sagar Velumuri\n <vvelumuri@marvell.com>, <dev@dpdk.org>",
        "Subject": "[PATCH 12/13] crypto/cnxk: verify IV length during session create",
        "Date": "Thu, 20 Oct 2022 16:44:52 +0530",
        "Message-ID": "<20221020111453.1982947-6-ktejasree@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20221020111453.1982947-1-ktejasree@marvell.com>",
        "References": "<20221020111453.1982947-1-ktejasree@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "L1A6i6t8SaGFyPlzrTMvanZPa1NCZy3h",
        "X-Proofpoint-ORIG-GUID": "L1A6i6t8SaGFyPlzrTMvanZPa1NCZy3h",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1\n definitions=2022-10-20_03,2022-10-20_01,2022-06-22_01",
        "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"
    },
    "content": "From: Anoob Joseph <anoobj@marvell.com>\n\nFor Kasumi cipher operation, IV is a must. Verify the arg provided in\nsession creation and remove datapath check.\n\nCoverity issue: 381020 381019\nFixes: 7a59ccc1b502 (\"crypto/cnxk: remove extra indirection for FC and Kasumi\")\n\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\n---\n drivers/crypto/cnxk/cnxk_se.h | 44 ++++++++++++++---------------------\n 1 file changed, 17 insertions(+), 27 deletions(-)",
    "diff": "diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h\nindex ac97b864b9..4675512bbc 100644\n--- a/drivers/crypto/cnxk/cnxk_se.h\n+++ b/drivers/crypto/cnxk/cnxk_se.h\n@@ -1753,35 +1753,17 @@ cpt_kasumi_enc_prep(uint32_t req_flags, uint64_t d_offs, uint64_t d_lens,\n \tauth_data_len = ROC_SE_AUTH_DLEN(d_lens);\n \n \tse_ctx = params->ctx;\n+\tiv_s = params->iv_buf;\n \tflags = se_ctx->zsk_flags;\n \tmac_len = se_ctx->mac_len;\n \n-\tif (flags == 0x0)\n-\t\tiv_s = params->iv_buf;\n-\telse\n-\t\tiv_s = params->auth_iv_buf;\n-\n \tdir = iv_s[8] & 0x1;\n \n-\tcpt_inst_w4.s.opcode_major = ROC_SE_MAJOR_OP_KASUMI | ROC_SE_DMA_MODE;\n-\n-\t/* indicates ECB/CBC, direction, ctx from cptr, iv from dptr */\n-\tcpt_inst_w4.s.opcode_minor = ((1 << 6) | (se_ctx->k_ecb << 5) |\n-\t\t\t\t      (dir << 4) | (0 << 3) | (flags & 0x7));\n-\n-\t/*\n-\t * GP op header, lengths are expected in bits.\n-\t */\n-\tcpt_inst_w4.s.param1 = encr_data_len;\n-\tcpt_inst_w4.s.param2 = auth_data_len;\n-\n-\t/* consider iv len */\n \tif (flags == 0x0) {\n+\t\t/* Consider IV len */\n \t\tencr_offset += iv_len;\n \t\tauth_offset += iv_len;\n-\t}\n \n-\tif (flags == 0x0) {\n \t\tinputlen = encr_offset + (RTE_ALIGN(encr_data_len, 8) / 8);\n \t\toutputlen = inputlen;\n \t\t/* iv offset is 0 */\n@@ -1803,6 +1785,15 @@ cpt_kasumi_enc_prep(uint32_t req_flags, uint64_t d_offs, uint64_t d_lens,\n \t\t}\n \t}\n \n+\tcpt_inst_w4.s.opcode_major = ROC_SE_MAJOR_OP_KASUMI | ROC_SE_DMA_MODE;\n+\n+\t/* Indicate ECB/CBC, direction, CTX from CPTR, IV from DPTR */\n+\tcpt_inst_w4.s.opcode_minor =\n+\t\t((1 << 6) | (se_ctx->k_ecb << 5) | (dir << 4) | (0 << 3) | (flags & 0x7));\n+\n+\tcpt_inst_w4.s.param1 = encr_data_len;\n+\tcpt_inst_w4.s.param2 = auth_data_len;\n+\n \tinst->w4.u64 = cpt_inst_w4.u64;\n \tif (is_sg_ver2)\n \t\tsg2_inst_prep(params, inst, offset_ctrl, iv_s, iv_len, 0, 0, inputlen, outputlen, 0,\n@@ -2017,6 +2008,8 @@ fill_sess_cipher(struct rte_crypto_sym_xform *xform, struct cnxk_se_sess *sess)\n \tcase RTE_CRYPTO_CIPHER_KASUMI_F8:\n \t\tif (sess->chained_op)\n \t\t\treturn -ENOTSUP;\n+\t\tif (c_form->iv.length != 8)\n+\t\t\treturn -EINVAL;\n \t\tenc_type = ROC_SE_KASUMI_F8_ECB;\n \t\tcipher_key_len = 16;\n \t\tzsk_flag = ROC_SE_K_F8;\n@@ -2433,15 +2426,12 @@ fill_fc_params(struct rte_crypto_op *cop, struct cnxk_se_sess *sess,\n \tfc_params.mac_buf.size = 0;\n \tfc_params.mac_buf.vaddr = 0;\n \n-\tif (likely(sess->iv_length)) {\n+\tif (likely(is_kasumi || sess->iv_length)) {\n \t\tflags |= ROC_SE_VALID_IV_BUF;\n-\t\tfc_params.iv_buf = rte_crypto_op_ctod_offset(cop, uint8_t *,\n-\t\t\t\t\t\t\t     sess->iv_offset);\n+\t\tfc_params.iv_buf = rte_crypto_op_ctod_offset(cop, uint8_t *, sess->iv_offset);\n \t\tif (!is_aead && sess->aes_ctr && unlikely(sess->iv_length != 16)) {\n \t\t\tmemcpy((uint8_t *)iv_buf,\n-\t\t\t       rte_crypto_op_ctod_offset(cop, uint8_t *,\n-\t\t\t\t\t\t\t sess->iv_offset),\n-\t\t\t       12);\n+\t\t\t       rte_crypto_op_ctod_offset(cop, uint8_t *, sess->iv_offset), 12);\n \t\t\tiv_buf[3] = rte_cpu_to_be_32(0x1);\n \t\t\tfc_params.iv_buf = iv_buf;\n \t\t}\n@@ -3017,7 +3007,7 @@ fill_digest_params(struct rte_crypto_op *cop, struct cnxk_se_sess *sess,\n \n \t\t\t/* Store it at end of auth iv */\n \t\t\tiv_buf[8] = direction;\n-\t\t\tparams.auth_iv_buf = iv_buf;\n+\t\t\tparams.iv_buf = iv_buf;\n \t\t}\n \t}\n \n",
    "prefixes": [
        "12/13"
    ]
}