Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/104915/?format=api
http://patchwork.dpdk.org/api/patches/104915/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1638788880-650-8-git-send-email-anoobj@marvell.com/", "project": { "id": 1, "url": "http://patchwork.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": "<1638788880-650-8-git-send-email-anoobj@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1638788880-650-8-git-send-email-anoobj@marvell.com", "date": "2021-12-06T11:07:54", "name": "[v2,07/13] test/crypto: add transport mode cases", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "3dd926dc1333d09aaad269562099e59590ec6f35", "submitter": { "id": 1205, "url": "http://patchwork.dpdk.org/api/people/1205/?format=api", "name": "Anoob Joseph", "email": "anoobj@marvell.com" }, "delegate": { "id": 6690, "url": "http://patchwork.dpdk.org/api/users/6690/?format=api", "username": "akhil", "first_name": "akhil", "last_name": "goyal", "email": "gakhil@marvell.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1638788880-650-8-git-send-email-anoobj@marvell.com/mbox/", "series": [ { "id": 20868, "url": "http://patchwork.dpdk.org/api/series/20868/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20868", "date": "2021-12-06T11:07:47", "name": "Add new cases to lookaside IPsec tests", "version": 2, "mbox": "http://patchwork.dpdk.org/series/20868/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/104915/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/104915/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 117A8A034F;\n\tMon, 6 Dec 2021 12:09:02 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6E6DA41174;\n\tMon, 6 Dec 2021 12:08:54 +0100 (CET)", "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 7F78D411B2\n for <dev@dpdk.org>; Mon, 6 Dec 2021 12:08:52 +0100 (CET)", "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id\n 1B68nOUL023858;\n Mon, 6 Dec 2021 03:08:51 -0800", "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3cs0qn2uqc-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Mon, 06 Dec 2021 03:08:51 -0800", "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Mon, 6 Dec 2021 03:08:49 -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.18 via Frontend\n Transport; Mon, 6 Dec 2021 03:08:49 -0800", "from HY-LT1002.marvell.com (HY-LT1002.marvell.com [10.28.176.218])\n by maili.marvell.com (Postfix) with ESMTP id 0F48D3F704A;\n Mon, 6 Dec 2021 03:08:45 -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=SZgkXqDC6g2qK6+4jC8NWYcLFAolaP7jXng5R7pWDMo=;\n b=avZwxj/UctYp9638IW4R+8MBxgRkkSsy+TsyMaA1TFEJSjr4ZuLCZ/7JnexWc17FyVDm\n nux/xXUCD6LTamIYHu3x7jnxo5Lq6ZBfP4mwbzqPUq1zIk+FEDdDhyibxUiLmLr/bLco\n N7TGO8Dbzh7GaI/q1Jx/PtWNlNeH43YnLmO3jpoi4Rhk7PGAWG2Ydg3j19YJxvvhP+1Z\n rPM+mCx2xIrOJrHBLDN803Dtgpz8X0VdMKMPnN/fzRudCLwN0lx4qnCInoZNhqAbktAg\n dO/9mceFjwKAdP32nUfArMYTfpJt1Hatlu/jFV+JNXIYlgG9m5isbFs7OY1WIZSUTGK9 4g==", "From": "Anoob Joseph <anoobj@marvell.com>", "To": "Akhil Goyal <gakhil@marvell.com>, Declan Doherty\n <declan.doherty@intel.com>, Fan Zhang <roy.fan.zhang@intel.com>, \"Pablo de\n Lara\" <pablo.de.lara.guarch@intel.com>", "CC": "Anoob Joseph <anoobj@marvell.com>, Jerin Jacob <jerinj@marvell.com>,\n Archana Muniganti <marchana@marvell.com>, Tejasree Kondoj\n <ktejasree@marvell.com>, Hemant Agrawal <hemant.agrawal@nxp.com>, \"Radu\n Nicolau\" <radu.nicolau@intel.com>,\n Ciara Power <ciara.power@intel.com>, Gagandeep Singh <g.singh@nxp.com>,\n <dev@dpdk.org>", "Subject": "[PATCH v2 07/13] test/crypto: add transport mode cases", "Date": "Mon, 6 Dec 2021 16:37:54 +0530", "Message-ID": "<1638788880-650-8-git-send-email-anoobj@marvell.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1638788880-650-1-git-send-email-anoobj@marvell.com>", "References": "<1638777528-553-1-git-send-email-anoobj@marvell.com>\n <1638788880-650-1-git-send-email-anoobj@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-GUID": "sjoZJi0O7gAx1MVz6GFktlOD0_rBBCe2", "X-Proofpoint-ORIG-GUID": "sjoZJi0O7gAx1MVz6GFktlOD0_rBBCe2", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513\n definitions=2021-12-06_04,2021-12-06_01,2021-12-02_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": "Add transport mode tests with test cases for IPv4 packets.\n\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\n---\n app/test/test_cryptodev.c | 39 ++++++++++++++----\n app/test/test_cryptodev_security_ipsec.c | 71 +++++++++++++++++++++-----------\n app/test/test_cryptodev_security_ipsec.h | 1 +\n doc/guides/rel_notes/release_22_03.rst | 1 +\n 4 files changed, 80 insertions(+), 32 deletions(-)", "diff": "diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c\nindex e2bbabf..f470d5c 100644\n--- a/app/test/test_cryptodev.c\n+++ b/app/test/test_cryptodev.c\n@@ -9162,15 +9162,19 @@ test_ipsec_proto_process(const struct ipsec_test_data td[],\n \t\t\tdst += 1;\n \t}\n \n-\tif (td->ipsec_xform.tunnel.type ==\n-\t\t\tRTE_SECURITY_IPSEC_TUNNEL_IPV4) {\n-\t\tmemcpy(&ipsec_xform.tunnel.ipv4.src_ip, &src, sizeof(src));\n-\t\tmemcpy(&ipsec_xform.tunnel.ipv4.dst_ip, &dst, sizeof(dst));\n-\t} else {\n-\t\tmemcpy(&ipsec_xform.tunnel.ipv6.src_addr, &v6_src,\n-\t\t\tsizeof(v6_src));\n-\t\tmemcpy(&ipsec_xform.tunnel.ipv6.dst_addr, &v6_dst,\n-\t\t\tsizeof(v6_dst));\n+\tif (td->ipsec_xform.mode == RTE_SECURITY_IPSEC_SA_MODE_TUNNEL) {\n+\t\tif (td->ipsec_xform.tunnel.type ==\n+\t\t\t\tRTE_SECURITY_IPSEC_TUNNEL_IPV4) {\n+\t\t\tmemcpy(&ipsec_xform.tunnel.ipv4.src_ip, &src,\n+\t\t\t sizeof(src));\n+\t\t\tmemcpy(&ipsec_xform.tunnel.ipv4.dst_ip, &dst,\n+\t\t\t sizeof(dst));\n+\t\t} else {\n+\t\t\tmemcpy(&ipsec_xform.tunnel.ipv6.src_addr, &v6_src,\n+\t\t\t sizeof(v6_src));\n+\t\t\tmemcpy(&ipsec_xform.tunnel.ipv6.dst_addr, &v6_dst,\n+\t\t\t sizeof(v6_dst));\n+\t\t}\n \t}\n \n \tctx = rte_cryptodev_get_sec_ctx(dev_id);\n@@ -9636,6 +9640,19 @@ test_ipsec_proto_tunnel_v6_in_v4(const void *data __rte_unused)\n }\n \n static int\n+test_ipsec_proto_transport_v4(const void *data __rte_unused)\n+{\n+\tstruct ipsec_test_flags flags;\n+\n+\tmemset(&flags, 0, sizeof(flags));\n+\n+\tflags.ipv6 = false;\n+\tflags.transport = true;\n+\n+\treturn test_ipsec_proto_all(&flags);\n+}\n+\n+static int\n test_PDCP_PROTO_all(void)\n {\n \tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n@@ -14635,6 +14652,10 @@ static struct unit_test_suite ipsec_proto_testsuite = {\n \t\t\t\"Tunnel IPv6 in IPv4\",\n \t\t\tut_setup_security, ut_teardown,\n \t\t\ttest_ipsec_proto_tunnel_v6_in_v4),\n+\t\tTEST_CASE_NAMED_ST(\n+\t\t\t\"Transport IPv4\",\n+\t\t\tut_setup_security, ut_teardown,\n+\t\t\ttest_ipsec_proto_transport_v4),\n \t\tTEST_CASES_END() /**< NULL terminate unit test array */\n \t}\n };\ndiff --git a/app/test/test_cryptodev_security_ipsec.c b/app/test/test_cryptodev_security_ipsec.c\nindex ccce63f..029fdd3 100644\n--- a/app/test/test_cryptodev_security_ipsec.c\n+++ b/app/test/test_cryptodev_security_ipsec.c\n@@ -400,12 +400,21 @@ test_ipsec_td_prepare(const struct crypto_param *param1,\n \t\t\ttest_ipsec_csum_init(&td->input_text.data, false, true);\n \t\t}\n \n-\t\tif (flags->tunnel_ipv6)\n-\t\t\ttd->ipsec_xform.tunnel.type =\n-\t\t\t\t\tRTE_SECURITY_IPSEC_TUNNEL_IPV6;\n-\t\telse\n-\t\t\ttd->ipsec_xform.tunnel.type =\n-\t\t\t\t\tRTE_SECURITY_IPSEC_TUNNEL_IPV4;\n+\t\tif (flags->transport) {\n+\t\t\ttd->ipsec_xform.mode =\n+\t\t\t\t\tRTE_SECURITY_IPSEC_SA_MODE_TRANSPORT;\n+\t\t} else {\n+\t\t\ttd->ipsec_xform.mode =\n+\t\t\t\t\tRTE_SECURITY_IPSEC_SA_MODE_TUNNEL;\n+\n+\t\t\tif (flags->tunnel_ipv6)\n+\t\t\t\ttd->ipsec_xform.tunnel.type =\n+\t\t\t\t\t\tRTE_SECURITY_IPSEC_TUNNEL_IPV6;\n+\t\t\telse\n+\t\t\t\ttd->ipsec_xform.tunnel.type =\n+\t\t\t\t\t\tRTE_SECURITY_IPSEC_TUNNEL_IPV4;\n+\t\t}\n+\n \n \t}\n }\n@@ -748,29 +757,45 @@ test_ipsec_post_process(struct rte_mbuf *m, const struct ipsec_test_data *td,\n \tuint8_t *output_text = rte_pktmbuf_mtod(m, uint8_t *);\n \tint ret;\n \n-\tif (flags->iv_gen &&\n-\t td->ipsec_xform.direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) {\n-\t\tret = test_ipsec_iv_verify_push(m, td);\n-\t\tif (ret != TEST_SUCCESS)\n-\t\t\treturn ret;\n-\t}\n-\n \tif (td->ipsec_xform.direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) {\n \t\tconst struct rte_ipv4_hdr *iph4;\n \t\tconst struct rte_ipv6_hdr *iph6;\n \n-\t\tif (td->ipsec_xform.tunnel.type ==\n-\t\t\t\tRTE_SECURITY_IPSEC_TUNNEL_IPV4) {\n-\t\t\tiph4 = (const struct rte_ipv4_hdr *)output_text;\n-\t\t\tif (is_valid_ipv4_pkt(iph4) == false) {\n-\t\t\t\tprintf(\"Outer header is not IPv4\\n\");\n-\t\t\t\treturn TEST_FAILED;\n+\t\tif (flags->iv_gen) {\n+\t\t\tret = test_ipsec_iv_verify_push(m, td);\n+\t\t\tif (ret != TEST_SUCCESS)\n+\t\t\t\treturn ret;\n+\t\t}\n+\n+\t\tiph4 = (const struct rte_ipv4_hdr *)output_text;\n+\n+\t\tif (td->ipsec_xform.mode ==\n+\t\t\t\tRTE_SECURITY_IPSEC_SA_MODE_TRANSPORT) {\n+\t\t\tif (flags->ipv6) {\n+\t\t\t\tiph6 = (const struct rte_ipv6_hdr *)output_text;\n+\t\t\t\tif (is_valid_ipv6_pkt(iph6) == false) {\n+\t\t\t\t\tprintf(\"Transport packet is not IPv6\\n\");\n+\t\t\t\t\treturn TEST_FAILED;\n+\t\t\t\t}\n+\t\t\t} else {\n+\t\t\t\tif (is_valid_ipv4_pkt(iph4) == false) {\n+\t\t\t\t\tprintf(\"Transport packet is not IPv4\\n\");\n+\t\t\t\t\treturn TEST_FAILED;\n+\t\t\t\t}\n \t\t\t}\n \t\t} else {\n-\t\t\tiph6 = (const struct rte_ipv6_hdr *)output_text;\n-\t\t\tif (is_valid_ipv6_pkt(iph6) == false) {\n-\t\t\t\tprintf(\"Outer header is not IPv6\\n\");\n-\t\t\t\treturn TEST_FAILED;\n+\t\t\tif (td->ipsec_xform.tunnel.type ==\n+\t\t\t\t\tRTE_SECURITY_IPSEC_TUNNEL_IPV4) {\n+\t\t\t\tif (is_valid_ipv4_pkt(iph4) == false) {\n+\t\t\t\t\tprintf(\"Tunnel outer header is not IPv4\\n\");\n+\t\t\t\t\treturn TEST_FAILED;\n+\t\t\t\t}\n+\t\t\t} else {\n+\t\t\t\tiph6 = (const struct rte_ipv6_hdr *)output_text;\n+\t\t\t\tif (is_valid_ipv6_pkt(iph6) == false) {\n+\t\t\t\t\tprintf(\"Tunnel outer header is not IPv6\\n\");\n+\t\t\t\t\treturn TEST_FAILED;\n+\t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\ndiff --git a/app/test/test_cryptodev_security_ipsec.h b/app/test/test_cryptodev_security_ipsec.h\nindex 884a795..07d2453 100644\n--- a/app/test/test_cryptodev_security_ipsec.h\n+++ b/app/test/test_cryptodev_security_ipsec.h\n@@ -63,6 +63,7 @@ struct ipsec_test_flags {\n \tbool l4_csum;\n \tbool ipv6;\n \tbool tunnel_ipv6;\n+\tbool transport;\n \tbool fragment;\n };\n \ndiff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst\nindex 0562547..58e9690 100644\n--- a/doc/guides/rel_notes/release_22_03.rst\n+++ b/doc/guides/rel_notes/release_22_03.rst\n@@ -67,6 +67,7 @@ New Features\n * IPv4 in IPv4\n * IPv4 in IPv6\n * IPv6 in IPv4\n+ * Added IPv4 transport mode tests.\n * Added tunnel mode fragment packet tests.\n \n \n", "prefixes": [ "v2", "07/13" ] }{ "id": 104915, "url": "