get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 121079,
    "url": "http://patches.dpdk.org/api/patches/121079/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221220143232.2519650-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": "<20221220143232.2519650-6-ktejasree@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221220143232.2519650-6-ktejasree@marvell.com",
    "date": "2022-12-20T14:32:20",
    "name": "[05/17] crypto/cnxk: support truncated digest length",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "9044367941ef286ef2a055f519c5aa976214acc6",
    "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/20221220143232.2519650-6-ktejasree@marvell.com/mbox/",
    "series": [
        {
            "id": 26195,
            "url": "http://patches.dpdk.org/api/series/26195/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26195",
            "date": "2022-12-20T14:32:15",
            "name": "fixes and improvements to cnxk crytpo PMD",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/26195/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/121079/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/121079/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 BCD1EA0545;\n\tTue, 20 Dec 2022 15:33:16 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A83D542D29;\n\tTue, 20 Dec 2022 15:32:54 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 1E60042D29\n for <dev@dpdk.org>; Tue, 20 Dec 2022 15:32:53 +0100 (CET)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 2BKEOPTL018983 for <dev@dpdk.org>; Tue, 20 Dec 2022 06:32:52 -0800",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3mhe5rnb5b-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Tue, 20 Dec 2022 06:32:52 -0800",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42;\n Tue, 20 Dec 2022 06:32:50 -0800",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend\n Transport; Tue, 20 Dec 2022 06:32:50 -0800",
            "from hyd1554.marvell.com (unknown [10.29.57.11])\n by maili.marvell.com (Postfix) with ESMTP id D5D7B3F704C;\n Tue, 20 Dec 2022 06:32:47 -0800 (PST)"
        ],
        "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=dpRwqrMVDbpvPS+whSmo6Abyt17fjULTTPK5XJaZL3o=;\n b=iZOS7rbQUK7p1ySFPRLZvjaCWc91kI2S9L/2E0TTSVtXvTNEhJySU8kQ8P9YJzPORrnR\n keITX9uXJe9G+OyjT3NBiLPe4rz+YPglpwcODZe4MUeEQPVnp6oLxrt/1hk7P1EVf+rV\n 1avej4ioCG27iDsK9bwG9QDvADtd4icTrO+6QGFpnP4z8J5zgQ3XSZIoKHF4A+h8eq/C\n YytWA2CEFAsnv4EU6tfeZGfpjbskGU0IZogcfjdsXlSiO7KWqanYzr9OsLiD6MVcfk2L\n mD4q6nhXh7T9BBrL5VFUtqgC+Im4WhtD4OuZL9X+UiWHL2JbpUyL2J/mHQIqMUx+4pAK 6w==",
        "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>, Gowrishankar Muthukrishnan\n <gmuthukrishn@marvell.com>, Volodymyr Fialko <vfialko@marvell.com>, \"Aakash\n Sasidharan\" <asasidharan@marvell.com>, <dev@dpdk.org>",
        "Subject": "[PATCH 05/17] crypto/cnxk: support truncated digest length",
        "Date": "Tue, 20 Dec 2022 20:02:20 +0530",
        "Message-ID": "<20221220143232.2519650-6-ktejasree@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20221220143232.2519650-1-ktejasree@marvell.com>",
        "References": "<20221220143232.2519650-1-ktejasree@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "UdstAe4pVNvZOcQT5BHu84Yl7tLC8yZg",
        "X-Proofpoint-ORIG-GUID": "UdstAe4pVNvZOcQT5BHu84Yl7tLC8yZg",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1\n definitions=2022-12-20_05,2022-12-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": "Adding truncated digest length support.\n\nSigned-off-by: Tejasree Kondoj <ktejasree@marvell.com>\n---\n .../crypto/cnxk/cnxk_cryptodev_capabilities.c | 48 +++++++++----------\n drivers/crypto/cnxk/cnxk_se.h                 | 19 ++++----\n 2 files changed, 35 insertions(+), 32 deletions(-)",
    "diff": "diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c\nindex 6c28f8942e..9dfbf875ec 100644\n--- a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c\n+++ b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c\n@@ -108,9 +108,9 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {\n \t\t\t\t\t.increment = 0\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n-\t\t\t\t\t.min = 20,\n+\t\t\t\t\t.min = 1,\n \t\t\t\t\t.max = 20,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t}, }\n \t\t}, }\n@@ -128,9 +128,9 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {\n \t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n-\t\t\t\t\t.min = 12,\n+\t\t\t\t\t.min = 1,\n \t\t\t\t\t.max = 20,\n-\t\t\t\t\t.increment = 8\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t}, }\n \t\t}, }\n@@ -148,9 +148,9 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {\n \t\t\t\t\t.increment = 0\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n-\t\t\t\t\t.min = 28,\n+\t\t\t\t\t.min = 1,\n \t\t\t\t\t.max = 28,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t}, }\n \t\t}, }\n@@ -168,9 +168,9 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {\n \t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n-\t\t\t\t\t.min = 28,\n+\t\t\t\t\t.min = 1,\n \t\t\t\t\t.max = 28,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t}, }\n \t\t}, }\n@@ -188,9 +188,9 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {\n \t\t\t\t\t.increment = 0\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n-\t\t\t\t\t.min = 32,\n+\t\t\t\t\t.min = 1,\n \t\t\t\t\t.max = 32,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t}, }\n \t\t}, }\n@@ -208,9 +208,9 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {\n \t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n-\t\t\t\t\t.min = 16,\n+\t\t\t\t\t.min = 1,\n \t\t\t\t\t.max = 32,\n-\t\t\t\t\t.increment = 16\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t}, }\n \t\t}, }\n@@ -228,9 +228,9 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {\n \t\t\t\t\t.increment = 0\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n-\t\t\t\t\t.min = 48,\n+\t\t\t\t\t.min = 1,\n \t\t\t\t\t.max = 48,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.increment = 1\n \t\t\t\t\t},\n \t\t\t}, }\n \t\t}, }\n@@ -248,9 +248,9 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {\n \t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n-\t\t\t\t\t.min = 24,\n+\t\t\t\t\t.min = 1,\n \t\t\t\t\t.max = 48,\n-\t\t\t\t\t.increment = 24\n+\t\t\t\t\t.increment = 1\n \t\t\t\t\t},\n \t\t\t}, }\n \t\t}, }\n@@ -268,9 +268,9 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {\n \t\t\t\t\t.increment = 0\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n-\t\t\t\t\t.min = 64,\n+\t\t\t\t\t.min = 1,\n \t\t\t\t\t.max = 64,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t}, }\n \t\t}, }\n@@ -288,9 +288,9 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {\n \t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n-\t\t\t\t\t.min = 32,\n+\t\t\t\t\t.min = 1,\n \t\t\t\t\t.max = 64,\n-\t\t\t\t\t.increment = 32\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t}, }\n \t\t}, }\n@@ -308,9 +308,9 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {\n \t\t\t\t\t.increment = 0\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n-\t\t\t\t\t.min = 16,\n+\t\t\t\t\t.min = 1,\n \t\t\t\t\t.max = 16,\n-\t\t\t\t\t.increment = 0\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t}, }\n \t\t}, }\n@@ -328,9 +328,9 @@ static const struct rte_cryptodev_capabilities caps_sha1_sha2[] = {\n \t\t\t\t\t.increment = 8\n \t\t\t\t},\n \t\t\t\t.digest_size = {\n-\t\t\t\t\t.min = 12,\n+\t\t\t\t\t.min = 1,\n \t\t\t\t\t.max = 16,\n-\t\t\t\t\t.increment = 4\n+\t\t\t\t\t.increment = 1\n \t\t\t\t},\n \t\t\t}, }\n \t\t}, }\ndiff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h\nindex b07fc22858..ce4c2bb585 100644\n--- a/drivers/crypto/cnxk/cnxk_se.h\n+++ b/drivers/crypto/cnxk/cnxk_se.h\n@@ -148,30 +148,33 @@ cpt_mac_len_verify(struct rte_crypto_auth_xform *auth)\n \tuint16_t mac_len = auth->digest_length;\n \tint ret;\n \n+\tif ((auth->algo != RTE_CRYPTO_AUTH_NULL) && (mac_len == 0))\n+\t\treturn -1;\n+\n \tswitch (auth->algo) {\n \tcase RTE_CRYPTO_AUTH_MD5:\n \tcase RTE_CRYPTO_AUTH_MD5_HMAC:\n-\t\tret = (mac_len == 16) ? 0 : -1;\n+\t\tret = (mac_len <= 16) ? 0 : -1;\n \t\tbreak;\n \tcase RTE_CRYPTO_AUTH_SHA1:\n \tcase RTE_CRYPTO_AUTH_SHA1_HMAC:\n-\t\tret = (mac_len == 20) ? 0 : -1;\n+\t\tret = (mac_len <= 20) ? 0 : -1;\n \t\tbreak;\n \tcase RTE_CRYPTO_AUTH_SHA224:\n \tcase RTE_CRYPTO_AUTH_SHA224_HMAC:\n-\t\tret = (mac_len == 28) ? 0 : -1;\n+\t\tret = (mac_len <= 28) ? 0 : -1;\n \t\tbreak;\n \tcase RTE_CRYPTO_AUTH_SHA256:\n \tcase RTE_CRYPTO_AUTH_SHA256_HMAC:\n-\t\tret = (mac_len == 32) ? 0 : -1;\n+\t\tret = (mac_len <= 32) ? 0 : -1;\n \t\tbreak;\n \tcase RTE_CRYPTO_AUTH_SHA384:\n \tcase RTE_CRYPTO_AUTH_SHA384_HMAC:\n-\t\tret = (mac_len == 48) ? 0 : -1;\n+\t\tret = (mac_len <= 48) ? 0 : -1;\n \t\tbreak;\n \tcase RTE_CRYPTO_AUTH_SHA512:\n \tcase RTE_CRYPTO_AUTH_SHA512_HMAC:\n-\t\tret = (mac_len == 64) ? 0 : -1;\n+\t\tret = (mac_len <= 64) ? 0 : -1;\n \t\tbreak;\n \tcase RTE_CRYPTO_AUTH_NULL:\n \t\tret = 0;\n@@ -838,7 +841,7 @@ cpt_digest_gen_sg_ver1_prep(uint32_t flags, uint64_t d_lens, struct roc_se_fc_pa\n \n \t/*GP op header */\n \tcpt_inst_w4.s.opcode_minor = 0;\n-\tcpt_inst_w4.s.param2 = ((uint16_t)hash_type << 8);\n+\tcpt_inst_w4.s.param2 = ((uint16_t)hash_type << 8) | mac_len;\n \tif (ctx->hmac) {\n \t\tcpt_inst_w4.s.opcode_major =\n \t\t\tROC_SE_MAJOR_OP_HMAC | ROC_SE_DMA_MODE;\n@@ -969,7 +972,7 @@ cpt_digest_gen_sg_ver2_prep(uint32_t flags, uint64_t d_lens, struct roc_se_fc_pa\n \n \t/*GP op header */\n \tcpt_inst_w4.s.opcode_minor = 0;\n-\tcpt_inst_w4.s.param2 = ((uint16_t)hash_type << 8);\n+\tcpt_inst_w4.s.param2 = ((uint16_t)hash_type << 8) | mac_len;\n \tif (ctx->hmac) {\n \t\tcpt_inst_w4.s.opcode_major = ROC_SE_MAJOR_OP_HMAC;\n \t\tcpt_inst_w4.s.param1 = key_len;\n",
    "prefixes": [
        "05/17"
    ]
}