get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 116820,
    "url": "http://patchwork.dpdk.org/api/patches/116820/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20220924135758.3402392-3-gakhil@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": "<20220924135758.3402392-3-gakhil@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220924135758.3402392-3-gakhil@marvell.com",
    "date": "2022-09-24T13:57:57",
    "name": "[v5,2/3] test/security: add inline IPsec SA soft expiry cases",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fb45a090448657df3f32d7deb8ccdb3b5333d629",
    "submitter": {
        "id": 2094,
        "url": "http://patchwork.dpdk.org/api/people/2094/?format=api",
        "name": "Akhil Goyal",
        "email": "gakhil@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/20220924135758.3402392-3-gakhil@marvell.com/mbox/",
    "series": [
        {
            "id": 24810,
            "url": "http://patchwork.dpdk.org/api/series/24810/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=24810",
            "date": "2022-09-24T13:57:55",
            "name": "Add and test IPsec SA expiry events",
            "version": 5,
            "mbox": "http://patchwork.dpdk.org/series/24810/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/116820/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/116820/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 3CFC6A0542;\n\tSat, 24 Sep 2022 15:58:23 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E405742C02;\n\tSat, 24 Sep 2022 15:58:22 +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 83A4D42BFD\n for <dev@dpdk.org>; Sat, 24 Sep 2022 15:58:21 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id\n 28ODV3J9017723;\n Sat, 24 Sep 2022 06:58:20 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3jsy8r0haf-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Sat, 24 Sep 2022 06:58:20 -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.2;\n Sat, 24 Sep 2022 06:58:19 -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.2 via Frontend\n Transport; Sat, 24 Sep 2022 06:58:19 -0700",
            "from localhost.localdomain (unknown [10.28.36.102])\n by maili.marvell.com (Postfix) with ESMTP id A2B013F70A8;\n Sat, 24 Sep 2022 06:58:15 -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=4qUpm3G+9OVbdTv9c6AsAZ3+NtsGLq8CgmJh3zsrXiE=;\n b=Ki8ELoO9frKq+6JnNdLJDPwVFp3nZo3cij2pj+vdS4j+HIKGxOtAzj7qE1khUqw6LW2o\n OsBn222Lcs5LYAJaM8yUX6ai0/e5G3Q9+az6TIZXGJRAEJXk3v1CGKMWYH8zMIbqiuD0\n IQ1Ynb7VN7xr6dDVZ97yblK4FNsg8habFs9sItRwaTv9hX8smO8T6bSQGWnGrKkcPNVe\n Km4cVEDMSFgwNuaS0r2EJgb6QwaihtxlEgYJFaBNQLtXZ64jBHjC9TL6Qkl7cBUF43+g\n NBfvPi6lvySCNj6BUWyW0rhoRNCHGeoVaTQRbxAhhicM7ObpUaoNNUDiGhyqXm41zXby qg==",
        "From": "Akhil Goyal <gakhil@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<thomas@monjalon.net>, <david.marchand@redhat.com>,\n <hemant.agrawal@nxp.com>, <vattunuru@marvell.com>,\n <ferruh.yigit@xilinx.com>, <andrew.rybchenko@oktetlabs.ru>,\n <konstantin.v.ananyev@yandex.ru>, <jerinj@marvell.com>,\n <adwivedi@marvell.com>, <anoobj@marvell.com>, <ndabilpuram@marvell.com>",
        "Subject": "[PATCH v5 2/3] test/security: add inline IPsec SA soft expiry cases",
        "Date": "Sat, 24 Sep 2022 19:27:57 +0530",
        "Message-ID": "<20220924135758.3402392-3-gakhil@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220924135758.3402392-1-gakhil@marvell.com>",
        "References": "<20220416192530.173895-8-gakhil@marvell.com>\n <20220924135758.3402392-1-gakhil@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "V_YZpXcygBdvMPSsmmpgQ5aT-6oqw-TE",
        "X-Proofpoint-ORIG-GUID": "V_YZpXcygBdvMPSsmmpgQ5aT-6oqw-TE",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1\n definitions=2022-09-24_06,2022-09-22_02,2022-06-22_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": "From: Vamsi Attunuru <vattunuru@marvell.com>\n\nPatch adds unit tests for packet & byte soft expiry events.\n\nSigned-off-by: Vamsi Attunuru <vattunuru@marvell.com>\n---\n app/test/test_cryptodev_security_ipsec.h      |   2 +\n app/test/test_security_inline_proto.c         | 105 +++++++++++++++++-\n app/test/test_security_inline_proto_vectors.h |   6 +\n 3 files changed, 112 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/app/test/test_cryptodev_security_ipsec.h b/app/test/test_cryptodev_security_ipsec.h\nindex 744dd64a9e..9a3c021dd8 100644\n--- a/app/test/test_cryptodev_security_ipsec.h\n+++ b/app/test/test_cryptodev_security_ipsec.h\n@@ -86,6 +86,8 @@ struct ipsec_test_flags {\n \tbool display_alg;\n \tbool sa_expiry_pkts_soft;\n \tbool sa_expiry_pkts_hard;\n+\tbool sa_expiry_bytes_soft;\n+\tbool sa_expiry_bytes_hard;\n \tbool icv_corrupt;\n \tbool iv_gen;\n \tuint32_t tunnel_hdr_verify;\ndiff --git a/app/test/test_security_inline_proto.c b/app/test/test_security_inline_proto.c\nindex 5f26a04b06..5747ee0990 100644\n--- a/app/test/test_security_inline_proto.c\n+++ b/app/test/test_security_inline_proto.c\n@@ -947,6 +947,62 @@ event_rx_burst(struct rte_mbuf **rx_pkts, uint16_t nb_pkts_to_rx)\n \treturn nb_rx;\n }\n \n+static int\n+test_ipsec_inline_sa_exp_event_callback(uint16_t port_id,\n+\t\tenum rte_eth_event_type type, void *param, void *ret_param)\n+{\n+\tstruct sa_expiry_vector *vector = (struct sa_expiry_vector *)param;\n+\tstruct rte_eth_event_ipsec_desc *event_desc = NULL;\n+\n+\tRTE_SET_USED(port_id);\n+\n+\tif (type != RTE_ETH_EVENT_IPSEC)\n+\t\treturn -1;\n+\n+\tevent_desc = ret_param;\n+\tif (event_desc == NULL) {\n+\t\tprintf(\"Event descriptor not set\\n\");\n+\t\treturn -1;\n+\t}\n+\tvector->notify_event = true;\n+\tif (event_desc->metadata != (uint64_t)vector->sa_data) {\n+\t\tprintf(\"Mismatch in event specific metadata\\n\");\n+\t\treturn -1;\n+\t}\n+\tif (event_desc->subtype == RTE_ETH_EVENT_IPSEC_SA_PKT_EXPIRY) {\n+\t\tvector->event = RTE_ETH_EVENT_IPSEC_SA_PKT_EXPIRY;\n+\t\treturn 0;\n+\t} else if (event_desc->subtype == RTE_ETH_EVENT_IPSEC_SA_BYTE_EXPIRY) {\n+\t\tvector->event = RTE_ETH_EVENT_IPSEC_SA_BYTE_EXPIRY;\n+\t\treturn 0;\n+\t} else if (event_desc->subtype >= RTE_ETH_EVENT_IPSEC_MAX) {\n+\t\tprintf(\"Invalid IPsec event reported\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\treturn -1;\n+}\n+\n+static enum rte_eth_event_ipsec_subtype\n+test_ipsec_inline_setup_expiry_vector(struct sa_expiry_vector *vector,\n+\t\tconst struct ipsec_test_flags *flags,\n+\t\tstruct ipsec_test_data *tdata)\n+{\n+\tenum rte_eth_event_ipsec_subtype event = RTE_ETH_EVENT_IPSEC_UNKNOWN;\n+\n+\tvector->event = RTE_ETH_EVENT_IPSEC_UNKNOWN;\n+\tvector->notify_event = false;\n+\tvector->sa_data = (void *)tdata;\n+\tif (flags->sa_expiry_pkts_soft)\n+\t\tevent = RTE_ETH_EVENT_IPSEC_SA_PKT_EXPIRY;\n+\telse\n+\t\tevent = RTE_ETH_EVENT_IPSEC_SA_BYTE_EXPIRY;\n+\trte_eth_dev_callback_register(port_id, RTE_ETH_EVENT_IPSEC,\n+\t\t       test_ipsec_inline_sa_exp_event_callback, vector);\n+\n+\treturn event;\n+}\n+\n static int\n test_ipsec_inline_proto_process(struct ipsec_test_data *td,\n \t\tstruct ipsec_test_data *res_d,\n@@ -954,10 +1010,12 @@ test_ipsec_inline_proto_process(struct ipsec_test_data *td,\n \t\tbool silent,\n \t\tconst struct ipsec_test_flags *flags)\n {\n+\tenum rte_eth_event_ipsec_subtype event = RTE_ETH_EVENT_IPSEC_UNKNOWN;\n \tstruct rte_security_session_conf sess_conf = {0};\n \tstruct rte_crypto_sym_xform cipher = {0};\n \tstruct rte_crypto_sym_xform auth = {0};\n \tstruct rte_crypto_sym_xform aead = {0};\n+\tstruct sa_expiry_vector vector = {0};\n \tstruct rte_security_session *ses;\n \tstruct rte_security_ctx *ctx;\n \tint nb_rx = 0, nb_sent;\n@@ -966,6 +1024,12 @@ test_ipsec_inline_proto_process(struct ipsec_test_data *td,\n \n \tmemset(rx_pkts_burst, 0, sizeof(rx_pkts_burst[0]) * nb_pkts);\n \n+\tif (flags->sa_expiry_pkts_soft || flags->sa_expiry_bytes_soft) {\n+\t\tif (td->ipsec_xform.direction == RTE_SECURITY_IPSEC_SA_DIR_INGRESS)\n+\t\t\treturn TEST_SUCCESS;\n+\t\tevent = test_ipsec_inline_setup_expiry_vector(&vector, flags, td);\n+\t}\n+\n \tif (td->aead) {\n \t\tsess_conf.crypto_xform = &aead;\n \t} else {\n@@ -1083,6 +1147,15 @@ test_ipsec_inline_proto_process(struct ipsec_test_data *td,\n out:\n \tif (td->ipsec_xform.direction == RTE_SECURITY_IPSEC_SA_DIR_INGRESS)\n \t\tdestroy_default_flow(port_id);\n+\tif (flags->sa_expiry_pkts_soft || flags->sa_expiry_bytes_soft) {\n+\t\tif (vector.notify_event && (vector.event == event))\n+\t\t\tret = TEST_SUCCESS;\n+\t\telse\n+\t\t\tret = TEST_FAILED;\n+\n+\t\trte_eth_dev_callback_unregister(port_id, RTE_ETH_EVENT_IPSEC,\n+\t\t\ttest_ipsec_inline_sa_exp_event_callback, &vector);\n+\t}\n \n \t/* Destroy session so that other cases can create the session again */\n \trte_security_session_destroy(ctx, ses);\n@@ -1100,6 +1173,7 @@ test_ipsec_inline_proto_all(const struct ipsec_test_flags *flags)\n \tint ret;\n \n \tif (flags->iv_gen || flags->sa_expiry_pkts_soft ||\n+\t\t\tflags->sa_expiry_bytes_soft ||\n \t\t\tflags->sa_expiry_pkts_hard)\n \t\tnb_pkts = IPSEC_TEST_PACKETS_MAX;\n \n@@ -1132,6 +1206,11 @@ test_ipsec_inline_proto_all(const struct ipsec_test_flags *flags)\n \t\tif (flags->udp_encap)\n \t\t\ttd_outb.ipsec_xform.options.udp_encap = 1;\n \n+\t\tif (flags->sa_expiry_bytes_soft)\n+\t\t\ttd_outb.ipsec_xform.life.bytes_soft_limit =\n+\t\t\t\t(((td_outb.output_text.len + RTE_ETHER_HDR_LEN)\n+\t\t\t\t  * nb_pkts) >> 3) - 1;\n+\n \t\tret = test_ipsec_inline_proto_process(&td_outb, &td_inb, nb_pkts,\n \t\t\t\t\t\tfalse, flags);\n \t\tif (ret == TEST_SKIPPED)\n@@ -2242,6 +2321,23 @@ test_ipsec_inline_proto_iv_gen(const void *data __rte_unused)\n \treturn test_ipsec_inline_proto_all(&flags);\n }\n \n+static int\n+test_ipsec_inline_proto_sa_pkt_soft_expiry(const void *data __rte_unused)\n+{\n+\tstruct ipsec_test_flags flags = {\n+\t\t.sa_expiry_pkts_soft = true\n+\t};\n+\treturn test_ipsec_inline_proto_all(&flags);\n+}\n+static int\n+test_ipsec_inline_proto_sa_byte_soft_expiry(const void *data __rte_unused)\n+{\n+\tstruct ipsec_test_flags flags = {\n+\t\t.sa_expiry_bytes_soft = true\n+\t};\n+\treturn test_ipsec_inline_proto_all(&flags);\n+}\n+\n static int\n test_ipsec_inline_proto_known_vec_fragmented(const void *test_data)\n {\n@@ -2644,7 +2740,14 @@ static struct unit_test_suite inline_ipsec_testsuite  = {\n \t\t\t\"IV generation\",\n \t\t\tut_setup_inline_ipsec, ut_teardown_inline_ipsec,\n \t\t\ttest_ipsec_inline_proto_iv_gen),\n-\n+\t\tTEST_CASE_NAMED_ST(\n+\t\t\t\"SA soft expiry with packet limit\",\n+\t\t\tut_setup_inline_ipsec, ut_teardown_inline_ipsec,\n+\t\t\ttest_ipsec_inline_proto_sa_pkt_soft_expiry),\n+\t\tTEST_CASE_NAMED_ST(\n+\t\t\t\"SA soft expiry with byte limit\",\n+\t\t\tut_setup_inline_ipsec, ut_teardown_inline_ipsec,\n+\t\t\ttest_ipsec_inline_proto_sa_byte_soft_expiry),\n \n \t\tTEST_CASE_NAMED_WITH_DATA(\n \t\t\t\"Antireplay with window size 1024\",\ndiff --git a/app/test/test_security_inline_proto_vectors.h b/app/test/test_security_inline_proto_vectors.h\nindex c18965d80f..003537e200 100644\n--- a/app/test/test_security_inline_proto_vectors.h\n+++ b/app/test/test_security_inline_proto_vectors.h\n@@ -36,6 +36,12 @@ struct reassembly_vector {\n \tbool burst;\n };\n \n+struct sa_expiry_vector {\n+\tstruct ipsec_session_data *sa_data;\n+\tenum rte_eth_event_ipsec_subtype event;\n+\tbool notify_event;\n+};\n+\n /* The source file includes below test vectors */\n /* IPv6:\n  *\n",
    "prefixes": [
        "v5",
        "2/3"
    ]
}