get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 104921,
    "url": "http://patchwork.dpdk.org/api/patches/104921/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1638788880-650-14-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-14-git-send-email-anoobj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1638788880-650-14-git-send-email-anoobj@marvell.com",
    "date": "2021-12-06T11:08:00",
    "name": "[v2,13/13] test/crypto: add copy and set DF cases",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "47034091ff4fdacd2a03a3427bcef35fb48521d9",
    "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-14-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/104921/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/104921/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 9D6D2A034F;\n\tMon,  6 Dec 2021 12:09:42 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 76EE941168;\n\tMon,  6 Dec 2021 12:09:26 +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 44750410E5\n for <dev@dpdk.org>; Mon,  6 Dec 2021 12:09:25 +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 1B68PoDA013769;\n Mon, 6 Dec 2021 03:09:24 -0800",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3cs0qn2utn-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Mon, 06 Dec 2021 03:09:24 -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:09:22 -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:09:22 -0800",
            "from HY-LT1002.marvell.com (HY-LT1002.marvell.com [10.28.176.218])\n by maili.marvell.com (Postfix) with ESMTP id CA8263F704A;\n Mon,  6 Dec 2021 03:09:18 -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=nzxs0N8TRRmgi7Znnc0pW28zQocSuhiqGHY3eo7lIW0=;\n b=cxomGCwMI0qJy3O1QG1npZTTXG7KK2mHTJ/99iOjXrvbyx/Jhna38Eu2EunTVKiTukwN\n Vpqmh5hk+6dSNeMMf4Frt2rd9TJ2iNYsFgC/hKkf7FKs8dx9owyKzhloGDhcmRHAAy6i\n la74ExpLe3qLcpXYhlMuNOne7SMpONLUd2MBlI56qGfw/2+pd662cGhFPir4O/wuPiqb\n Fl7zlYvhKesMgs/wYy0M3Scm4nr7i5rmdOUIHAtPDu7iALxvjLkLTBeLKOb0ddSrr3DY\n TjnLXt+dmt44iUI78cSdOoXpUShlb7cNCS6bmlGKiKQ6KEUAw//HMGf3KgiRekM6IvkF hw==",
        "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 13/13] test/crypto: add copy and set DF cases",
        "Date": "Mon, 6 Dec 2021 16:38:00 +0530",
        "Message-ID": "<1638788880-650-14-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": "Y6xcN5NbYtxicb0pYx8Vv3yYfYneeb8c",
        "X-Proofpoint-ORIG-GUID": "Y6xcN5NbYtxicb0pYx8Vv3yYfYneeb8c",
        "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 test cases to verify copy DF and set DF options with lookaside IPsec\noffload.\n\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\n---\n app/test/test_cryptodev.c                | 75 ++++++++++++++++++++++++++++++++\n app/test/test_cryptodev_security_ipsec.c | 71 ++++++++++++++++++++++++++++--\n app/test/test_cryptodev_security_ipsec.h | 10 +++++\n doc/guides/rel_notes/release_22_03.rst   |  1 +\n 4 files changed, 154 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c\nindex 203b4a4..f808719 100644\n--- a/app/test/test_cryptodev.c\n+++ b/app/test/test_cryptodev.c\n@@ -9169,6 +9169,13 @@ test_ipsec_proto_process(const struct ipsec_test_data td[],\n \t\t\t       sizeof(src));\n \t\t\tmemcpy(&ipsec_xform.tunnel.ipv4.dst_ip, &dst,\n \t\t\t       sizeof(dst));\n+\n+\t\t\tif (flags->df == TEST_IPSEC_SET_DF_0_INNER_1)\n+\t\t\t\tipsec_xform.tunnel.ipv4.df = 0;\n+\n+\t\t\tif (flags->df == TEST_IPSEC_SET_DF_1_INNER_0)\n+\t\t\t\tipsec_xform.tunnel.ipv4.df = 1;\n+\n \t\t} else {\n \t\t\tmemcpy(&ipsec_xform.tunnel.ipv6.src_addr, &v6_src,\n \t\t\t       sizeof(v6_src));\n@@ -9282,6 +9289,9 @@ test_ipsec_proto_process(const struct ipsec_test_data td[],\n \t\tmemcpy(input_text, td[i].input_text.data,\n \t\t       td[i].input_text.len);\n \n+\t\tif (test_ipsec_pkt_update(input_text, flags))\n+\t\t\treturn TEST_FAILED;\n+\n \t\t/* Generate crypto op data structure */\n \t\tut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,\n \t\t\t\t\tRTE_CRYPTO_OP_TYPE_SYMMETRIC);\n@@ -9700,6 +9710,55 @@ test_ipsec_proto_pkt_fragment(const void *data __rte_unused)\n \tflags.fragment = true;\n \n \treturn test_ipsec_proto_all(&flags);\n+\n+}\n+\n+static int\n+test_ipsec_proto_copy_df_inner_0(const void *data __rte_unused)\n+{\n+\tstruct ipsec_test_flags flags;\n+\n+\tmemset(&flags, 0, sizeof(flags));\n+\n+\tflags.df = TEST_IPSEC_COPY_DF_INNER_0;\n+\n+\treturn test_ipsec_proto_all(&flags);\n+}\n+\n+static int\n+test_ipsec_proto_copy_df_inner_1(const void *data __rte_unused)\n+{\n+\tstruct ipsec_test_flags flags;\n+\n+\tmemset(&flags, 0, sizeof(flags));\n+\n+\tflags.df = TEST_IPSEC_COPY_DF_INNER_1;\n+\n+\treturn test_ipsec_proto_all(&flags);\n+}\n+\n+static int\n+test_ipsec_proto_set_df_0_inner_1(const void *data __rte_unused)\n+{\n+\tstruct ipsec_test_flags flags;\n+\n+\tmemset(&flags, 0, sizeof(flags));\n+\n+\tflags.df = TEST_IPSEC_SET_DF_0_INNER_1;\n+\n+\treturn test_ipsec_proto_all(&flags);\n+}\n+\n+static int\n+test_ipsec_proto_set_df_1_inner_0(const void *data __rte_unused)\n+{\n+\tstruct ipsec_test_flags flags;\n+\n+\tmemset(&flags, 0, sizeof(flags));\n+\n+\tflags.df = TEST_IPSEC_SET_DF_1_INNER_0;\n+\n+\treturn test_ipsec_proto_all(&flags);\n }\n \n static int\n@@ -14724,6 +14783,22 @@ static struct unit_test_suite ipsec_proto_testsuite  = {\n \t\t\t\"Fragmented packet\",\n \t\t\tut_setup_security, ut_teardown,\n \t\t\ttest_ipsec_proto_pkt_fragment),\n+\t\tTEST_CASE_NAMED_ST(\n+\t\t\t\"Tunnel header copy DF (inner 0)\",\n+\t\t\tut_setup_security, ut_teardown,\n+\t\t\ttest_ipsec_proto_copy_df_inner_0),\n+\t\tTEST_CASE_NAMED_ST(\n+\t\t\t\"Tunnel header copy DF (inner 1)\",\n+\t\t\tut_setup_security, ut_teardown,\n+\t\t\ttest_ipsec_proto_copy_df_inner_1),\n+\t\tTEST_CASE_NAMED_ST(\n+\t\t\t\"Tunnel header set DF 0 (inner 1)\",\n+\t\t\tut_setup_security, ut_teardown,\n+\t\t\ttest_ipsec_proto_set_df_0_inner_1),\n+\t\tTEST_CASE_NAMED_ST(\n+\t\t\t\"Tunnel header set DF 1 (inner 0)\",\n+\t\t\tut_setup_security, ut_teardown,\n+\t\t\ttest_ipsec_proto_set_df_1_inner_0),\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 94e5213..e662ea2 100644\n--- a/app/test/test_cryptodev_security_ipsec.c\n+++ b/app/test/test_cryptodev_security_ipsec.c\n@@ -427,6 +427,9 @@ test_ipsec_td_prepare(const struct crypto_param *param1,\n \t\t\tip->hdr_checksum = rte_ipv4_cksum(ip);\n \t\t}\n \n+\t\tif (flags->df == TEST_IPSEC_COPY_DF_INNER_0 ||\n+\t\t    flags->df == TEST_IPSEC_COPY_DF_INNER_1)\n+\t\t\ttd->ipsec_xform.options.copy_df = 1;\n \t}\n }\n \n@@ -640,6 +643,7 @@ test_ipsec_td_verify(struct rte_mbuf *m, const struct ipsec_test_data *td,\n {\n \tuint8_t *output_text = rte_pktmbuf_mtod(m, uint8_t *);\n \tuint32_t skip, len = rte_pktmbuf_pkt_len(m);\n+\tuint8_t td_output_text[4096];\n \tint ret;\n \n \t/* For tests with status as error for test success, skip verification */\n@@ -720,16 +724,21 @@ test_ipsec_td_verify(struct rte_mbuf *m, const struct ipsec_test_data *td,\n \t\treturn ret;\n \t}\n \n+\tmemcpy(td_output_text, td->output_text.data + skip, len);\n \n-\tif (memcmp(output_text, td->output_text.data + skip, len)) {\n+\tif (test_ipsec_pkt_update(td_output_text, flags)) {\n+\t\tprintf(\"Could not update expected vector\");\n+\t\treturn TEST_FAILED;\n+\t}\n+\n+\tif (memcmp(output_text, td_output_text, len)) {\n \t\tif (silent)\n \t\t\treturn TEST_FAILED;\n \n \t\tprintf(\"TestCase %s line %d: %s\\n\", __func__, __LINE__,\n \t\t\t\"output text not as expected\\n\");\n \n-\t\trte_hexdump(stdout, \"expected\", td->output_text.data + skip,\n-\t\t\t    len);\n+\t\trte_hexdump(stdout, \"expected\", td_output_text, len);\n \t\trte_hexdump(stdout, \"actual\", output_text, len);\n \t\treturn TEST_FAILED;\n \t}\n@@ -797,10 +806,27 @@ test_ipsec_post_process(struct rte_mbuf *m, const struct ipsec_test_data *td,\n \t\t} else {\n \t\t\tif (td->ipsec_xform.tunnel.type ==\n \t\t\t\t\tRTE_SECURITY_IPSEC_TUNNEL_IPV4) {\n+\t\t\t\tuint16_t f_off;\n+\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+\n+\t\t\t\tf_off = rte_be_to_cpu_16(iph4->fragment_offset);\n+\n+\t\t\t\tif (flags->df == TEST_IPSEC_COPY_DF_INNER_1 ||\n+\t\t\t\t    flags->df == TEST_IPSEC_SET_DF_1_INNER_0) {\n+\t\t\t\t\tif (!(f_off & RTE_IPV4_HDR_DF_FLAG)) {\n+\t\t\t\t\t\tprintf(\"DF bit is not set\\n\");\n+\t\t\t\t\t\treturn TEST_FAILED;\n+\t\t\t\t\t}\n+\t\t\t\t} else {\n+\t\t\t\t\tif ((f_off & RTE_IPV4_HDR_DF_FLAG)) {\n+\t\t\t\t\t\tprintf(\"DF bit is set\\n\");\n+\t\t\t\t\t\treturn TEST_FAILED;\n+\t\t\t\t\t}\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@@ -909,3 +935,42 @@ test_ipsec_stats_verify(struct rte_security_ctx *ctx,\n \n \treturn ret;\n }\n+\n+int\n+test_ipsec_pkt_update(uint8_t *pkt, const struct ipsec_test_flags *flags)\n+{\n+\tstruct rte_ipv4_hdr *iph4;\n+\tbool cksum_dirty = false;\n+\tuint16_t frag_off;\n+\n+\tiph4 = (struct rte_ipv4_hdr *)pkt;\n+\n+\tif (flags->df == TEST_IPSEC_COPY_DF_INNER_1 ||\n+\t    flags->df == TEST_IPSEC_SET_DF_0_INNER_1 ||\n+\t    flags->df == TEST_IPSEC_COPY_DF_INNER_0 ||\n+\t    flags->df == TEST_IPSEC_SET_DF_1_INNER_0) {\n+\n+\t\tif (!is_ipv4(iph4)) {\n+\t\t\tprintf(\"Invalid packet type\");\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\tfrag_off = rte_be_to_cpu_16(iph4->fragment_offset);\n+\n+\t\tif (flags->df == TEST_IPSEC_COPY_DF_INNER_1 ||\n+\t\t    flags->df == TEST_IPSEC_SET_DF_0_INNER_1)\n+\t\t\tfrag_off |= RTE_IPV4_HDR_DF_FLAG;\n+\t\telse\n+\t\t\tfrag_off &= ~RTE_IPV4_HDR_DF_FLAG;\n+\n+\t\tiph4->fragment_offset = rte_cpu_to_be_16(frag_off);\n+\t\tcksum_dirty = true;\n+\t}\n+\n+\tif (cksum_dirty && is_ipv4(iph4)) {\n+\t\tiph4->hdr_checksum = 0;\n+\t\tiph4->hdr_checksum = rte_ipv4_cksum(iph4);\n+\t}\n+\n+\treturn 0;\n+}\ndiff --git a/app/test/test_cryptodev_security_ipsec.h b/app/test/test_cryptodev_security_ipsec.h\nindex 6e27eba..12a9b77 100644\n--- a/app/test/test_cryptodev_security_ipsec.h\n+++ b/app/test/test_cryptodev_security_ipsec.h\n@@ -50,6 +50,13 @@ struct ipsec_test_data {\n \t} xform;\n };\n \n+enum df_flags {\n+\tTEST_IPSEC_COPY_DF_INNER_0 = 1,\n+\tTEST_IPSEC_COPY_DF_INNER_1,\n+\tTEST_IPSEC_SET_DF_0_INNER_1,\n+\tTEST_IPSEC_SET_DF_1_INNER_0,\n+};\n+\n struct ipsec_test_flags {\n \tbool display_alg;\n \tbool sa_expiry_pkts_soft;\n@@ -66,6 +73,7 @@ struct ipsec_test_flags {\n \tbool transport;\n \tbool fragment;\n \tbool stats_success;\n+\tenum df_flags df;\n };\n \n struct crypto_param {\n@@ -226,4 +234,6 @@ int test_ipsec_stats_verify(struct rte_security_ctx *ctx,\n \t\t\t    const struct ipsec_test_flags *flags,\n \t\t\t    enum rte_security_ipsec_sa_direction dir);\n \n+int test_ipsec_pkt_update(uint8_t *pkt, const struct ipsec_test_flags *flags);\n+\n #endif\ndiff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst\nindex a7d0e53..1c6b846 100644\n--- a/doc/guides/rel_notes/release_22_03.rst\n+++ b/doc/guides/rel_notes/release_22_03.rst\n@@ -72,6 +72,7 @@ New Features\n   * Added tunnel mode fragment packet tests.\n   * Added security stats tests.\n   * Added AES-CTR tests.\n+  * Added set/copy DF tests.\n \n \n Removed Items\n",
    "prefixes": [
        "v2",
        "13/13"
    ]
}