get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 91542,
    "url": "https://patches.dpdk.org/api/patches/91542/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210415072205.1439-4-ktejasree@marvell.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20210415072205.1439-4-ktejasree@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210415072205.1439-4-ktejasree@marvell.com",
    "date": "2021-04-15T07:22:05",
    "name": "[v4,3/3] crypto/octeontx2: support lookaside IPv4 transport mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "05eaaf04477e8097430c61a0b61793bde81d9cfd",
    "submitter": {
        "id": 1789,
        "url": "https://patches.dpdk.org/api/people/1789/?format=api",
        "name": "Tejasree Kondoj",
        "email": "ktejasree@marvell.com"
    },
    "delegate": {
        "id": 6690,
        "url": "https://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210415072205.1439-4-ktejasree@marvell.com/mbox/",
    "series": [
        {
            "id": 16394,
            "url": "https://patches.dpdk.org/api/series/16394/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=16394",
            "date": "2021-04-15T07:22:02",
            "name": "add lookaside IPsec UDP encapsulation and transport mode",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/16394/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/91542/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/91542/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 C812CA0A0C;\n\tThu, 15 Apr 2021 08:26:34 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id ADEFC162043;\n\tThu, 15 Apr 2021 08:26:34 +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 5EFAA162042\n for <dev@dpdk.org>; Thu, 15 Apr 2021 08:26:33 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id\n 13F6PKhn029994; Wed, 14 Apr 2021 23:26:31 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com with ESMTP id 37wqtm4ju5-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 14 Apr 2021 23:26:31 -0700",
            "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.2;\n Wed, 14 Apr 2021 23:26:29 -0700",
            "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.2 via Frontend\n Transport; Wed, 14 Apr 2021 23:26:29 -0700",
            "from hyd1554T5810.caveonetworks.com.com (unknown [10.29.57.11])\n by maili.marvell.com (Postfix) with ESMTP id 57F363F703F;\n Wed, 14 Apr 2021 23:26:27 -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=57wFieEVBGYmc2inZ16Zvno+ZFlbmLthmGVWxngUBEY=;\n b=hPg/gRretQ4hHuMxrxQieyk/RLy7fGYVgBFeopVlrskyZ1fsagj9jCSVUeUoSAXJsyvD\n TL4eKSfDwjikJgPd4oe6Sk7EZicWopRdAtnuHBOmVfNt55vA+O7l6vWKkXxivG+Niyzn\n Yq/0Fg8PUSQmqJGOIft6aBjOeVx9YORpzoRgoFbNww6y3LmGP9zCQElwDLJTuZAW+vlw\n cBy0A+rKoatwCWyHQjPlham6SGid5YoHlGdibBn/cadAb8Vc+Y2YLy44458QTkrMZQ++\n M75R1ueFXUP58L7N3MUbozkhwawXoNW15ZuBtEAG+RdvijM5o4KczvC7pY764A7Xb2ng sg==",
        "From": "Tejasree Kondoj <ktejasree@marvell.com>",
        "To": "Akhil Goyal <gakhil@marvell.com>, Radu Nicolau <radu.nicolau@intel.com>",
        "CC": "Tejasree Kondoj <ktejasree@marvell.com>,\n Anoob Joseph <anoobj@marvell.com>,\n Ankur Dwivedi <adwivedi@marvell.com>, Jerin Jacob\n <jerinj@marvell.com>, <dev@dpdk.org>",
        "Date": "Thu, 15 Apr 2021 12:52:05 +0530",
        "Message-ID": "<20210415072205.1439-4-ktejasree@marvell.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20210415072205.1439-1-ktejasree@marvell.com>",
        "References": "<20210415072205.1439-1-ktejasree@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "hB4dnkQI4J3Swl5jqFCs4L3YxoLVEurm",
        "X-Proofpoint-GUID": "hB4dnkQI4J3Swl5jqFCs4L3YxoLVEurm",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761\n definitions=2021-04-15_02:2021-04-15,\n 2021-04-15 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v4 3/3] crypto/octeontx2: support lookaside IPv4\n transport mode",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Adding support for IPv4 lookaside IPsec transport mode.\n\nSigned-off-by: Tejasree Kondoj <ktejasree@marvell.com>\nAcked-by: Akhil Goyal <gakhil@marvell.com>\n---\n doc/guides/cryptodevs/octeontx2.rst           |   1 +\n doc/guides/rel_notes/release_21_05.rst        |   2 +\n drivers/crypto/octeontx2/otx2_cryptodev_ops.c |   7 +-\n drivers/crypto/octeontx2/otx2_cryptodev_sec.c | 110 ++++++++++--------\n drivers/crypto/octeontx2/otx2_cryptodev_sec.h |   4 +-\n drivers/crypto/octeontx2/otx2_ipsec_po.h      |   6 +\n drivers/crypto/octeontx2/otx2_ipsec_po_ops.h  |   8 +-\n 7 files changed, 78 insertions(+), 60 deletions(-)",
    "diff": "diff --git a/doc/guides/cryptodevs/octeontx2.rst b/doc/guides/cryptodevs/octeontx2.rst\nindex 00226a8c77..f0beb92a49 100644\n--- a/doc/guides/cryptodevs/octeontx2.rst\n+++ b/doc/guides/cryptodevs/octeontx2.rst\n@@ -179,6 +179,7 @@ Features supported\n * IPv6\n * ESP\n * Tunnel mode\n+* Transport mode(IPv4)\n * ESN\n * Anti-replay\n * UDP Encapsulation\ndiff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst\nindex e2ab7e0290..f04d097056 100644\n--- a/doc/guides/rel_notes/release_21_05.rst\n+++ b/doc/guides/rel_notes/release_21_05.rst\n@@ -159,6 +159,8 @@ New Features\n   * Added support for DIGEST_ENCRYPTED mode in OCTEON TX2 crypto PMD.\n   * Updated the OCTEON TX2 crypto PMD lookaside protocol offload for IPsec with\n     UDP encapsulation support for NAT Traversal.\n+  * Updated the OCTEON TX2 crypto PMD lookaside protocol offload for IPsec with\n+    IPv4 transport mode support.\n \n * **Updated Mellanox RegEx PMD.**\n \ndiff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c\nindex fc4d5bac49..31dd0d7f7c 100644\n--- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c\n+++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c\n@@ -932,7 +932,7 @@ otx2_cpt_sec_post_process(struct rte_crypto_op *cop, uintptr_t *rsp)\n \tstruct rte_mbuf *m = sym_op->m_src;\n \tstruct rte_ipv6_hdr *ip6;\n \tstruct rte_ipv4_hdr *ip;\n-\tuint16_t m_len;\n+\tuint16_t m_len = 0;\n \tint mdata_len;\n \tchar *data;\n \n@@ -942,11 +942,12 @@ otx2_cpt_sec_post_process(struct rte_crypto_op *cop, uintptr_t *rsp)\n \tif (word0->s.opcode.major == OTX2_IPSEC_PO_PROCESS_IPSEC_INB) {\n \t\tdata = rte_pktmbuf_mtod(m, char *);\n \n-\t\tif (rsp[4] == RTE_SECURITY_IPSEC_TUNNEL_IPV4) {\n+\t\tif (rsp[4] == OTX2_IPSEC_PO_TRANSPORT ||\n+\t\t    rsp[4] == OTX2_IPSEC_PO_TUNNEL_IPV4) {\n \t\t\tip = (struct rte_ipv4_hdr *)(data +\n \t\t\t\tOTX2_IPSEC_PO_INB_RPTR_HDR);\n \t\t\tm_len = rte_be_to_cpu_16(ip->total_length);\n-\t\t} else {\n+\t\t} else if (rsp[4] == OTX2_IPSEC_PO_TUNNEL_IPV6) {\n \t\t\tip6 = (struct rte_ipv6_hdr *)(data +\n \t\t\t\tOTX2_IPSEC_PO_INB_RPTR_HDR);\n \t\t\tm_len = rte_be_to_cpu_16(ip6->payload_len) +\ndiff --git a/drivers/crypto/octeontx2/otx2_cryptodev_sec.c b/drivers/crypto/octeontx2/otx2_cryptodev_sec.c\nindex 210c53aa0a..3c5686a42c 100644\n--- a/drivers/crypto/octeontx2/otx2_cryptodev_sec.c\n+++ b/drivers/crypto/octeontx2/otx2_cryptodev_sec.c\n@@ -25,12 +25,15 @@ ipsec_lp_len_precalc(struct rte_security_ipsec_xform *ipsec,\n {\n \tstruct rte_crypto_sym_xform *cipher_xform, *auth_xform;\n \n-\tif (ipsec->tunnel.type == RTE_SECURITY_IPSEC_TUNNEL_IPV4)\n-\t\tlp->partial_len = sizeof(struct rte_ipv4_hdr);\n-\telse if (ipsec->tunnel.type == RTE_SECURITY_IPSEC_TUNNEL_IPV6)\n-\t\tlp->partial_len = sizeof(struct rte_ipv6_hdr);\n-\telse\n-\t\treturn -EINVAL;\n+\tlp->partial_len = 0;\n+\tif (ipsec->mode == RTE_SECURITY_IPSEC_SA_MODE_TUNNEL) {\n+\t\tif (ipsec->tunnel.type == RTE_SECURITY_IPSEC_TUNNEL_IPV4)\n+\t\t\tlp->partial_len = sizeof(struct rte_ipv4_hdr);\n+\t\telse if (ipsec->tunnel.type == RTE_SECURITY_IPSEC_TUNNEL_IPV6)\n+\t\t\tlp->partial_len = sizeof(struct rte_ipv6_hdr);\n+\t\telse\n+\t\t\treturn -EINVAL;\n+\t}\n \n \tif (ipsec->proto == RTE_SECURITY_IPSEC_SA_PROTO_ESP) {\n \t\tlp->partial_len += sizeof(struct rte_esp_hdr);\n@@ -203,7 +206,7 @@ crypto_sec_ipsec_outb_session_create(struct rte_cryptodev *crypto_dev,\n \t\t\t\t     struct rte_security_session *sec_sess)\n {\n \tstruct rte_crypto_sym_xform *auth_xform, *cipher_xform;\n-\tstruct otx2_ipsec_po_ip_template *template;\n+\tstruct otx2_ipsec_po_ip_template *template = NULL;\n \tconst uint8_t *cipher_key, *auth_key;\n \tstruct otx2_sec_session_ipsec_lp *lp;\n \tstruct otx2_ipsec_po_sa_ctl *ctl;\n@@ -229,10 +232,10 @@ crypto_sec_ipsec_outb_session_create(struct rte_cryptodev *crypto_dev,\n \tmemset(sa, 0, sizeof(struct otx2_ipsec_po_out_sa));\n \n \t/* Initialize lookaside ipsec private data */\n+\tlp->mode_type = OTX2_IPSEC_PO_TRANSPORT;\n \tlp->ip_id = 0;\n \tlp->seq_lo = 1;\n \tlp->seq_hi = 0;\n-\tlp->tunnel_type = ipsec->tunnel.type;\n \n \tret = ipsec_po_sa_ctl_set(ipsec, crypto_xform, ctl);\n \tif (ret)\n@@ -242,46 +245,47 @@ crypto_sec_ipsec_outb_session_create(struct rte_cryptodev *crypto_dev,\n \tif (ret)\n \t\treturn ret;\n \n-\tif (ipsec->mode == RTE_SECURITY_IPSEC_SA_MODE_TUNNEL) {\n-\t\t/* Start ip id from 1 */\n-\t\tlp->ip_id = 1;\n+\t/* Start ip id from 1 */\n+\tlp->ip_id = 1;\n+\n+\tif (ctl->enc_type == OTX2_IPSEC_PO_SA_ENC_AES_GCM) {\n+\t\ttemplate = &sa->aes_gcm.template;\n+\t\tctx_len = offsetof(struct otx2_ipsec_po_out_sa,\n+\t\t\t\taes_gcm.template) + sizeof(\n+\t\t\t\tsa->aes_gcm.template.ip4);\n+\t\tctx_len = RTE_ALIGN_CEIL(ctx_len, 8);\n+\t\tlp->ctx_len = ctx_len >> 3;\n+\t} else if (ctl->auth_type ==\n+\t\t\tOTX2_IPSEC_PO_SA_AUTH_SHA1) {\n+\t\ttemplate = &sa->sha1.template;\n+\t\tctx_len = offsetof(struct otx2_ipsec_po_out_sa,\n+\t\t\t\tsha1.template) + sizeof(\n+\t\t\t\tsa->sha1.template.ip4);\n+\t\tctx_len = RTE_ALIGN_CEIL(ctx_len, 8);\n+\t\tlp->ctx_len = ctx_len >> 3;\n+\t} else if (ctl->auth_type ==\n+\t\t\tOTX2_IPSEC_PO_SA_AUTH_SHA2_256) {\n+\t\ttemplate = &sa->sha2.template;\n+\t\tctx_len = offsetof(struct otx2_ipsec_po_out_sa,\n+\t\t\t\tsha2.template) + sizeof(\n+\t\t\t\tsa->sha2.template.ip4);\n+\t\tctx_len = RTE_ALIGN_CEIL(ctx_len, 8);\n+\t\tlp->ctx_len = ctx_len >> 3;\n+\t} else {\n+\t\treturn -EINVAL;\n+\t}\n+\tip = &template->ip4.ipv4_hdr;\n+\tif (ipsec->options.udp_encap) {\n+\t\tip->next_proto_id = IPPROTO_UDP;\n+\t\ttemplate->ip4.udp_src = rte_be_to_cpu_16(4500);\n+\t\ttemplate->ip4.udp_dst = rte_be_to_cpu_16(4500);\n+\t} else {\n+\t\tip->next_proto_id = IPPROTO_ESP;\n+\t}\n \n+\tif (ipsec->mode == RTE_SECURITY_IPSEC_SA_MODE_TUNNEL) {\n \t\tif (ipsec->tunnel.type == RTE_SECURITY_IPSEC_TUNNEL_IPV4) {\n-\n-\t\t\tif (ctl->enc_type == OTX2_IPSEC_PO_SA_ENC_AES_GCM) {\n-\t\t\t\ttemplate = &sa->aes_gcm.template;\n-\t\t\t\tctx_len = offsetof(struct otx2_ipsec_po_out_sa,\n-\t\t\t\t\t\taes_gcm.template) + sizeof(\n-\t\t\t\t\t\tsa->aes_gcm.template.ip4);\n-\t\t\t\tctx_len = RTE_ALIGN_CEIL(ctx_len, 8);\n-\t\t\t\tlp->ctx_len = ctx_len >> 3;\n-\t\t\t} else if (ctl->auth_type ==\n-\t\t\t\t\tOTX2_IPSEC_PO_SA_AUTH_SHA1) {\n-\t\t\t\ttemplate = &sa->sha1.template;\n-\t\t\t\tctx_len = offsetof(struct otx2_ipsec_po_out_sa,\n-\t\t\t\t\t\tsha1.template) + sizeof(\n-\t\t\t\t\t\tsa->sha1.template.ip4);\n-\t\t\t\tctx_len = RTE_ALIGN_CEIL(ctx_len, 8);\n-\t\t\t\tlp->ctx_len = ctx_len >> 3;\n-\t\t\t} else if (ctl->auth_type ==\n-\t\t\t\t\tOTX2_IPSEC_PO_SA_AUTH_SHA2_256) {\n-\t\t\t\ttemplate = &sa->sha2.template;\n-\t\t\t\tctx_len = offsetof(struct otx2_ipsec_po_out_sa,\n-\t\t\t\t\t\tsha2.template) + sizeof(\n-\t\t\t\t\t\tsa->sha2.template.ip4);\n-\t\t\t\tctx_len = RTE_ALIGN_CEIL(ctx_len, 8);\n-\t\t\t\tlp->ctx_len = ctx_len >> 3;\n-\t\t\t} else {\n-\t\t\t\treturn -EINVAL;\n-\t\t\t}\n-\t\t\tip = &template->ip4.ipv4_hdr;\n-\t\t\tif (ipsec->options.udp_encap) {\n-\t\t\t\tip->next_proto_id = IPPROTO_UDP;\n-\t\t\t\ttemplate->ip4.udp_src = rte_be_to_cpu_16(4500);\n-\t\t\t\ttemplate->ip4.udp_dst = rte_be_to_cpu_16(4500);\n-\t\t\t} else {\n-\t\t\t\tip->next_proto_id = IPPROTO_ESP;\n-\t\t\t}\n+\t\t\tlp->mode_type = OTX2_IPSEC_PO_TUNNEL_IPV4;\n \t\t\tip->version_ihl = RTE_IPV4_VHL_DEF;\n \t\t\tip->time_to_live = ipsec->tunnel.ipv4.ttl;\n \t\t\tip->type_of_service |= (ipsec->tunnel.ipv4.dscp << 2);\n@@ -294,6 +298,7 @@ crypto_sec_ipsec_outb_session_create(struct rte_cryptodev *crypto_dev,\n \t\t} else if (ipsec->tunnel.type ==\n \t\t\t\tRTE_SECURITY_IPSEC_TUNNEL_IPV6) {\n \n+\t\t\tlp->mode_type = OTX2_IPSEC_PO_TUNNEL_IPV6;\n \t\t\tif (ctl->enc_type == OTX2_IPSEC_PO_SA_ENC_AES_GCM) {\n \t\t\t\ttemplate = &sa->aes_gcm.template;\n \t\t\t\tctx_len = offsetof(struct otx2_ipsec_po_out_sa,\n@@ -343,11 +348,7 @@ crypto_sec_ipsec_outb_session_create(struct rte_cryptodev *crypto_dev,\n \t\t\t\tsizeof(struct in6_addr));\n \t\t\tmemcpy(&ip6->dst_addr, &ipsec->tunnel.ipv6.dst_addr,\n \t\t\t\tsizeof(struct in6_addr));\n-\t\t} else {\n-\t\t\treturn -EINVAL;\n \t\t}\n-\t} else {\n-\t\treturn -EINVAL;\n \t}\n \n \tcipher_xform = crypto_xform;\n@@ -428,13 +429,20 @@ crypto_sec_ipsec_inb_session_create(struct rte_cryptodev *crypto_dev,\n \tif (ret)\n \t\treturn ret;\n \n-\tlp->tunnel_type = ipsec->tunnel.type;\n+\tlp->mode_type = OTX2_IPSEC_PO_TRANSPORT;\n+\n \tauth_xform = crypto_xform;\n \tcipher_xform = crypto_xform->next;\n \n \tcipher_key_len = 0;\n \tauth_key_len = 0;\n \n+\tif (ipsec->mode == RTE_SECURITY_IPSEC_SA_MODE_TUNNEL)\n+\t\tlp->mode_type = (ipsec->tunnel.type ==\n+\t\t\t\tRTE_SECURITY_IPSEC_TUNNEL_IPV4) ?\n+\t\t\t\tOTX2_IPSEC_PO_TUNNEL_IPV4 :\n+\t\t\t\tOTX2_IPSEC_PO_TUNNEL_IPV6;\n+\n \tif (crypto_xform->type == RTE_CRYPTO_SYM_XFORM_AEAD) {\n \t\tif (crypto_xform->aead.algo == RTE_CRYPTO_AEAD_AES_GCM)\n \t\t\tmemcpy(sa->iv.gcm.nonce, &ipsec->salt, 4);\ndiff --git a/drivers/crypto/octeontx2/otx2_cryptodev_sec.h b/drivers/crypto/octeontx2/otx2_cryptodev_sec.h\nindex 2849c1ab75..87f55c97fe 100644\n--- a/drivers/crypto/octeontx2/otx2_cryptodev_sec.h\n+++ b/drivers/crypto/octeontx2/otx2_cryptodev_sec.h\n@@ -55,8 +55,8 @@ struct otx2_sec_session_ipsec_lp {\n \tuint8_t iv_length;\n \t/** Auth IV length in bytes */\n \tuint8_t auth_iv_length;\n-\t/** IPsec tunnel type */\n-\tenum rte_security_ipsec_tunnel_type tunnel_type;\n+\t/** IPsec mode and tunnel type */\n+\tenum otx2_ipsec_po_mode_type mode_type;\n };\n \n int otx2_crypto_sec_ctx_create(struct rte_cryptodev *crypto_dev);\ndiff --git a/drivers/crypto/octeontx2/otx2_ipsec_po.h b/drivers/crypto/octeontx2/otx2_ipsec_po.h\nindex eda9f19738..b3e7456551 100644\n--- a/drivers/crypto/octeontx2/otx2_ipsec_po.h\n+++ b/drivers/crypto/octeontx2/otx2_ipsec_po.h\n@@ -20,6 +20,12 @@\n \n #define OTX2_IPSEC_PO_INB_RPTR_HDR         0x8\n \n+enum otx2_ipsec_po_mode_type {\n+\tOTX2_IPSEC_PO_TRANSPORT = 1,\n+\tOTX2_IPSEC_PO_TUNNEL_IPV4,\n+\tOTX2_IPSEC_PO_TUNNEL_IPV6,\n+};\n+\n enum otx2_ipsec_po_comp_e {\n \tOTX2_IPSEC_PO_CC_SUCCESS = 0x00,\n \tOTX2_IPSEC_PO_CC_AUTH_UNSUPPORTED = 0xB0,\ndiff --git a/drivers/crypto/octeontx2/otx2_ipsec_po_ops.h b/drivers/crypto/octeontx2/otx2_ipsec_po_ops.h\nindex f4cab19811..58b199f4f3 100644\n--- a/drivers/crypto/octeontx2/otx2_ipsec_po_ops.h\n+++ b/drivers/crypto/octeontx2/otx2_ipsec_po_ops.h\n@@ -26,7 +26,7 @@ otx2_ipsec_po_out_rlen_get(struct otx2_sec_session_ipsec_lp *sess,\n \n static __rte_always_inline struct cpt_request_info *\n alloc_request_struct(char *maddr, void *cop, int mdata_len,\n-\t\t     enum rte_security_ipsec_tunnel_type tunnel_type)\n+\t\t     enum otx2_ipsec_po_mode_type mode_type)\n {\n \tstruct cpt_request_info *req;\n \tstruct cpt_meta_info *meta;\n@@ -48,7 +48,7 @@ alloc_request_struct(char *maddr, void *cop, int mdata_len,\n \top[1] = (uintptr_t)cop;\n \top[2] = (uintptr_t)req;\n \top[3] = mdata_len;\n-\top[4] = tunnel_type;\n+\top[4] = mode_type;\n \n \treturn req;\n }\n@@ -89,7 +89,7 @@ process_outb_sa(struct rte_crypto_op *cop,\n \n \tmdata += extend_tail; /* mdata follows encrypted data */\n \treq = alloc_request_struct(mdata, (void *)cop, mdata_len,\n-\t\tsess->tunnel_type);\n+\t\tsess->mode_type);\n \n \tdata = rte_pktmbuf_prepend(m_src, extend_head);\n \tif (unlikely(data == NULL)) {\n@@ -162,7 +162,7 @@ process_inb_sa(struct rte_crypto_op *cop,\n \t}\n \n \treq = alloc_request_struct(mdata, (void *)cop, mdata_len,\n-\t\tsess->tunnel_type);\n+\t\tsess->mode_type);\n \n \t/* Prepare CPT instruction */\n \tword0.u64 = sess->ucmd_w0;\n",
    "prefixes": [
        "v4",
        "3/3"
    ]
}