get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 126108,
    "url": "http://patches.dpdk.org/api/patches/126108/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230414174512.642-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": "<20230414174512.642-9-anoobj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230414174512.642-9-anoobj@marvell.com",
    "date": "2023-04-14T17:44:58",
    "name": "[v2,08/22] pdcp: add IV generation routines",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "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/20230414174512.642-9-anoobj@marvell.com/mbox/",
    "series": [
        {
            "id": 27723,
            "url": "http://patches.dpdk.org/api/series/27723/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27723",
            "date": "2023-04-14T17:44:50",
            "name": "lib: add pdcp protocol",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/27723/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/126108/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/126108/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 898FA42943;\n\tFri, 14 Apr 2023 19:46:25 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D13C642BC9;\n\tFri, 14 Apr 2023 19:46:09 +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 6125742D0E\n for <dev@dpdk.org>; Fri, 14 Apr 2023 19:46:08 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 33E906uw011272; Fri, 14 Apr 2023 10:46:06 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3py3tk2ecs-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Fri, 14 Apr 2023 10:46:06 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Fri, 14 Apr 2023 10:46:04 -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; Fri, 14 Apr 2023 10:46:04 -0700",
            "from BG-LT92004.corp.innovium.com (unknown [10.28.161.183])\n by maili.marvell.com (Postfix) with ESMTP id 138D53F7080;\n Fri, 14 Apr 2023 10:45:59 -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=/g5neQgmxsUMX2zwYsmsAd14TKSeA8NBjFr75c5pRkw=;\n b=bnarT2J9YAdx6DhCza9YVBIkjPCPCG8f9OIYqJuuFLgcXqGR8NWX8MoNK7XApRizG1Cb\n mpxWiHfRQIr0t6ocsGI5E/3AyltWMGgYq1+MQ4D/R0hR9pQlncI35FCfv218CJnfIoz0\n ejzXPaUZt8hqSGnRVUuG74m2n7KR85uIQovGzUE3rRQH/aJB8uko9LeWR4uc/M9uFOfW\n sqlDo5C3PE5RmASFVXKuWFQSojowJweARc6jw0QDhV71NEmRnKrRP4cqI9Vp2df896dz\n MUjCJPIkprfM1Bsm9vfs2v93PICMgrU9y/61gLy+kcF8iFqagtNrT9S5sW0JePJc+sMp tA==",
        "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 v2 08/22] pdcp: add IV generation routines",
        "Date": "Fri, 14 Apr 2023 23:14:58 +0530",
        "Message-ID": "<20230414174512.642-9-anoobj@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230414174512.642-1-anoobj@marvell.com>",
        "References": "<20221222092522.1628-1-anoobj@marvell.com>\n <20230414174512.642-1-anoobj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "s942vTQOFWSbnFv-7B-Ah-lv477VS5ZZ",
        "X-Proofpoint-ORIG-GUID": "s942vTQOFWSbnFv-7B-Ah-lv477VS5ZZ",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22\n definitions=2023-04-14_10,2023-04-14_01,2023-02-09_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": "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 d2d9bbe149..3108795977 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 79d6ca352a..9c1a5e0669 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@@ -909,6 +1189,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": [
        "v2",
        "08/22"
    ]
}