get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 127339,
    "url": "http://patches.dpdk.org/api/patches/127339/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230524160116.304-9-anoobj@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": "<20230524160116.304-9-anoobj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230524160116.304-9-anoobj@marvell.com",
    "date": "2023-05-24T16:01:02",
    "name": "[v3,08/22] pdcp: add IV generation routines",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4154a5f0f84701f5aa1e7c40efe1dc1296335ba8",
    "submitter": {
        "id": 1205,
        "url": "http://patches.dpdk.org/api/people/1205/?format=api",
        "name": "Anoob Joseph",
        "email": "anoobj@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/20230524160116.304-9-anoobj@marvell.com/mbox/",
    "series": [
        {
            "id": 28158,
            "url": "http://patches.dpdk.org/api/series/28158/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28158",
            "date": "2023-05-24T16:00:54",
            "name": "lib: add pdcp protocol",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/28158/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/127339/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/127339/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 13A9542B8F;\n\tWed, 24 May 2023 18:02:48 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id CAEAE40156;\n\tWed, 24 May 2023 18:02:05 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 5130842D65\n for <dev@dpdk.org>; Wed, 24 May 2023 18:02:04 +0200 (CEST)",
            "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 34OCL6UY022411; Wed, 24 May 2023 09:02:03 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3qsh90h13y-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 24 May 2023 09:02:02 -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.48;\n Wed, 24 May 2023 09:02:00 -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.48 via Frontend\n Transport; Wed, 24 May 2023 09:02:00 -0700",
            "from BG-LT92004.corp.innovium.com (unknown [10.28.161.183])\n by maili.marvell.com (Postfix) with ESMTP id 50E823F7043;\n Wed, 24 May 2023 09:01:56 -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=qet/UzkBbEy+RzyqVzDmKDfQE+xRb0Iyk7VjSAzbFSs=;\n b=YXq0Fwi7CrHRA5vu2PbI61/pSOzk/pIbHdVxlJ/kOFJItOoC+elKmmrZ0hj+IF6V6JYI\n bYr66/gAVd/iXrjl5qvvbCGHj8iHL+tKzyuAhxqFtTGGtztamZekhu4sCgPhDM7ZOz8s\n 4FwAwrrCbrZXR9B42c4Y8/axNPQ4nt3W0eKNTqrjCts51xeV438JtbDo4kY1G4ympmhl\n fCSgEyWov8csRqSF4RT/ZfzIniBFLNCGcpGofY2/IAa2DIolYu2b1m3jrg3oWYlg4Q9m\n GGzxy7ZR8e6k9JK2SZEoRovtOZhIejdVdMSkIzppLfPhVNsl38lkUGWvH19yJDKkbnDf pQ==",
        "From": "Anoob Joseph <anoobj@marvell.com>",
        "To": "Thomas Monjalon <thomas@monjalon.net>, Akhil Goyal <gakhil@marvell.com>,\n Jerin Jacob <jerinj@marvell.com>, Konstantin Ananyev\n <konstantin.v.ananyev@yandex.ru>, Bernard Iremonger\n <bernard.iremonger@intel.com>",
        "CC": "Hemant Agrawal <hemant.agrawal@nxp.com>,\n =?utf-8?q?Mattias_R=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>,\n \"Kiran Kumar K\" <kirankumark@marvell.com>,\n Volodymyr Fialko <vfialko@marvell.com>, <dev@dpdk.org>,\n Olivier Matz <olivier.matz@6wind.com>",
        "Subject": "[PATCH v3 08/22] pdcp: add IV generation routines",
        "Date": "Wed, 24 May 2023 21:31:02 +0530",
        "Message-ID": "<20230524160116.304-9-anoobj@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230524160116.304-1-anoobj@marvell.com>",
        "References": "<20230414174512.642-1-anoobj@marvell.com>\n <20230524160116.304-1-anoobj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "hjXgCBSjH0_qrco2_v7QCL7KQbBJLQLT",
        "X-Proofpoint-ORIG-GUID": "hjXgCBSjH0_qrco2_v7QCL7KQbBJLQLT",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26\n definitions=2023-05-24_11,2023-05-24_01,2023-05-22_02",
        "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": "For PDCP, IV generated has varying formats depending on the ciphering and\nauthentication algorithm used. Add routines to populate IV accordingly.\n\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\nSigned-off-by: Volodymyr Fialko <vfialko@marvell.com>\n---\n lib/pdcp/pdcp_entity.h  |  87 ++++++++++++\n lib/pdcp/pdcp_process.c | 284 ++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 371 insertions(+)",
    "diff": "diff --git a/lib/pdcp/pdcp_entity.h b/lib/pdcp/pdcp_entity.h\nindex 1d4a43a3bc..10a72faae1 100644\n--- a/lib/pdcp/pdcp_entity.h\n+++ b/lib/pdcp/pdcp_entity.h\n@@ -26,6 +26,89 @@ struct entity_state {\n \tuint32_t rx_reord;\n };\n \n+union auth_iv_partial {\n+\t/* For AES-CMAC, there is no IV, but message gets prepended */\n+\tstruct {\n+#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN\n+\t\tuint64_t count : 32;\n+\t\tuint64_t zero_38_39 : 2;\n+\t\tuint64_t direction : 1;\n+\t\tuint64_t bearer : 5;\n+\t\tuint64_t zero_40_63 : 24;\n+#else\n+\t\tuint64_t count : 32;\n+\t\tuint64_t bearer : 5;\n+\t\tuint64_t direction : 1;\n+\t\tuint64_t zero_38_39 : 2;\n+\t\tuint64_t zero_40_63 : 24;\n+#endif\n+\t} aes_cmac;\n+\tstruct {\n+#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN\n+\t\tuint64_t count : 32;\n+\t\tuint64_t zero_37_39 : 3;\n+\t\tuint64_t bearer : 5;\n+\t\tuint64_t zero_40_63 : 24;\n+\n+\t\tuint64_t rsvd_65_71 : 7;\n+\t\tuint64_t direction_64 : 1;\n+\t\tuint64_t rsvd_72_111 : 40;\n+\t\tuint64_t rsvd_113_119 : 7;\n+\t\tuint64_t direction_112 : 1;\n+\t\tuint64_t rsvd_120_127 : 8;\n+#else\n+\t\tuint64_t count : 32;\n+\t\tuint64_t bearer : 5;\n+\t\tuint64_t zero_37_39 : 3;\n+\t\tuint64_t zero_40_63 : 24;\n+\n+\t\tuint64_t direction_64 : 1;\n+\t\tuint64_t rsvd_65_71 : 7;\n+\t\tuint64_t rsvd_72_111 : 40;\n+\t\tuint64_t direction_112 : 1;\n+\t\tuint64_t rsvd_113_119 : 7;\n+\t\tuint64_t rsvd_120_127 : 8;\n+#endif\n+\t} zs;\n+\tuint64_t u64[2];\n+};\n+\n+union cipher_iv_partial {\n+\tstruct {\n+#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN\n+\t\tuint64_t count : 32;\n+\t\tuint64_t zero_38_39 : 2;\n+\t\tuint64_t direction : 1;\n+\t\tuint64_t bearer : 5;\n+\t\tuint64_t zero_40_63 : 24;\n+#else\n+\t\tuint64_t count : 32;\n+\t\tuint64_t bearer : 5;\n+\t\tuint64_t direction : 1;\n+\t\tuint64_t zero_38_39 : 2;\n+\t\tuint64_t zero_40_63 : 24;\n+#endif\n+\t\tuint64_t zero_64_127;\n+\t} aes_ctr;\n+\tstruct {\n+#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN\n+\t\tuint64_t count : 32;\n+\t\tuint64_t zero_38_39 : 2;\n+\t\tuint64_t direction : 1;\n+\t\tuint64_t bearer : 5;\n+\t\tuint64_t zero_40_63 : 24;\n+#else\n+\t\tuint64_t count : 32;\n+\t\tuint64_t bearer : 5;\n+\t\tuint64_t direction : 1;\n+\t\tuint64_t zero_38_39 : 2;\n+\t\tuint64_t zero_40_63 : 24;\n+#endif\n+\t\tuint64_t rsvd_64_127;\n+\t} zs;\n+\tuint64_t u64[2];\n+};\n+\n /*\n  * Layout of PDCP entity: [rte_pdcp_entity] [entity_priv] [entity_dl/ul]\n  */\n@@ -35,6 +118,10 @@ struct entity_priv {\n \tstruct rte_cryptodev_sym_session *crypto_sess;\n \t/** Entity specific IV generation function. */\n \tiv_gen_t iv_gen;\n+\t/** Pre-prepared auth IV. */\n+\tunion auth_iv_partial auth_iv_part;\n+\t/** Pre-prepared cipher IV. */\n+\tunion cipher_iv_partial cipher_iv_part;\n \t/** Entity state variables. */\n \tstruct entity_state state;\n \t/** Flags. */\ndiff --git a/lib/pdcp/pdcp_process.c b/lib/pdcp/pdcp_process.c\nindex 3af0df75ef..e8112adfb8 100644\n--- a/lib/pdcp/pdcp_process.c\n+++ b/lib/pdcp/pdcp_process.c\n@@ -13,6 +13,181 @@\n #include \"pdcp_entity.h\"\n #include \"pdcp_process.h\"\n \n+/* Enum of supported algorithms for ciphering */\n+enum pdcp_cipher_algo {\n+\tPDCP_CIPHER_ALGO_NULL,\n+\tPDCP_CIPHER_ALGO_AES,\n+\tPDCP_CIPHER_ALGO_ZUC,\n+\tPDCP_CIPHER_ALGO_SNOW3G,\n+\tPDCP_CIPHER_ALGO_MAX\n+};\n+\n+/* Enum of supported algorithms for integrity */\n+enum pdcp_auth_algo {\n+\tPDCP_AUTH_ALGO_NULL,\n+\tPDCP_AUTH_ALGO_AES,\n+\tPDCP_AUTH_ALGO_ZUC,\n+\tPDCP_AUTH_ALGO_SNOW3G,\n+\tPDCP_AUTH_ALGO_MAX\n+};\n+\n+/* IV generation functions based on type of operation (cipher - auth) */\n+\n+static void\n+pdcp_iv_gen_null_null(struct rte_crypto_op *cop, const struct entity_priv *en_priv, uint32_t count)\n+{\n+\t/* No IV required for NULL cipher + NULL auth */\n+\tRTE_SET_USED(cop);\n+\tRTE_SET_USED(en_priv);\n+\tRTE_SET_USED(count);\n+}\n+\n+static void\n+pdcp_iv_gen_null_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv *en_priv,\n+\t\t\t  uint32_t count)\n+{\n+\tstruct rte_crypto_sym_op *op = cop->sym;\n+\tstruct rte_mbuf *mb = op->m_src;\n+\tuint8_t *m_ptr;\n+\tuint64_t m;\n+\n+\t/* AES-CMAC requires message to be prepended with info on count etc */\n+\n+\t/* Prepend by 8 bytes to add custom message */\n+\tm_ptr = (uint8_t *)rte_pktmbuf_prepend(mb, 8);\n+\n+\tm = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));\n+\n+\trte_memcpy(m_ptr, &m, 8);\n+}\n+\n+static void\n+pdcp_iv_gen_null_zs(struct rte_crypto_op *cop, const struct entity_priv *en_priv, uint32_t count)\n+{\n+\tuint64_t iv_u64[2];\n+\tuint8_t *iv;\n+\n+\tiv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);\n+\n+\tiv_u64[0] = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));\n+\trte_memcpy(iv, &iv_u64[0], 8);\n+\n+\tiv_u64[1] = iv_u64[0] ^ en_priv->auth_iv_part.u64[1];\n+\trte_memcpy(iv + 8, &iv_u64[1], 8);\n+}\n+\n+static void\n+pdcp_iv_gen_aes_ctr_null(struct rte_crypto_op *cop, const struct entity_priv *en_priv,\n+\t\t\t uint32_t count)\n+{\n+\tuint64_t iv_u64[2];\n+\tuint8_t *iv;\n+\n+\tiv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);\n+\n+\tiv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));\n+\tiv_u64[1] = 0;\n+\trte_memcpy(iv, iv_u64, 16);\n+}\n+\n+static void\n+pdcp_iv_gen_zs_null(struct rte_crypto_op *cop, const struct entity_priv *en_priv, uint32_t count)\n+{\n+\tuint64_t iv_u64;\n+\tuint8_t *iv;\n+\n+\tiv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);\n+\n+\tiv_u64 = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));\n+\trte_memcpy(iv, &iv_u64, 8);\n+\trte_memcpy(iv + 8, &iv_u64, 8);\n+}\n+\n+static void\n+pdcp_iv_gen_zs_zs(struct rte_crypto_op *cop, const struct entity_priv *en_priv, uint32_t count)\n+{\n+\tuint64_t iv_u64[2];\n+\tuint8_t *iv;\n+\n+\tiv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);\n+\n+\t/* Generating cipher IV */\n+\tiv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));\n+\trte_memcpy(iv, &iv_u64[0], 8);\n+\trte_memcpy(iv + 8, &iv_u64[0], 8);\n+\n+\tiv += PDCP_IV_LEN;\n+\n+\t/* Generating auth IV */\n+\tiv_u64[0] = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));\n+\trte_memcpy(iv, &iv_u64[0], 8);\n+\n+\tiv_u64[1] = iv_u64[0] ^ en_priv->auth_iv_part.u64[1];\n+\trte_memcpy(iv + 8, &iv_u64[1], 8);\n+}\n+\n+static void\n+pdcp_iv_gen_zs_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv *en_priv,\n+\t\t\tuint32_t count)\n+{\n+\tstruct rte_crypto_sym_op *op = cop->sym;\n+\tstruct rte_mbuf *mb = op->m_src;\n+\tuint8_t *m_ptr, *iv;\n+\tuint64_t iv_u64[2];\n+\tuint64_t m;\n+\n+\tiv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);\n+\tiv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));\n+\trte_memcpy(iv, &iv_u64[0], 8);\n+\trte_memcpy(iv + 8, &iv_u64[0], 8);\n+\n+\tm_ptr = (uint8_t *)rte_pktmbuf_prepend(mb, 8);\n+\tm = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));\n+\trte_memcpy(m_ptr, &m, 8);\n+}\n+\n+static void\n+pdcp_iv_gen_aes_ctr_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv *en_priv,\n+\t\t\t    uint32_t count)\n+{\n+\tstruct rte_crypto_sym_op *op = cop->sym;\n+\tstruct rte_mbuf *mb = op->m_src;\n+\tuint8_t *m_ptr, *iv;\n+\tuint64_t iv_u64[2];\n+\tuint64_t m;\n+\n+\tiv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);\n+\n+\tiv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));\n+\tiv_u64[1] = 0;\n+\trte_memcpy(iv, iv_u64, PDCP_IV_LEN);\n+\n+\tm_ptr = (uint8_t *)rte_pktmbuf_prepend(mb, 8);\n+\tm = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));\n+\trte_memcpy(m_ptr, &m, 8);\n+}\n+\n+static void\n+pdcp_iv_gen_aes_ctr_zs(struct rte_crypto_op *cop, const struct entity_priv *en_priv, uint32_t count)\n+{\n+\tuint64_t iv_u64[2];\n+\tuint8_t *iv;\n+\n+\tiv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);\n+\n+\tiv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));\n+\tiv_u64[1] = 0;\n+\trte_memcpy(iv, iv_u64, PDCP_IV_LEN);\n+\n+\tiv += PDCP_IV_LEN;\n+\n+\tiv_u64[0] = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));\n+\trte_memcpy(iv, &iv_u64[0], 8);\n+\n+\tiv_u64[1] = iv_u64[0] ^ en_priv->auth_iv_part.u64[1];\n+\trte_memcpy(iv + 8, &iv_u64[1], 8);\n+}\n+\n static int\n pdcp_crypto_xfrm_get(const struct rte_pdcp_entity_conf *conf, struct rte_crypto_sym_xform **c_xfrm,\n \t\t     struct rte_crypto_sym_xform **a_xfrm)\n@@ -36,6 +211,111 @@ pdcp_crypto_xfrm_get(const struct rte_pdcp_entity_conf *conf, struct rte_crypto_\n \treturn 0;\n }\n \n+static int\n+pdcp_iv_gen_func_set(struct rte_pdcp_entity *entity, const struct rte_pdcp_entity_conf *conf)\n+{\n+\tstruct rte_crypto_sym_xform *c_xfrm, *a_xfrm;\n+\tenum rte_security_pdcp_direction direction;\n+\tenum pdcp_cipher_algo ciph_algo;\n+\tenum pdcp_auth_algo auth_algo;\n+\tstruct entity_priv *en_priv;\n+\tint ret;\n+\n+\ten_priv = entity_priv_get(entity);\n+\n+\tdirection = conf->pdcp_xfrm.pkt_dir;\n+\tif (conf->reverse_iv_direction)\n+\t\tdirection = !direction;\n+\n+\tret = pdcp_crypto_xfrm_get(conf, &c_xfrm, &a_xfrm);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tif (c_xfrm == NULL)\n+\t\treturn -EINVAL;\n+\n+\tmemset(&en_priv->auth_iv_part, 0, sizeof(en_priv->auth_iv_part));\n+\tmemset(&en_priv->cipher_iv_part, 0, sizeof(en_priv->cipher_iv_part));\n+\n+\tswitch (c_xfrm->cipher.algo) {\n+\tcase RTE_CRYPTO_CIPHER_NULL:\n+\t\tciph_algo = PDCP_CIPHER_ALGO_NULL;\n+\t\tbreak;\n+\tcase RTE_CRYPTO_CIPHER_AES_CTR:\n+\t\tciph_algo = PDCP_CIPHER_ALGO_AES;\n+\t\ten_priv->cipher_iv_part.aes_ctr.bearer = conf->pdcp_xfrm.bearer;\n+\t\ten_priv->cipher_iv_part.aes_ctr.direction = direction;\n+\t\tbreak;\n+\tcase RTE_CRYPTO_CIPHER_SNOW3G_UEA2:\n+\t\tciph_algo = PDCP_CIPHER_ALGO_SNOW3G;\n+\t\ten_priv->cipher_iv_part.zs.bearer = conf->pdcp_xfrm.bearer;\n+\t\ten_priv->cipher_iv_part.zs.direction = direction;\n+\t\tbreak;\n+\tcase RTE_CRYPTO_CIPHER_ZUC_EEA3:\n+\t\tciph_algo = PDCP_CIPHER_ALGO_ZUC;\n+\t\ten_priv->cipher_iv_part.zs.bearer = conf->pdcp_xfrm.bearer;\n+\t\ten_priv->cipher_iv_part.zs.direction = direction;\n+\t\tbreak;\n+\tdefault:\n+\t\treturn -ENOTSUP;\n+\t}\n+\n+\tif (a_xfrm != NULL) {\n+\t\tswitch (a_xfrm->auth.algo) {\n+\t\tcase RTE_CRYPTO_AUTH_NULL:\n+\t\t\tauth_algo = PDCP_AUTH_ALGO_NULL;\n+\t\t\tbreak;\n+\t\tcase RTE_CRYPTO_AUTH_AES_CMAC:\n+\t\t\tauth_algo = PDCP_AUTH_ALGO_AES;\n+\t\t\ten_priv->auth_iv_part.aes_cmac.bearer = conf->pdcp_xfrm.bearer;\n+\t\t\ten_priv->auth_iv_part.aes_cmac.direction = direction;\n+\t\t\tbreak;\n+\t\tcase RTE_CRYPTO_AUTH_SNOW3G_UIA2:\n+\t\t\tauth_algo = PDCP_AUTH_ALGO_SNOW3G;\n+\t\t\ten_priv->auth_iv_part.zs.bearer = conf->pdcp_xfrm.bearer;\n+\t\t\ten_priv->auth_iv_part.zs.direction_64 = direction;\n+\t\t\ten_priv->auth_iv_part.zs.direction_112 = direction;\n+\t\t\tbreak;\n+\t\tcase RTE_CRYPTO_AUTH_ZUC_EIA3:\n+\t\t\tauth_algo = PDCP_AUTH_ALGO_ZUC;\n+\t\t\ten_priv->auth_iv_part.zs.bearer = conf->pdcp_xfrm.bearer;\n+\t\t\ten_priv->auth_iv_part.zs.direction_64 = direction;\n+\t\t\ten_priv->auth_iv_part.zs.direction_112 = direction;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\treturn -ENOTSUP;\n+\t\t}\n+\t} else {\n+\t\tauth_algo = PDCP_AUTH_ALGO_NULL;\n+\t}\n+\n+\tstatic const iv_gen_t iv_gen_map[PDCP_CIPHER_ALGO_MAX][PDCP_AUTH_ALGO_MAX] = {\n+\t\t[PDCP_CIPHER_ALGO_NULL][PDCP_AUTH_ALGO_NULL] = pdcp_iv_gen_null_null,\n+\t\t[PDCP_CIPHER_ALGO_NULL][PDCP_AUTH_ALGO_AES] = pdcp_iv_gen_null_aes_cmac,\n+\t\t[PDCP_CIPHER_ALGO_NULL][PDCP_AUTH_ALGO_SNOW3G] = pdcp_iv_gen_null_zs,\n+\t\t[PDCP_CIPHER_ALGO_NULL][PDCP_AUTH_ALGO_ZUC] = pdcp_iv_gen_null_zs,\n+\n+\t\t[PDCP_CIPHER_ALGO_AES][PDCP_AUTH_ALGO_NULL] = pdcp_iv_gen_aes_ctr_null,\n+\t\t[PDCP_CIPHER_ALGO_AES][PDCP_AUTH_ALGO_AES] = pdcp_iv_gen_aes_ctr_aes_cmac,\n+\t\t[PDCP_CIPHER_ALGO_AES][PDCP_AUTH_ALGO_SNOW3G] = pdcp_iv_gen_aes_ctr_zs,\n+\t\t[PDCP_CIPHER_ALGO_AES][PDCP_AUTH_ALGO_ZUC] = pdcp_iv_gen_aes_ctr_zs,\n+\n+\t\t[PDCP_CIPHER_ALGO_SNOW3G][PDCP_AUTH_ALGO_NULL] = pdcp_iv_gen_zs_null,\n+\t\t[PDCP_CIPHER_ALGO_SNOW3G][PDCP_AUTH_ALGO_AES] = pdcp_iv_gen_zs_aes_cmac,\n+\t\t[PDCP_CIPHER_ALGO_SNOW3G][PDCP_AUTH_ALGO_SNOW3G] = pdcp_iv_gen_zs_zs,\n+\t\t[PDCP_CIPHER_ALGO_SNOW3G][PDCP_AUTH_ALGO_ZUC] = pdcp_iv_gen_zs_zs,\n+\n+\t\t[PDCP_CIPHER_ALGO_ZUC][PDCP_AUTH_ALGO_NULL] = pdcp_iv_gen_zs_null,\n+\t\t[PDCP_CIPHER_ALGO_ZUC][PDCP_AUTH_ALGO_AES] = pdcp_iv_gen_zs_aes_cmac,\n+\t\t[PDCP_CIPHER_ALGO_ZUC][PDCP_AUTH_ALGO_SNOW3G] = pdcp_iv_gen_zs_zs,\n+\t\t[PDCP_CIPHER_ALGO_ZUC][PDCP_AUTH_ALGO_ZUC] = pdcp_iv_gen_zs_zs,\n+\t};\n+\n+\ten_priv->iv_gen = iv_gen_map[ciph_algo][auth_algo];\n+\n+\treturn 0;\n+}\n+\n static inline void\n cop_prepare(const struct entity_priv *en_priv, struct rte_mbuf *mb, struct rte_crypto_op *cop,\n \t    uint8_t data_offset, uint32_t count, const bool is_auth)\n@@ -910,6 +1190,10 @@ pdcp_process_func_set(struct rte_pdcp_entity *entity, const struct rte_pdcp_enti\n \n \ten_priv = entity_priv_get(entity);\n \n+\tret = pdcp_iv_gen_func_set(entity, conf);\n+\tif (ret)\n+\t\treturn ret;\n+\n \tret = pdcp_entity_priv_populate(en_priv, conf);\n \tif (ret)\n \t\treturn ret;\n",
    "prefixes": [
        "v3",
        "08/22"
    ]
}