get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 119030,
    "url": "http://patches.dpdk.org/api/patches/119030/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221024134409.1896776-6-zhangfei.gao@linaro.org/",
    "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": "<20221024134409.1896776-6-zhangfei.gao@linaro.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221024134409.1896776-6-zhangfei.gao@linaro.org",
    "date": "2022-10-24T13:44:08",
    "name": "[resend,v5,5/6] crypto/uadk: support auth algorithms",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "6c1d9ebce0fd04e03a0e20f6db094e8d70552e57",
    "submitter": {
        "id": 2701,
        "url": "http://patches.dpdk.org/api/people/2701/?format=api",
        "name": "Zhangfei Gao",
        "email": "zhangfei.gao@linaro.org"
    },
    "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/20221024134409.1896776-6-zhangfei.gao@linaro.org/mbox/",
    "series": [
        {
            "id": 25388,
            "url": "http://patches.dpdk.org/api/series/25388/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=25388",
            "date": "2022-10-24T13:44:03",
            "name": "crypto/uadk: introduce uadk crypto driver",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/25388/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/119030/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/119030/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 65641A034C;\n\tMon, 24 Oct 2022 15:51:20 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 515B842BCC;\n\tMon, 24 Oct 2022 15:50:58 +0200 (CEST)",
            "from mail-wm1-f54.google.com (mail-wm1-f54.google.com\n [209.85.128.54]) by mails.dpdk.org (Postfix) with ESMTP id 638A842BB4\n for <dev@dpdk.org>; Mon, 24 Oct 2022 15:50:53 +0200 (CEST)",
            "by mail-wm1-f54.google.com with SMTP id\n l16-20020a05600c4f1000b003c6c0d2a445so6670282wmq.4\n for <dev@dpdk.org>; Mon, 24 Oct 2022 06:50:53 -0700 (PDT)",
            "from localhost.localdomain ([213.146.143.36])\n by smtp.gmail.com with ESMTPSA id\n t8-20020a0560001a4800b00236644228cfsm5764108wry.43.2022.10.24.06.50.52\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 24 Oct 2022 06:50:52 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=/JBYhvf0yJ5Fb2ws3Ja0zSA7JAY69V1MEUf3sQRg0t4=;\n b=bdlgwn76x+HTg2CsATzHjh++tpJUwi2gIFfTMUT+QtuOMVkGZ90lFYnQO6HlLTIOiy\n DY0R2skksBVaDwnye0KLjjb2c0gXNAfkW1LDLlybQi3genKhD8lkay22IKEcaVs6oL/e\n 2ubnkesfBaWSOwpXYoa8yuB0cgrJd/dxpHfZaqa436JvFb5PX7n5CXBjSkiEmBaU6OA8\n yW0uarYeSZZzTIcZ+Zw3ypqbh/K7CZwwQTR3ChS1OPxKeiAMj/wdh7Lj1avnpOrbCQh5\n KbUcGz9HQ4hv7n9QCSBCvMuYU7owfi5ALFXQ9u0DdThs97lc3YzifTfdHdZxnPTddfBH\n kHOg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=/JBYhvf0yJ5Fb2ws3Ja0zSA7JAY69V1MEUf3sQRg0t4=;\n b=SkD4wUbqjD2+w2ph7H/TugW6XBfpBeJgg6VZvLUxe3kkIgNwY0WhZpY2rBREBhiZ73\n Rh2ojTh90lwPBW4XJ9K3/wJW0Uf3X5UZ+Pxu2cLXib0n5Q/clWqFqFIo9iUCDi2F+WEn\n nbeiTUZyWCyK0I7ueMNpf4fRK3gjmmchjVBkLmF2lUS5TGYtzntKhmgLP5YGWTaEfVfI\n lmv64pJhXoom8s0ul8w4gNCjCZfa6LvIYlUwQdiiW7cvWVRwmyM8/qyNl0b5AIhbCOI6\n Sxmz28f5PJzcWrbHpcn4s6dcjckX+kGv3ROj9FmrZIuUynTjyL27iLSdTL78hSEjqsmc\n fxqA==",
        "X-Gm-Message-State": "ACrzQf0ScwpiKgArIYtU1H4mK5nBJtqNK/CoZTpU6+lUE/WuSqVtK3wz\n czQCo7dCwunofKmxtM0ZS8J9Xg==",
        "X-Google-Smtp-Source": "\n AMsMyM6T2FEC4oLIn3mT+gyLMYMTuOB6IeF6oeB6PKoxAyNznvRDuUHoHODH6z1gHuT3KLKNO6Rt6Q==",
        "X-Received": "by 2002:a05:600c:4e8f:b0:3c9:9657:9c0a with SMTP id\n f15-20020a05600c4e8f00b003c996579c0amr8531335wmq.157.1666619453054;\n Mon, 24 Oct 2022 06:50:53 -0700 (PDT)",
        "From": "Zhangfei Gao <zhangfei.gao@linaro.org>",
        "To": "Akhil Goyal <gakhil@marvell.com>,\n Declan Doherty <declan.doherty@intel.com>,\n Fan Zhang <royzhang1980@gmail.com>,\n Ashish Gupta <ashish.gupta@marvell.com>, Ray Kinsella <mdr@ashroe.eu>,\n \"thomas@monjalon.net\" <thomas@monjalon.net>",
        "Cc": "dev@dpdk.org,\n\tacc@openeuler.org,\n\tZhangfei Gao <zhangfei.gao@linaro.org>",
        "Subject": "[PATCH resend v5 5/6] crypto/uadk: support auth algorithms",
        "Date": "Mon, 24 Oct 2022 21:44:08 +0800",
        "Message-Id": "<20221024134409.1896776-6-zhangfei.gao@linaro.org>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20221024134409.1896776-1-zhangfei.gao@linaro.org>",
        "References": "<20221024134409.1896776-1-zhangfei.gao@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "Hash algorithms:\n\n* ``RTE_CRYPTO_AUTH_MD5``\n* ``RTE_CRYPTO_AUTH_MD5_HMAC``\n* ``RTE_CRYPTO_AUTH_SHA1``\n* ``RTE_CRYPTO_AUTH_SHA1_HMAC``\n* ``RTE_CRYPTO_AUTH_SHA224``\n* ``RTE_CRYPTO_AUTH_SHA224_HMAC``\n* ``RTE_CRYPTO_AUTH_SHA256``\n* ``RTE_CRYPTO_AUTH_SHA256_HMAC``\n* ``RTE_CRYPTO_AUTH_SHA384``\n* ``RTE_CRYPTO_AUTH_SHA384_HMAC``\n* ``RTE_CRYPTO_AUTH_SHA512``\n* ``RTE_CRYPTO_AUTH_SHA512_HMAC``\n\nSigned-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>\n---\n doc/guides/cryptodevs/features/uadk.ini |  12 +\n doc/guides/cryptodevs/uadk.rst          |  15 +\n drivers/crypto/uadk/uadk_crypto_pmd.c   | 459 ++++++++++++++++++++++++\n 3 files changed, 486 insertions(+)",
    "diff": "diff --git a/doc/guides/cryptodevs/features/uadk.ini b/doc/guides/cryptodevs/features/uadk.ini\nindex 005e08ac8d..2e8a37a2b3 100644\n--- a/doc/guides/cryptodevs/features/uadk.ini\n+++ b/doc/guides/cryptodevs/features/uadk.ini\n@@ -25,6 +25,18 @@ DES CBC        = Y\n ; Supported authentication algorithms of the 'uadk' crypto driver.\n ;\n [Auth]\n+MD5          = Y\n+MD5 HMAC     = Y\n+SHA1         = Y\n+SHA1 HMAC    = Y\n+SHA224       = Y\n+SHA224 HMAC  = Y\n+SHA256       = Y\n+SHA256 HMAC  = Y\n+SHA384       = Y\n+SHA384 HMAC  = Y\n+SHA512       = Y\n+SHA512 HMAC  = Y\n \n ;\n ; Supported AEAD algorithms of the 'uadk' crypto driver.\ndiff --git a/doc/guides/cryptodevs/uadk.rst b/doc/guides/cryptodevs/uadk.rst\nindex 7b5c1af144..cae23c6b91 100644\n--- a/doc/guides/cryptodevs/uadk.rst\n+++ b/doc/guides/cryptodevs/uadk.rst\n@@ -22,6 +22,21 @@ Cipher algorithms:\n * ``RTE_CRYPTO_CIPHER_AES_XTS``\n * ``RTE_CRYPTO_CIPHER_DES_CBC``\n \n+Hash algorithms:\n+\n+* ``RTE_CRYPTO_AUTH_MD5``\n+* ``RTE_CRYPTO_AUTH_MD5_HMAC``\n+* ``RTE_CRYPTO_AUTH_SHA1``\n+* ``RTE_CRYPTO_AUTH_SHA1_HMAC``\n+* ``RTE_CRYPTO_AUTH_SHA224``\n+* ``RTE_CRYPTO_AUTH_SHA224_HMAC``\n+* ``RTE_CRYPTO_AUTH_SHA256``\n+* ``RTE_CRYPTO_AUTH_SHA256_HMAC``\n+* ``RTE_CRYPTO_AUTH_SHA384``\n+* ``RTE_CRYPTO_AUTH_SHA384_HMAC``\n+* ``RTE_CRYPTO_AUTH_SHA512``\n+* ``RTE_CRYPTO_AUTH_SHA512_HMAC``\n+\n Test steps\n ----------\n \ndiff --git a/drivers/crypto/uadk/uadk_crypto_pmd.c b/drivers/crypto/uadk/uadk_crypto_pmd.c\nindex f9699e6b7e..58ae5ca32a 100644\n--- a/drivers/crypto/uadk/uadk_crypto_pmd.c\n+++ b/drivers/crypto/uadk/uadk_crypto_pmd.c\n@@ -32,11 +32,15 @@ struct uadk_qp {\n \n enum uadk_chain_order {\n \tUADK_CHAIN_ONLY_CIPHER,\n+\tUADK_CHAIN_ONLY_AUTH,\n+\tUADK_CHAIN_CIPHER_AUTH,\n+\tUADK_CHAIN_AUTH_CIPHER,\n \tUADK_CHAIN_NOT_SUPPORTED\n };\n \n struct uadk_crypto_session {\n \thandle_t handle_cipher;\n+\thandle_t handle_digest;\n \tenum uadk_chain_order chain_order;\n \n \t/* IV parameters */\n@@ -50,6 +54,13 @@ struct uadk_crypto_session {\n \t\tenum rte_crypto_cipher_operation direction;\n \t\tstruct wd_cipher_req req;\n \t} cipher;\n+\n+\t/* Authentication Parameters */\n+\tstruct {\n+\t\tstruct wd_digest_req req;\n+\t\tenum rte_crypto_auth_operation operation;\n+\t\tuint16_t digest_length;\n+\t} auth;\n } __rte_cache_aligned;\n \n enum uadk_crypto_version {\n@@ -59,6 +70,7 @@ enum uadk_crypto_version {\n \n struct uadk_crypto_priv {\n \tbool env_cipher_init;\n+\tbool env_auth_init;\n \tenum uadk_crypto_version version;\n } __rte_cache_aligned;\n \n@@ -72,6 +84,252 @@ RTE_LOG_REGISTER_DEFAULT(uadk_crypto_logtype, INFO);\n \t\t## __VA_ARGS__)\n \n static const struct rte_cryptodev_capabilities uadk_crypto_v2_capabilities[] = {\n+\t{\t/* MD5 HMAC */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,\n+\t\t\t{.auth = {\n+\t\t\t\t.algo = RTE_CRYPTO_AUTH_MD5_HMAC,\n+\t\t\t\t.block_size = 64,\n+\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 0,\n+\t\t\t\t\t.max = 0,\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.max = 16,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t},\n+\t\t\t\t.iv_size = { 0 }\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n+\t{\t/* MD5 */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,\n+\t\t\t{.auth = {\n+\t\t\t\t.algo = RTE_CRYPTO_AUTH_MD5,\n+\t\t\t\t.block_size = 64,\n+\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 0,\n+\t\t\t\t\t.max = 0,\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.max = 16,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t},\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n+\t{\t/* SHA1 HMAC */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,\n+\t\t\t{.auth = {\n+\t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,\n+\t\t\t\t.block_size = 64,\n+\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 0,\n+\t\t\t\t\t.max = 0,\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.max = 20,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t},\n+\t\t\t\t.iv_size = { 0 }\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n+\t{\t/* SHA1 */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,\n+\t\t\t{.auth = {\n+\t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA1,\n+\t\t\t\t.block_size = 64,\n+\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 0,\n+\t\t\t\t\t.max = 0,\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.max = 20,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t},\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n+\t{\t/* SHA224 HMAC */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,\n+\t\t\t{.auth = {\n+\t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,\n+\t\t\t\t.block_size = 64,\n+\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 0,\n+\t\t\t\t\t.max = 0,\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.max = 28,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t},\n+\t\t\t\t.iv_size = { 0 }\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n+\t{\t/* SHA224 */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,\n+\t\t\t{.auth = {\n+\t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA224,\n+\t\t\t\t.block_size = 64,\n+\t\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 0,\n+\t\t\t\t\t.max = 0,\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.max = 28,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t},\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n+\t{\t/* SHA256 HMAC */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,\n+\t\t\t{.auth = {\n+\t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,\n+\t\t\t\t.block_size = 64,\n+\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 0,\n+\t\t\t\t\t.max = 0,\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.max = 32,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t},\n+\t\t\t\t.iv_size = { 0 }\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n+\t{\t/* SHA256 */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,\n+\t\t\t{.auth = {\n+\t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA256,\n+\t\t\t\t.block_size = 64,\n+\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 0,\n+\t\t\t\t\t.max = 0,\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.max = 32,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t},\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n+\t{\t/* SHA384 HMAC */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,\n+\t\t\t{.auth = {\n+\t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,\n+\t\t\t\t.block_size = 128,\n+\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 0,\n+\t\t\t\t\t.max = 0,\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.max = 48,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t},\n+\t\t\t\t.iv_size = { 0 }\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n+\t{\t/* SHA384 */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,\n+\t\t\t{.auth = {\n+\t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA384,\n+\t\t\t\t.block_size = 64,\n+\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 0,\n+\t\t\t\t\t.max = 0,\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.max = 48,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t\t},\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n+\t{\t/* SHA512 HMAC */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,\n+\t\t\t{.auth = {\n+\t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,\n+\t\t\t\t.block_size = 128,\n+\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 0,\n+\t\t\t\t\t.max = 0,\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.max = 64,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t},\n+\t\t\t\t.iv_size = { 0 }\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n+\t{\t/* SHA512 */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,\n+\t\t\t{.auth = {\n+\t\t\t\t.algo = RTE_CRYPTO_AUTH_SHA512,\n+\t\t\t\t.block_size = 128,\n+\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 0,\n+\t\t\t\t\t.max = 0,\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.max = 64,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t},\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n \t{\t/* AES ECB */\n \t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n \t\t{.sym = {\n@@ -188,6 +446,11 @@ uadk_crypto_pmd_close(struct rte_cryptodev *dev)\n \t\tpriv->env_cipher_init = false;\n \t}\n \n+\tif (priv->env_auth_init) {\n+\t\twd_digest_env_uninit();\n+\t\tpriv->env_auth_init = false;\n+\t}\n+\n \treturn 0;\n }\n \n@@ -346,9 +609,19 @@ uadk_get_chain_order(const struct rte_crypto_sym_xform *xform)\n \tenum uadk_chain_order res = UADK_CHAIN_NOT_SUPPORTED;\n \n \tif (xform != NULL) {\n+\t\tif (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH) {\n+\t\t\tif (xform->next == NULL)\n+\t\t\t\tres = UADK_CHAIN_ONLY_AUTH;\n+\t\t\telse if (xform->next->type ==\n+\t\t\t\t\tRTE_CRYPTO_SYM_XFORM_CIPHER)\n+\t\t\t\tres = UADK_CHAIN_AUTH_CIPHER;\n+\t\t}\n+\n \t\tif (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) {\n \t\t\tif (xform->next == NULL)\n \t\t\t\tres = UADK_CHAIN_ONLY_CIPHER;\n+\t\t\telse if (xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH)\n+\t\t\t\tres = UADK_CHAIN_CIPHER_AUTH;\n \t\t}\n \t}\n \n@@ -435,12 +708,119 @@ uadk_set_session_cipher_parameters(struct rte_cryptodev *dev,\n \treturn ret;\n }\n \n+/* Set session auth parameters */\n+static int\n+uadk_set_session_auth_parameters(struct rte_cryptodev *dev,\n+\t\t\t\t struct uadk_crypto_session *sess,\n+\t\t\t\t struct rte_crypto_sym_xform *xform)\n+{\n+\tstruct uadk_crypto_priv *priv = dev->data->dev_private;\n+\tstruct wd_digest_sess_setup setup = {0};\n+\tstruct sched_params params = {0};\n+\tint ret;\n+\n+\tif (!priv->env_auth_init) {\n+\t\tret = wd_digest_env_init(NULL);\n+\t\tif (ret < 0)\n+\t\t\treturn -EINVAL;\n+\t\tpriv->env_auth_init = true;\n+\t}\n+\n+\tsess->auth.operation = xform->auth.op;\n+\tsess->auth.digest_length = xform->auth.digest_length;\n+\n+\tswitch (xform->auth.algo) {\n+\tcase RTE_CRYPTO_AUTH_MD5:\n+\tcase RTE_CRYPTO_AUTH_MD5_HMAC:\n+\t\tsetup.mode = (xform->auth.algo == RTE_CRYPTO_AUTH_MD5) ?\n+\t\t\t     WD_DIGEST_NORMAL : WD_DIGEST_HMAC;\n+\t\tsetup.alg = WD_DIGEST_MD5;\n+\t\tsess->auth.req.out_buf_bytes = 16;\n+\t\tsess->auth.req.out_bytes = 16;\n+\t\tbreak;\n+\tcase RTE_CRYPTO_AUTH_SHA1:\n+\tcase RTE_CRYPTO_AUTH_SHA1_HMAC:\n+\t\tsetup.mode = (xform->auth.algo == RTE_CRYPTO_AUTH_SHA1) ?\n+\t\t\t     WD_DIGEST_NORMAL : WD_DIGEST_HMAC;\n+\t\tsetup.alg = WD_DIGEST_SHA1;\n+\t\tsess->auth.req.out_buf_bytes = 20;\n+\t\tsess->auth.req.out_bytes = 20;\n+\t\tbreak;\n+\tcase RTE_CRYPTO_AUTH_SHA224:\n+\tcase RTE_CRYPTO_AUTH_SHA224_HMAC:\n+\t\tsetup.mode = (xform->auth.algo == RTE_CRYPTO_AUTH_SHA224) ?\n+\t\t\t     WD_DIGEST_NORMAL : WD_DIGEST_HMAC;\n+\t\tsetup.alg = WD_DIGEST_SHA224;\n+\t\tsess->auth.req.out_buf_bytes = 28;\n+\t\tsess->auth.req.out_bytes = 28;\n+\t\tbreak;\n+\tcase RTE_CRYPTO_AUTH_SHA256:\n+\tcase RTE_CRYPTO_AUTH_SHA256_HMAC:\n+\t\tsetup.mode = (xform->auth.algo == RTE_CRYPTO_AUTH_SHA256) ?\n+\t\t\t     WD_DIGEST_NORMAL : WD_DIGEST_HMAC;\n+\t\tsetup.alg = WD_DIGEST_SHA256;\n+\t\tsess->auth.req.out_buf_bytes = 32;\n+\t\tsess->auth.req.out_bytes = 32;\n+\t\tbreak;\n+\tcase RTE_CRYPTO_AUTH_SHA384:\n+\tcase RTE_CRYPTO_AUTH_SHA384_HMAC:\n+\t\tsetup.mode = (xform->auth.algo == RTE_CRYPTO_AUTH_SHA384) ?\n+\t\t\t     WD_DIGEST_NORMAL : WD_DIGEST_HMAC;\n+\t\tsetup.alg = WD_DIGEST_SHA384;\n+\t\tsess->auth.req.out_buf_bytes = 48;\n+\t\tsess->auth.req.out_bytes = 48;\n+\t\tbreak;\n+\tcase RTE_CRYPTO_AUTH_SHA512:\n+\tcase RTE_CRYPTO_AUTH_SHA512_HMAC:\n+\t\tsetup.mode = (xform->auth.algo == RTE_CRYPTO_AUTH_SHA512) ?\n+\t\t\t     WD_DIGEST_NORMAL : WD_DIGEST_HMAC;\n+\t\tsetup.alg = WD_DIGEST_SHA512;\n+\t\tsess->auth.req.out_buf_bytes = 64;\n+\t\tsess->auth.req.out_bytes = 64;\n+\t\tbreak;\n+\tdefault:\n+\t\tret = -ENOTSUP;\n+\t\tgoto env_uninit;\n+\t}\n+\n+\tparams.numa_id = -1;\t/* choose nearby numa node */\n+\tsetup.sched_param = &params;\n+\tsess->handle_digest = wd_digest_alloc_sess(&setup);\n+\tif (!sess->handle_digest) {\n+\t\tUADK_LOG(ERR, \"uadk failed to alloc session!\\n\");\n+\t\tret = -EINVAL;\n+\t\tgoto env_uninit;\n+\t}\n+\n+\t/* if mode is HMAC, should set key */\n+\tif (setup.mode == WD_DIGEST_HMAC) {\n+\t\tret = wd_digest_set_key(sess->handle_digest,\n+\t\t\t\t\txform->auth.key.data,\n+\t\t\t\t\txform->auth.key.length);\n+\t\tif (ret) {\n+\t\t\tUADK_LOG(ERR, \"uadk failed to alloc session!\\n\");\n+\t\t\twd_digest_free_sess(sess->handle_digest);\n+\t\t\tsess->handle_digest = 0;\n+\t\t\tret = -EINVAL;\n+\t\t\tgoto env_uninit;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+\n+env_uninit:\n+\twd_digest_env_uninit();\n+\tpriv->env_auth_init = false;\n+\treturn ret;\n+}\n+\n static int\n uadk_crypto_sym_session_configure(struct rte_cryptodev *dev,\n \t\t\t\t  struct rte_crypto_sym_xform *xform,\n \t\t\t\t  struct rte_cryptodev_sym_session *session)\n {\n \tstruct rte_crypto_sym_xform *cipher_xform = NULL;\n+\tstruct rte_crypto_sym_xform *auth_xform = NULL;\n \tstruct uadk_crypto_session *sess = CRYPTODEV_GET_SYM_SESS_PRIV(session);\n \tint ret;\n \n@@ -454,6 +834,17 @@ uadk_crypto_sym_session_configure(struct rte_cryptodev *dev,\n \tcase UADK_CHAIN_ONLY_CIPHER:\n \t\tcipher_xform = xform;\n \t\tbreak;\n+\tcase UADK_CHAIN_ONLY_AUTH:\n+\t\tauth_xform = xform;\n+\t\tbreak;\n+\tcase UADK_CHAIN_CIPHER_AUTH:\n+\t\tcipher_xform = xform;\n+\t\tauth_xform = xform->next;\n+\t\tbreak;\n+\tcase UADK_CHAIN_AUTH_CIPHER:\n+\t\tauth_xform = xform;\n+\t\tcipher_xform = xform->next;\n+\t\tbreak;\n \tdefault:\n \t\treturn -ENOTSUP;\n \t}\n@@ -467,6 +858,15 @@ uadk_crypto_sym_session_configure(struct rte_cryptodev *dev,\n \t\t}\n \t}\n \n+\tif (auth_xform) {\n+\t\tret = uadk_set_session_auth_parameters(dev, sess, auth_xform);\n+\t\tif (ret != 0) {\n+\t\t\tUADK_LOG(ERR,\n+\t\t\t\t\"Invalid/unsupported auth parameters\");\n+\t\t\treturn ret;\n+\t\t}\n+\t}\n+\n \treturn 0;\n }\n \n@@ -485,6 +885,11 @@ uadk_crypto_sym_session_clear(struct rte_cryptodev *dev __rte_unused,\n \t\twd_cipher_free_sess(sess->handle_cipher);\n \t\tsess->handle_cipher = 0;\n \t}\n+\n+\tif (sess->handle_digest) {\n+\t\twd_digest_free_sess(sess->handle_digest);\n+\t\tsess->handle_digest = 0;\n+\t}\n }\n \n static struct rte_cryptodev_ops uadk_crypto_pmd_ops = {\n@@ -535,6 +940,49 @@ uadk_process_cipher_op(struct rte_crypto_op *op,\n \t\top->status = RTE_CRYPTO_OP_STATUS_ERROR;\n }\n \n+static void\n+uadk_process_auth_op(struct uadk_qp *qp, struct rte_crypto_op *op,\n+\t\t     struct uadk_crypto_session *sess,\n+\t\t     struct rte_mbuf *msrc, struct rte_mbuf *mdst)\n+{\n+\tuint32_t srclen = op->sym->auth.data.length;\n+\tuint32_t off = op->sym->auth.data.offset;\n+\tuint8_t *dst = qp->temp_digest;\n+\tint ret;\n+\n+\tif (!sess) {\n+\t\top->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;\n+\t\treturn;\n+\t}\n+\n+\tsess->auth.req.in = rte_pktmbuf_mtod_offset(msrc, uint8_t *, off);\n+\tsess->auth.req.in_bytes = srclen;\n+\tsess->auth.req.out = dst;\n+\n+\tdo {\n+\t\tret = wd_do_digest_sync(sess->handle_digest, &sess->auth.req);\n+\t} while (ret == -WD_EBUSY);\n+\n+\tif (sess->auth.operation == RTE_CRYPTO_AUTH_OP_VERIFY) {\n+\t\tif (memcmp(dst, op->sym->auth.digest.data,\n+\t\t\t\tsess->auth.digest_length) != 0) {\n+\t\t\top->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;\n+\t\t}\n+\t} else {\n+\t\tuint8_t *auth_dst;\n+\n+\t\tauth_dst = op->sym->auth.digest.data;\n+\t\tif (auth_dst == NULL)\n+\t\t\tauth_dst = rte_pktmbuf_mtod_offset(mdst, uint8_t *,\n+\t\t\t\t\top->sym->auth.data.offset +\n+\t\t\t\t\top->sym->auth.data.length);\n+\t\tmemcpy(auth_dst, dst, sess->auth.digest_length);\n+\t}\n+\n+\tif (ret)\n+\t\top->status = RTE_CRYPTO_OP_STATUS_ERROR;\n+}\n+\n static uint16_t\n uadk_crypto_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,\n \t\t\t  uint16_t nb_ops)\n@@ -562,6 +1010,17 @@ uadk_crypto_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,\n \t\tcase UADK_CHAIN_ONLY_CIPHER:\n \t\t\tuadk_process_cipher_op(op, sess, msrc, mdst);\n \t\t\tbreak;\n+\t\tcase UADK_CHAIN_ONLY_AUTH:\n+\t\t\tuadk_process_auth_op(qp, op, sess, msrc, mdst);\n+\t\t\tbreak;\n+\t\tcase UADK_CHAIN_CIPHER_AUTH:\n+\t\t\tuadk_process_cipher_op(op, sess, msrc, mdst);\n+\t\t\tuadk_process_auth_op(qp, op, sess, mdst, mdst);\n+\t\t\tbreak;\n+\t\tcase UADK_CHAIN_AUTH_CIPHER:\n+\t\t\tuadk_process_auth_op(qp, op, sess, msrc, mdst);\n+\t\t\tuadk_process_cipher_op(op, sess, msrc, mdst);\n+\t\t\tbreak;\n \t\tdefault:\n \t\t\top->status = RTE_CRYPTO_OP_STATUS_ERROR;\n \t\t\tbreak;\n",
    "prefixes": [
        "resend",
        "v5",
        "5/6"
    ]
}