get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 127719,
    "url": "http://patchwork.dpdk.org/api/patches/127719/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230530100158.1428-18-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": "<20230530100158.1428-18-anoobj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230530100158.1428-18-anoobj@marvell.com",
    "date": "2023-05-30T10:01:54",
    "name": "[v6,17/21] test/pdcp: add timer expiry cases",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "971d8da0389e2b80b32824a78550a0196e18a2f4",
    "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/20230530100158.1428-18-anoobj@marvell.com/mbox/",
    "series": [
        {
            "id": 28249,
            "url": "http://patchwork.dpdk.org/api/series/28249/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28249",
            "date": "2023-05-30T10:01:37",
            "name": "lib: add pdcp protocol",
            "version": 6,
            "mbox": "http://patchwork.dpdk.org/series/28249/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/127719/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/127719/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 9418542BE2;\n\tTue, 30 May 2023 12:04:08 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C715042D77;\n\tTue, 30 May 2023 12:03:19 +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 870CB42D86\n for <dev@dpdk.org>; Tue, 30 May 2023 12:03:18 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 34U5sW1T031143; Tue, 30 May 2023 03:03:17 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3quhcm7u0e-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Tue, 30 May 2023 03:03:17 -0700",
            "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.48;\n Tue, 30 May 2023 03:03:15 -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.48 via Frontend\n Transport; Tue, 30 May 2023 03:03:15 -0700",
            "from BG-LT92004.corp.innovium.com (unknown [10.193.69.246])\n by maili.marvell.com (Postfix) with ESMTP id 8A9F03F705D;\n Tue, 30 May 2023 03:03:11 -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=WJNby13sYf/+VUXkv5KVS+q+8vVWgsGrJ1iHOPr0OGU=;\n b=Ma3T9SG7QVj+Pk+b/g1DevP7x2pRGLlsrK1HEYhuys6dFweLotnsMs3q3SEO0GkIDGZH\n z6dtYtuCJeBZD6estQSprsnXX2P5lElCx48RRcPJMr6QELWsYqERc8zeUUJvjbFisxu0\n oQakCLiAZkBROSt09hdDgA9ULrCBdzECts0SzxsSfBFmyxXAbIZYDIVCi3UsQ6jKCM6O\n rIqCu9Obxu1zvqu/lAynC0BhvXun8yYKUSLtOk3NrQBuX1d53m3DSZdcsZpAxTO/dd8y\n 32XKMHg9AggaM1cm2Toc/RYgQJSx6AjD0mqVb6jZG8QqSar5U0JjaI8IpwTbUfguU0GJ ug==",
        "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>",
        "CC": "Volodymyr Fialko <vfialko@marvell.com>,\n 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>, <dev@dpdk.org>,\n Olivier Matz <olivier.matz@6wind.com>,\n Stephen Hemminger <stephen@networkplumber.org>",
        "Subject": "[PATCH v6 17/21] test/pdcp: add timer expiry cases",
        "Date": "Tue, 30 May 2023 15:31:54 +0530",
        "Message-ID": "<20230530100158.1428-18-anoobj@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230530100158.1428-1-anoobj@marvell.com>",
        "References": "<20230527085910.972-1-anoobj@marvell.com>\n <20230530100158.1428-1-anoobj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "dS077jN3avTnLbpCkx4x2RfmgjGY1ift",
        "X-Proofpoint-ORIG-GUID": "dS077jN3avTnLbpCkx4x2RfmgjGY1ift",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26\n definitions=2023-05-30_06,2023-05-29_02,2023-05-22_02",
        "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: Volodymyr Fialko <vfialko@marvell.com>\n\nAdd test cases for handling the expiry with rte_timer and rte_event_timer.\n\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\nSigned-off-by: Volodymyr Fialko <vfialko@marvell.com>\n---\n app/test/test_pdcp.c | 350 +++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 350 insertions(+)",
    "diff": "diff --git a/app/test/test_pdcp.c b/app/test/test_pdcp.c\nindex 24d7826bc2..25729b2bdd 100644\n--- a/app/test/test_pdcp.c\n+++ b/app/test/test_pdcp.c\n@@ -3,15 +3,24 @@\n  */\n \n #include <rte_errno.h>\n+#ifdef RTE_LIB_EVENTDEV\n+#include <rte_eventdev.h>\n+#include <rte_event_timer_adapter.h>\n+#endif /* RTE_LIB_EVENTDEV */\n #include <rte_malloc.h>\n #include <rte_pdcp.h>\n #include <rte_pdcp_hdr.h>\n+#include <rte_timer.h>\n \n #include \"test.h\"\n #include \"test_cryptodev.h\"\n #include \"test_cryptodev_security_pdcp_test_vectors.h\"\n \n+#define NSECPERSEC 1E9\n #define NB_DESC 1024\n+#define TIMER_ADAPTER_ID 0\n+#define TEST_EV_QUEUE_ID 0\n+#define TEST_EV_PORT_ID 0\n #define CDEV_INVALID_ID UINT8_MAX\n #define NB_TESTS RTE_DIM(pdcp_test_params)\n #define PDCP_IV_LEN 16\n@@ -33,10 +42,21 @@ struct pdcp_testsuite_params {\n \tstruct rte_mempool *cop_pool;\n \tstruct rte_mempool *sess_pool;\n \tbool cdevs_used[RTE_CRYPTO_MAX_DEVS];\n+\tint evdev;\n+#ifdef RTE_LIB_EVENTDEV\n+\tstruct rte_event_timer_adapter *timdev;\n+#endif /* RTE_LIB_EVENTDEV */\n+\tbool timer_is_running;\n+\tuint64_t min_resolution_ns;\n };\n \n static struct pdcp_testsuite_params testsuite_params;\n \n+struct test_rte_timer_args {\n+\tint status;\n+\tstruct rte_pdcp_entity *pdcp_entity;\n+};\n+\n struct pdcp_test_conf {\n \tstruct rte_pdcp_entity_conf entity;\n \tstruct rte_crypto_sym_xform c_xfrm;\n@@ -124,6 +144,30 @@ pdcp_hfn_from_count_get(uint32_t count, enum rte_security_pdcp_sn_size sn_size)\n \treturn (count & pdcp_hfn_mask_get(sn_size)) >> sn_size;\n }\n \n+static void\n+pdcp_timer_start_cb(void *timer, void *args)\n+{\n+\tbool *is_timer_running = timer;\n+\n+\tRTE_SET_USED(args);\n+\t*is_timer_running = true;\n+}\n+\n+static void\n+pdcp_timer_stop_cb(void *timer, void *args)\n+{\n+\tbool *is_timer_running = timer;\n+\n+\tRTE_SET_USED(args);\n+\t*is_timer_running = false;\n+}\n+\n+static struct rte_pdcp_t_reordering t_reorder_timer = {\n+\t.timer = &testsuite_params.timer_is_running,\n+\t.start = pdcp_timer_start_cb,\n+\t.stop = pdcp_timer_stop_cb,\n+};\n+\n static inline int\n pdcp_hdr_size_get(enum rte_security_pdcp_sn_size sn_size)\n {\n@@ -462,6 +506,7 @@ create_test_conf_from_index(const int index, struct pdcp_test_conf *conf)\n \tconf->entity.pdcp_xfrm.en_ordering = 0;\n \tconf->entity.pdcp_xfrm.remove_duplicates = 0;\n \tconf->entity.pdcp_xfrm.domain = pdcp_test_params[index].domain;\n+\tconf->entity.t_reordering = t_reorder_timer;\n \n \tif (pdcp_test_packet_direction[index] == PDCP_DIR_UPLINK)\n \t\tconf->entity.pdcp_xfrm.pkt_dir = RTE_SECURITY_PDCP_UPLINK;\n@@ -1048,6 +1093,8 @@ test_reorder_gap_fill(struct pdcp_test_conf *ul_conf)\n \t/* Check that packets in correct order */\n \tASSERT_TRUE_OR_GOTO(array_asc_sorted_check(out_mb, nb_success, sn_size), exit,\n \t\t\t\"Error occurred during packet drain\\n\");\n+\tASSERT_TRUE_OR_GOTO(testsuite_params.timer_is_running == false, exit,\n+\t\t\t\"Timer should be stopped after full drain\\n\");\n \n \tret = TEST_SUCCESS;\n exit:\n@@ -1123,6 +1170,181 @@ test_reorder_buffer_full_window_size_sn_12(const struct pdcp_test_conf *ul_conf)\n \treturn ret;\n }\n \n+#ifdef RTE_LIB_EVENTDEV\n+static void\n+event_timer_start_cb(void *timer, void *args)\n+{\n+\tstruct rte_event_timer *evtims = args;\n+\tint ret = 0;\n+\n+\tret = rte_event_timer_arm_burst(timer, &evtims, 1);\n+\tassert(ret == 1);\n+}\n+#endif /* RTE_LIB_EVENTDEV */\n+\n+static int\n+test_expiry_with_event_timer(const struct pdcp_test_conf *ul_conf)\n+{\n+#ifdef RTE_LIB_EVENTDEV\n+\tconst enum rte_security_pdcp_sn_size sn_size = ul_conf->entity.pdcp_xfrm.sn_size;\n+\tstruct rte_mbuf *m1 = NULL, *out_mb[1] = {0};\n+\tuint16_t n = 0, nb_err = 0, nb_try = 5;\n+\tstruct rte_pdcp_entity *pdcp_entity;\n+\tstruct pdcp_test_conf dl_conf;\n+\tint ret = TEST_FAILED, nb_out;\n+\tstruct rte_event event;\n+\n+\tconst int start_count = 0;\n+\tstruct rte_event_timer evtim = {\n+\t\t.ev.op = RTE_EVENT_OP_NEW,\n+\t\t.ev.queue_id = TEST_EV_QUEUE_ID,\n+\t\t.ev.sched_type = RTE_SCHED_TYPE_ATOMIC,\n+\t\t.ev.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,\n+\t\t.ev.event_type =  RTE_EVENT_TYPE_TIMER,\n+\t\t.state = RTE_EVENT_TIMER_NOT_ARMED,\n+\t\t.timeout_ticks = 1,\n+\t};\n+\n+\tif (ul_conf->entity.pdcp_xfrm.pkt_dir == RTE_SECURITY_PDCP_DOWNLINK)\n+\t\treturn TEST_SKIPPED;\n+\n+\t/* Create configuration for actual testing */\n+\tuplink_to_downlink_convert(ul_conf, &dl_conf);\n+\tdl_conf.entity.pdcp_xfrm.hfn = pdcp_hfn_from_count_get(start_count, sn_size);\n+\tdl_conf.entity.sn = pdcp_sn_from_count_get(start_count, sn_size);\n+\tdl_conf.entity.t_reordering.args = &evtim;\n+\tdl_conf.entity.t_reordering.timer = testsuite_params.timdev;\n+\tdl_conf.entity.t_reordering.start = event_timer_start_cb;\n+\n+\tpdcp_entity = test_entity_create(&dl_conf, &ret);\n+\tif (pdcp_entity == NULL)\n+\t\treturn ret;\n+\n+\tevtim.ev.event_ptr = pdcp_entity;\n+\n+\t/* Send packet with SN > RX_DELIV to create a gap */\n+\tm1 = generate_packet_for_dl_with_sn(*ul_conf, start_count + 1);\n+\tASSERT_TRUE_OR_GOTO(m1 != NULL, exit, \"Could not allocate buffer for packet\\n\");\n+\n+\t/* Buffered packets after insert [NULL, m1] */\n+\tn = test_process_packets(pdcp_entity, dl_conf.entity.dev_id, &m1, 1, out_mb, &nb_err);\n+\tASSERT_TRUE_OR_GOTO(nb_err == 0, exit, \"Error occurred during packet buffering\\n\");\n+\tASSERT_TRUE_OR_GOTO(n == 0, exit, \"Packet was not buffered as expected\\n\");\n+\n+\tm1 = NULL; /* Packet was moved to PDCP lib */\n+\n+\tn = rte_event_dequeue_burst(testsuite_params.evdev, TEST_EV_PORT_ID, &event, 1, 0);\n+\twhile (n != 1) {\n+\t\trte_delay_us(testsuite_params.min_resolution_ns / 1000);\n+\t\tn = rte_event_dequeue_burst(testsuite_params.evdev, TEST_EV_PORT_ID, &event, 1, 0);\n+\t\tASSERT_TRUE_OR_GOTO(nb_try-- > 0, exit,\n+\t\t\t\t\"Dequeued unexpected timer expiry event: %i\\n\", n);\n+\t}\n+\n+\tASSERT_TRUE_OR_GOTO(event.event_type == RTE_EVENT_TYPE_TIMER, exit, \"Unexpected event type\\n\");\n+\n+\t/* Handle expiry event */\n+\tn = rte_pdcp_t_reordering_expiry_handle(event.event_ptr, out_mb);\n+\tASSERT_TRUE_OR_GOTO(n == 1, exit, \"Unexpected number of expired packets :%i\\n\", n);\n+\n+\tret = TEST_SUCCESS;\n+exit:\n+\trte_pktmbuf_free(m1);\n+\trte_pktmbuf_free_bulk(out_mb, n);\n+\tnb_out = rte_pdcp_entity_release(pdcp_entity, out_mb);\n+\trte_pktmbuf_free_bulk(out_mb, nb_out);\n+\treturn ret;\n+#else\n+\tRTE_SET_USED(ul_conf);\n+\treturn TEST_SKIPPED;\n+#endif /* RTE_LIB_EVENTDEV */\n+}\n+\n+static void\n+test_rte_timer_expiry_handle(struct rte_timer *timer_handle, void *arg)\n+{\n+\tstruct test_rte_timer_args *timer_data = arg;\n+\tstruct rte_mbuf *out_mb[1] = {0};\n+\tuint16_t n;\n+\n+\tRTE_SET_USED(timer_handle);\n+\n+\tn = rte_pdcp_t_reordering_expiry_handle(timer_data->pdcp_entity, out_mb);\n+\trte_pktmbuf_free_bulk(out_mb, n);\n+\n+\ttimer_data->status =  n == 1 ? n : -1;\n+}\n+\n+static void\n+test_rte_timer_start_cb(void *timer, void *args)\n+{\n+\trte_timer_reset_sync(timer, 1, SINGLE, rte_lcore_id(), test_rte_timer_expiry_handle, args);\n+}\n+\n+static int\n+test_expiry_with_rte_timer(const struct pdcp_test_conf *ul_conf)\n+{\n+\tconst enum rte_security_pdcp_sn_size sn_size = ul_conf->entity.pdcp_xfrm.sn_size;\n+\tstruct rte_mbuf *m1 = NULL, *out_mb[1] = {0};\n+\tuint16_t n = 0, nb_err = 0, nb_try = 5;\n+\tstruct test_rte_timer_args timer_args;\n+\tstruct rte_pdcp_entity *pdcp_entity;\n+\tstruct pdcp_test_conf dl_conf;\n+\tint ret = TEST_FAILED, nb_out;\n+\tstruct rte_timer timer = {0};\n+\n+\tconst int start_count = 0;\n+\n+\tif (ul_conf->entity.pdcp_xfrm.pkt_dir == RTE_SECURITY_PDCP_DOWNLINK)\n+\t\treturn TEST_SKIPPED;\n+\n+\t/* Set up a timer */\n+\trte_timer_init(&timer);\n+\n+\t/* Create configuration for actual testing */\n+\tuplink_to_downlink_convert(ul_conf, &dl_conf);\n+\tdl_conf.entity.pdcp_xfrm.hfn = pdcp_hfn_from_count_get(start_count, sn_size);\n+\tdl_conf.entity.sn = pdcp_sn_from_count_get(start_count, sn_size);\n+\tdl_conf.entity.t_reordering.args = &timer_args;\n+\tdl_conf.entity.t_reordering.timer = &timer;\n+\tdl_conf.entity.t_reordering.start = test_rte_timer_start_cb;\n+\n+\tpdcp_entity = test_entity_create(&dl_conf, &ret);\n+\tif (pdcp_entity == NULL)\n+\t\treturn ret;\n+\n+\ttimer_args.status = 0;\n+\ttimer_args.pdcp_entity = pdcp_entity;\n+\n+\t/* Send packet with SN > RX_DELIV to create a gap */\n+\tm1 = generate_packet_for_dl_with_sn(*ul_conf, start_count + 1);\n+\tASSERT_TRUE_OR_GOTO(m1 != NULL, exit, \"Could not allocate buffer for packet\\n\");\n+\n+\t/* Buffered packets after insert [NULL, m1] */\n+\tn = test_process_packets(pdcp_entity, dl_conf.entity.dev_id, &m1, 1, out_mb, &nb_err);\n+\tASSERT_TRUE_OR_GOTO(nb_err == 0, exit, \"Error occurred during packet buffering\\n\");\n+\tASSERT_TRUE_OR_GOTO(n == 0, exit, \"Packet was not buffered as expected\\n\");\n+\n+\tm1 = NULL; /* Packet was moved to PDCP lib */\n+\n+\t/* Verify that expire was handled correctly */\n+\trte_timer_manage();\n+\twhile (timer_args.status != 1) {\n+\t\trte_delay_us(1);\n+\t\trte_timer_manage();\n+\t\tASSERT_TRUE_OR_GOTO(nb_try-- > 0, exit, \"Bad expire handle status %i\\n\",\n+\t\t\ttimer_args.status);\n+\t}\n+\n+\tret = TEST_SUCCESS;\n+exit:\n+\trte_pktmbuf_free(m1);\n+\trte_pktmbuf_free_bulk(out_mb, n);\n+\tnb_out = rte_pdcp_entity_release(pdcp_entity, out_mb);\n+\trte_pktmbuf_free_bulk(out_mb, nb_out);\n+\treturn ret;\n+}\n+\n static int\n test_combined(struct pdcp_test_conf *ul_conf)\n {\n@@ -1145,6 +1367,126 @@ test_combined(struct pdcp_test_conf *ul_conf)\n \treturn ret;\n }\n \n+#ifdef RTE_LIB_EVENTDEV\n+static inline void\n+eventdev_conf_default_set(struct rte_event_dev_config *dev_conf, struct rte_event_dev_info *info)\n+{\n+\tmemset(dev_conf, 0, sizeof(struct rte_event_dev_config));\n+\tdev_conf->dequeue_timeout_ns = info->min_dequeue_timeout_ns;\n+\tdev_conf->nb_event_ports = 1;\n+\tdev_conf->nb_event_queues = 1;\n+\tdev_conf->nb_event_queue_flows = info->max_event_queue_flows;\n+\tdev_conf->nb_event_port_dequeue_depth = info->max_event_port_dequeue_depth;\n+\tdev_conf->nb_event_port_enqueue_depth = info->max_event_port_enqueue_depth;\n+\tdev_conf->nb_event_port_enqueue_depth = info->max_event_port_enqueue_depth;\n+\tdev_conf->nb_events_limit = info->max_num_events;\n+}\n+\n+static inline int\n+eventdev_setup(void)\n+{\n+\tstruct rte_event_dev_config dev_conf;\n+\tstruct rte_event_dev_info info;\n+\tint ret, evdev = 0;\n+\n+\tif (!rte_event_dev_count())\n+\t\treturn TEST_SKIPPED;\n+\n+\tret = rte_event_dev_info_get(evdev, &info);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get event dev info\");\n+\tTEST_ASSERT(info.max_num_events < 0 || info.max_num_events >= 1,\n+\t\t\t\"ERROR max_num_events=%d < max_events=%d\", info.max_num_events, 1);\n+\n+\teventdev_conf_default_set(&dev_conf, &info);\n+\tret = rte_event_dev_configure(evdev, &dev_conf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to configure eventdev\");\n+\n+\tret = rte_event_queue_setup(evdev, TEST_EV_QUEUE_ID, NULL);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup queue=%d\", TEST_EV_QUEUE_ID);\n+\n+\t/* Configure event port */\n+\tret = rte_event_port_setup(evdev, TEST_EV_PORT_ID, NULL);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup port=%d\", TEST_EV_PORT_ID);\n+\tret = rte_event_port_link(evdev, TEST_EV_PORT_ID, NULL, NULL, 0);\n+\tTEST_ASSERT(ret >= 0, \"Failed to link all queues port=%d\", TEST_EV_PORT_ID);\n+\n+\tret = rte_event_dev_start(evdev);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to start device\");\n+\n+\ttestsuite_params.evdev = evdev;\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+event_timer_setup(void)\n+{\n+\tstruct rte_event_timer_adapter_info info;\n+\tstruct rte_event_timer_adapter *timdev;\n+\tuint32_t caps = 0;\n+\n+\tstruct rte_event_timer_adapter_conf config = {\n+\t\t.event_dev_id = testsuite_params.evdev,\n+\t\t.timer_adapter_id = TIMER_ADAPTER_ID,\n+\t\t.timer_tick_ns = NSECPERSEC,\n+\t\t.max_tmo_ns = 10 * NSECPERSEC,\n+\t\t.nb_timers = 10,\n+\t\t.flags = 0,\n+\t};\n+\n+\tTEST_ASSERT_SUCCESS(rte_event_timer_adapter_caps_get(testsuite_params.evdev, &caps),\n+\t\t\t\t\"Failed to get adapter capabilities\");\n+\n+\tif (!(caps & RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT))\n+\t\treturn TEST_SKIPPED;\n+\n+\ttimdev = rte_event_timer_adapter_create(&config);\n+\n+\tTEST_ASSERT_NOT_NULL(timdev, \"Failed to create event timer ring\");\n+\n+\ttestsuite_params.timdev = timdev;\n+\n+\tTEST_ASSERT_EQUAL(rte_event_timer_adapter_start(timdev), 0,\n+\t\t\t\"Failed to start event timer adapter\");\n+\n+\trte_event_timer_adapter_get_info(timdev, &info);\n+\ttestsuite_params.min_resolution_ns = info.min_resolution_ns;\n+\n+\treturn TEST_SUCCESS;\n+}\n+#endif /* RTE_LIB_EVENTDEV */\n+\n+static int\n+ut_setup_pdcp_event_timer(void)\n+{\n+#ifdef RTE_LIB_EVENTDEV\n+\tint ret;\n+\n+\tret = eventdev_setup();\n+\tif (ret)\n+\t\treturn ret;\n+\n+\treturn event_timer_setup();\n+#else\n+\treturn TEST_SKIPPED;\n+#endif /* RTE_LIB_EVENTDEV */\n+}\n+\n+static void\n+ut_teardown_pdcp_event_timer(void)\n+{\n+#ifdef RTE_LIB_EVENTDEV\n+\tstruct rte_event_timer_adapter *timdev = testsuite_params.timdev;\n+\tint evdev = testsuite_params.evdev;\n+\n+\trte_event_dev_stop(evdev);\n+\trte_event_dev_close(evdev);\n+\n+\trte_event_timer_adapter_stop(timdev);\n+\trte_event_timer_adapter_free(timdev);\n+#endif /* RTE_LIB_EVENTDEV */\n+}\n+\n static int\n run_test_for_one_known_vec(const void *arg)\n {\n@@ -1189,6 +1531,14 @@ static struct unit_test_suite reorder_test_cases  = {\n \t\t\tut_setup_pdcp, ut_teardown_pdcp,\n \t\t\trun_test_with_all_known_vec_until_first_pass,\n \t\t\ttest_reorder_buffer_full_window_size_sn_12),\n+\t\tTEST_CASE_NAMED_WITH_DATA(\"test_expire_with_event_timer\",\n+\t\t\tut_setup_pdcp_event_timer, ut_teardown_pdcp_event_timer,\n+\t\t\trun_test_with_all_known_vec_until_first_pass,\n+\t\t\ttest_expiry_with_event_timer),\n+\t\tTEST_CASE_NAMED_WITH_DATA(\"test_expire_with_rte_timer\",\n+\t\t\tut_setup_pdcp, ut_teardown_pdcp,\n+\t\t\trun_test_with_all_known_vec_until_first_pass,\n+\t\t\ttest_expiry_with_rte_timer),\n \t\tTEST_CASES_END() /**< NULL terminate unit test array */\n \t}\n };\n",
    "prefixes": [
        "v6",
        "17/21"
    ]
}