get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 105300,
    "url": "http://patchwork.dpdk.org/api/patches/105300/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/5b7dadb222f6eb018c74983750052543eb5f0d8e.1640076426.git.sthotton@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": "<5b7dadb222f6eb018c74983750052543eb5f0d8e.1640076426.git.sthotton@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/5b7dadb222f6eb018c74983750052543eb5f0d8e.1640076426.git.sthotton@marvell.com",
    "date": "2021-12-21T08:51:10",
    "name": "[v2] app/eventdev: add crypto producer mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1f6ada6e6bb406ad7b310d2ab87cd6cfe11da76b",
    "submitter": {
        "id": 2049,
        "url": "http://patchwork.dpdk.org/api/people/2049/?format=api",
        "name": "Shijith Thotton",
        "email": "sthotton@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patchwork.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/5b7dadb222f6eb018c74983750052543eb5f0d8e.1640076426.git.sthotton@marvell.com/mbox/",
    "series": [
        {
            "id": 20993,
            "url": "http://patchwork.dpdk.org/api/series/20993/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20993",
            "date": "2021-12-21T08:51:10",
            "name": "[v2] app/eventdev: add crypto producer mode",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/20993/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/105300/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/105300/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 876B0A034C;\n\tTue, 21 Dec 2021 09:51:29 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5043F40040;\n\tTue, 21 Dec 2021 09:51:29 +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 1CB1A4003C\n for <dev@dpdk.org>; Tue, 21 Dec 2021 09:51:26 +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 1BL7sSLu030179;\n Tue, 21 Dec 2021 00:51:26 -0800",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3d3axsg713-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Tue, 21 Dec 2021 00:51:26 -0800",
            "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.18;\n Tue, 21 Dec 2021 00:51:24 -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; Tue, 21 Dec 2021 00:51:24 -0800",
            "from localhost.localdomain (unknown [10.28.34.29])\n by maili.marvell.com (Postfix) with ESMTP id B87AF3F7067;\n Tue, 21 Dec 2021 00:51:21 -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=FCSUUYJpCPfF1pzSCBCujeAu7qlbkCxAsMMpn5UlqVA=;\n b=d6nbUuE1yH6dX3SwJJJTinngMl5y0J1MIbM8UJghL4OhkmAbagPJTgDsjqbb3aHx88wU\n AqOxChnKfbOB9Om7MH+psnKb+WBTdi00tReRlH/fUwiM9iyj6PFO+y9/YAluGtvDXfW9\n s39gQGfqlYxn1/sQhYYZQDGv0Z5JxMv81LxFJ78Ub8B3u8ZaeRsJ6wysC4W6GybzLeB7\n EqOGhri2SsOphdK35rVHFosZ61Eo/1CsYHKCDyv2cJrU7h3CMA+MRynsaSNisEgtRTL5\n a5sXmmc6lZ5rpuNJzVlRwQWVdCzH3J4MiH6ZmC9ca7135hmdTzV13Qwg0vgMvIf64x5x NA==",
        "From": "Shijith Thotton <sthotton@marvell.com>",
        "To": "<dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>",
        "CC": "Shijith Thotton <sthotton@marvell.com>, <anoobj@marvell.com>,\n <pbhagavatula@marvell.com>, <gakhil@marvell.com>,\n <abhinandan.gujjar@intel.com>",
        "Subject": "[PATCH v2] app/eventdev: add crypto producer mode",
        "Date": "Tue, 21 Dec 2021 14:21:10 +0530",
        "Message-ID": "\n <5b7dadb222f6eb018c74983750052543eb5f0d8e.1640076426.git.sthotton@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "\n <83932e16cff802f4701832c1798e31ec15b028f8.1640029478.git.sthotton@marvell.com>",
        "References": "\n <83932e16cff802f4701832c1798e31ec15b028f8.1640029478.git.sthotton@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "fDLJaePLzwq4H4t5SWR0aUwdoPguJcws",
        "X-Proofpoint-GUID": "fDLJaePLzwq4H4t5SWR0aUwdoPguJcws",
        "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-21_03,2021-12-21_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": "In crypto producer mode, producer core enqueues cryptodev with software\ngenerated crypto ops and worker core dequeues crypto completion events\nfrom the eventdev. Event crypto metadata used for above processing is\npre-populated in each crypto session.\n\nParameter --prod_type_cryptodev can be used to enable crypto producer\nmode. Parameter --crypto_adptr_mode can be set to select the crypto\nadapter mode, 0 for OP_NEW and 1 for OP_FORWARD.\n\nThis mode can be used to measure the performance of crypto adapter.\n\nExample:\n  ./dpdk-test-eventdev -l 0-2 -w <EVENTDEV> -w <CRYPTODEV> -- \\\n  --prod_type_cryptodev --crypto_adptr_mode 1 --test=perf_atq \\\n  --stlist=a --wlcores 1 --plcores 2\n\nSigned-off-by: Shijith Thotton <sthotton@marvell.com>\n---\nv2:\n* Fix RHEL compilation warning.\n\n app/test-eventdev/evt_common.h       |   3 +\n app/test-eventdev/evt_main.c         |  13 +-\n app/test-eventdev/evt_options.c      |  27 ++\n app/test-eventdev/evt_options.h      |  12 +\n app/test-eventdev/evt_test.h         |   6 +\n app/test-eventdev/test_perf_atq.c    |  51 ++++\n app/test-eventdev/test_perf_common.c | 406 ++++++++++++++++++++++++++-\n app/test-eventdev/test_perf_common.h |  16 ++\n app/test-eventdev/test_perf_queue.c  |  52 ++++\n doc/guides/tools/testeventdev.rst    |  13 +\n 10 files changed, 592 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h\nindex f466434459..2f301a7e79 100644\n--- a/app/test-eventdev/evt_common.h\n+++ b/app/test-eventdev/evt_common.h\n@@ -7,6 +7,7 @@\n \n #include <rte_common.h>\n #include <rte_debug.h>\n+#include <rte_event_crypto_adapter.h>\n #include <rte_eventdev.h>\n #include <rte_service.h>\n \n@@ -39,6 +40,7 @@ enum evt_prod_type {\n \tEVT_PROD_TYPE_SYNT,          /* Producer type Synthetic i.e. CPU. */\n \tEVT_PROD_TYPE_ETH_RX_ADPTR,  /* Producer type Eth Rx Adapter. */\n \tEVT_PROD_TYPE_EVENT_TIMER_ADPTR,  /* Producer type Timer Adapter. */\n+\tEVT_PROD_TYPE_EVENT_CRYPTO_ADPTR,  /* Producer type Crypto Adapter. */\n \tEVT_PROD_TYPE_MAX,\n };\n \n@@ -77,6 +79,7 @@ struct evt_options {\n \tuint64_t timer_tick_nsec;\n \tuint64_t optm_timer_tick_nsec;\n \tenum evt_prod_type prod_type;\n+\tenum rte_event_crypto_adapter_mode crypto_adptr_mode;\n };\n \n static inline bool\ndiff --git a/app/test-eventdev/evt_main.c b/app/test-eventdev/evt_main.c\nindex 194c980c7a..cef0fb1382 100644\n--- a/app/test-eventdev/evt_main.c\n+++ b/app/test-eventdev/evt_main.c\n@@ -161,12 +161,19 @@ main(int argc, char **argv)\n \t\t\tgoto mempool_destroy;\n \t\t}\n \t}\n+\t/* Test specific cryptodev setup */\n+\tif (test->ops.cryptodev_setup) {\n+\t\tif (test->ops.cryptodev_setup(test, &opt)) {\n+\t\t\tevt_err(\"%s: cryptodev setup failed\", opt.test_name);\n+\t\t\tgoto ethdev_destroy;\n+\t\t}\n+\t}\n \n \t/* Test specific eventdev setup */\n \tif (test->ops.eventdev_setup) {\n \t\tif (test->ops.eventdev_setup(test, &opt)) {\n \t\t\tevt_err(\"%s: eventdev setup failed\", opt.test_name);\n-\t\t\tgoto ethdev_destroy;\n+\t\t\tgoto cryptodev_destroy;\n \t\t}\n \t}\n \n@@ -197,6 +204,10 @@ main(int argc, char **argv)\n \tif (test->ops.eventdev_destroy)\n \t\ttest->ops.eventdev_destroy(test, &opt);\n \n+cryptodev_destroy:\n+\tif (test->ops.cryptodev_destroy)\n+\t\ttest->ops.cryptodev_destroy(test, &opt);\n+\n ethdev_destroy:\n \tif (test->ops.ethdev_destroy)\n \t\ttest->ops.ethdev_destroy(test, &opt);\ndiff --git a/app/test-eventdev/evt_options.c b/app/test-eventdev/evt_options.c\nindex 753a7dbd7d..5ad1491020 100644\n--- a/app/test-eventdev/evt_options.c\n+++ b/app/test-eventdev/evt_options.c\n@@ -122,6 +122,26 @@ evt_parse_timer_prod_type_burst(struct evt_options *opt,\n \treturn 0;\n }\n \n+static int\n+evt_parse_crypto_prod_type(struct evt_options *opt,\n+\t\t\t   const char *arg __rte_unused)\n+{\n+\topt->prod_type = EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR;\n+\treturn 0;\n+}\n+\n+static int\n+evt_parse_crypto_adptr_mode(struct evt_options *opt, const char *arg)\n+{\n+\tuint8_t mode;\n+\tint ret;\n+\n+\tret = parser_read_uint8(&mode, arg);\n+\topt->crypto_adptr_mode = mode ? RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD :\n+\t\t\t\t\tRTE_EVENT_CRYPTO_ADAPTER_OP_NEW;\n+\treturn ret;\n+}\n+\n static int\n evt_parse_test_name(struct evt_options *opt, const char *arg)\n {\n@@ -335,6 +355,7 @@ usage(char *program)\n \t\t\"\\t--queue_priority   : enable queue priority\\n\"\n \t\t\"\\t--deq_tmo_nsec     : global dequeue timeout\\n\"\n \t\t\"\\t--prod_type_ethdev : use ethernet device as producer.\\n\"\n+\t\t\"\\t--prod_type_cryptodev : use crypto device as producer.\\n\"\n \t\t\"\\t--prod_type_timerdev : use event timer device as producer.\\n\"\n \t\t\"\\t                     expity_nsec would be the timeout\\n\"\n \t\t\"\\t                     in ns.\\n\"\n@@ -345,6 +366,8 @@ usage(char *program)\n \t\t\"\\t--timer_tick_nsec  : timer tick interval in ns.\\n\"\n \t\t\"\\t--max_tmo_nsec     : max timeout interval in ns.\\n\"\n \t\t\"\\t--expiry_nsec      : event timer expiry ns.\\n\"\n+\t\t\"\\t--crypto_adptr_mode : 0 for OP_NEW mode (default) and\\n\"\n+\t\t\"\\t                      1 for OP_FORWARD mode.\\n\"\n \t\t\"\\t--mbuf_sz          : packet mbuf size.\\n\"\n \t\t\"\\t--max_pkt_sz       : max packet size.\\n\"\n \t\t\"\\t--prod_enq_burst_sz : producer enqueue burst size.\\n\"\n@@ -415,8 +438,10 @@ static struct option lgopts[] = {\n \t{ EVT_QUEUE_PRIORITY,      0, 0, 0 },\n \t{ EVT_DEQ_TMO_NSEC,        1, 0, 0 },\n \t{ EVT_PROD_ETHDEV,         0, 0, 0 },\n+\t{ EVT_PROD_CRYPTODEV,      0, 0, 0 },\n \t{ EVT_PROD_TIMERDEV,       0, 0, 0 },\n \t{ EVT_PROD_TIMERDEV_BURST, 0, 0, 0 },\n+\t{ EVT_CRYPTO_ADPTR_MODE,   1, 0, 0 },\n \t{ EVT_NB_TIMERS,           1, 0, 0 },\n \t{ EVT_NB_TIMER_ADPTRS,     1, 0, 0 },\n \t{ EVT_TIMER_TICK_NSEC,     1, 0, 0 },\n@@ -455,8 +480,10 @@ evt_opts_parse_long(int opt_idx, struct evt_options *opt)\n \t\t{ EVT_QUEUE_PRIORITY, evt_parse_queue_priority},\n \t\t{ EVT_DEQ_TMO_NSEC, evt_parse_deq_tmo_nsec},\n \t\t{ EVT_PROD_ETHDEV, evt_parse_eth_prod_type},\n+\t\t{ EVT_PROD_CRYPTODEV, evt_parse_crypto_prod_type},\n \t\t{ EVT_PROD_TIMERDEV, evt_parse_timer_prod_type},\n \t\t{ EVT_PROD_TIMERDEV_BURST, evt_parse_timer_prod_type_burst},\n+\t\t{ EVT_CRYPTO_ADPTR_MODE, evt_parse_crypto_adptr_mode},\n \t\t{ EVT_NB_TIMERS, evt_parse_nb_timers},\n \t\t{ EVT_NB_TIMER_ADPTRS, evt_parse_nb_timer_adptrs},\n \t\t{ EVT_TIMER_TICK_NSEC, evt_parse_timer_tick_nsec},\ndiff --git a/app/test-eventdev/evt_options.h b/app/test-eventdev/evt_options.h\nindex 413d7092f0..2231c58801 100644\n--- a/app/test-eventdev/evt_options.h\n+++ b/app/test-eventdev/evt_options.h\n@@ -9,6 +9,7 @@\n #include <stdbool.h>\n \n #include <rte_common.h>\n+#include <rte_cryptodev.h>\n #include <rte_ethdev.h>\n #include <rte_eventdev.h>\n #include <rte_lcore.h>\n@@ -33,8 +34,10 @@\n #define EVT_QUEUE_PRIORITY       (\"queue_priority\")\n #define EVT_DEQ_TMO_NSEC         (\"deq_tmo_nsec\")\n #define EVT_PROD_ETHDEV          (\"prod_type_ethdev\")\n+#define EVT_PROD_CRYPTODEV\t (\"prod_type_cryptodev\")\n #define EVT_PROD_TIMERDEV        (\"prod_type_timerdev\")\n #define EVT_PROD_TIMERDEV_BURST  (\"prod_type_timerdev_burst\")\n+#define EVT_CRYPTO_ADPTR_MODE\t (\"crypto_adptr_mode\")\n #define EVT_NB_TIMERS            (\"nb_timers\")\n #define EVT_NB_TIMER_ADPTRS      (\"nb_timer_adptrs\")\n #define EVT_TIMER_TICK_NSEC      (\"timer_tick_nsec\")\n@@ -249,6 +252,8 @@ evt_prod_id_to_name(enum evt_prod_type prod_type)\n \t\treturn \"Ethdev Rx Adapter\";\n \tcase EVT_PROD_TYPE_EVENT_TIMER_ADPTR:\n \t\treturn \"Event timer adapter\";\n+\tcase EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR:\n+\t\treturn \"Event crypto adapter\";\n \t}\n \n \treturn \"\";\n@@ -288,6 +293,13 @@ evt_dump_producer_type(struct evt_options *opt)\n \t\t\tevt_dump(\"timer_tick_nsec\", \"%\"PRIu64\"\",\n \t\t\t\t\topt->timer_tick_nsec);\n \t\tbreak;\n+\tcase EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR:\n+\t\tsnprintf(name, EVT_PROD_MAX_NAME_LEN,\n+\t\t\t \"Event crypto adapter producers\");\n+\t\tevt_dump(\"crypto adapter mode\", \"%s\",\n+\t\t\t opt->crypto_adptr_mode ? \"OP_FORWARD\" : \"OP_NEW\");\n+\t\tevt_dump(\"nb_cryptodev\", \"%u\", rte_cryptodev_count());\n+\t\tbreak;\n \t}\n \tevt_dump(\"prod_type\", \"%s\", name);\n }\ndiff --git a/app/test-eventdev/evt_test.h b/app/test-eventdev/evt_test.h\nindex f07d2c3336..50fa474ec2 100644\n--- a/app/test-eventdev/evt_test.h\n+++ b/app/test-eventdev/evt_test.h\n@@ -29,6 +29,8 @@ typedef int (*evt_test_mempool_setup_t)\n \t\t(struct evt_test *test, struct evt_options *opt);\n typedef int (*evt_test_ethdev_setup_t)\n \t\t(struct evt_test *test, struct evt_options *opt);\n+typedef int (*evt_test_cryptodev_setup_t)\n+\t\t(struct evt_test *test, struct evt_options *opt);\n typedef int (*evt_test_eventdev_setup_t)\n \t\t(struct evt_test *test, struct evt_options *opt);\n typedef int (*evt_test_launch_lcores_t)\n@@ -39,6 +41,8 @@ typedef void (*evt_test_eventdev_destroy_t)\n \t\t(struct evt_test *test, struct evt_options *opt);\n typedef void (*evt_test_ethdev_destroy_t)\n \t\t(struct evt_test *test, struct evt_options *opt);\n+typedef void (*evt_test_cryptodev_destroy_t)\n+\t\t(struct evt_test *test, struct evt_options *opt);\n typedef void (*evt_test_mempool_destroy_t)\n \t\t(struct evt_test *test, struct evt_options *opt);\n typedef void (*evt_test_destroy_t)\n@@ -52,10 +56,12 @@ struct evt_test_ops {\n \tevt_test_mempool_setup_t mempool_setup;\n \tevt_test_ethdev_setup_t ethdev_setup;\n \tevt_test_eventdev_setup_t eventdev_setup;\n+\tevt_test_cryptodev_setup_t cryptodev_setup;\n \tevt_test_launch_lcores_t launch_lcores;\n \tevt_test_result_t test_result;\n \tevt_test_eventdev_destroy_t eventdev_destroy;\n \tevt_test_ethdev_destroy_t ethdev_destroy;\n+\tevt_test_cryptodev_destroy_t cryptodev_destroy;\n \tevt_test_mempool_destroy_t mempool_destroy;\n \tevt_test_destroy_t test_destroy;\n };\ndiff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c\nindex 8fd51004ee..dbb1dc8c0c 100644\n--- a/app/test-eventdev/test_perf_atq.c\n+++ b/app/test-eventdev/test_perf_atq.c\n@@ -48,6 +48,22 @@ perf_atq_worker(void *arg, const int enable_fwd_latency)\n \t\t\tcontinue;\n \t\t}\n \n+\t\tif (prod_crypto_type &&\n+\t\t    (ev.event_type == RTE_EVENT_TYPE_CRYPTODEV)) {\n+\t\t\tstruct rte_crypto_op *op = ev.event_ptr;\n+\n+\t\t\tif (op->status == RTE_CRYPTO_OP_STATUS_SUCCESS) {\n+\t\t\t\tif (op->sym->m_dst == NULL)\n+\t\t\t\t\tev.event_ptr = op->sym->m_src;\n+\t\t\t\telse\n+\t\t\t\t\tev.event_ptr = op->sym->m_dst;\n+\t\t\t\trte_crypto_op_free(op);\n+\t\t\t} else {\n+\t\t\t\trte_crypto_op_free(op);\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t}\n+\n \t\tif (enable_fwd_latency && !prod_timer_type)\n \t\t/* first stage in pipeline, mark ts to compute fwd latency */\n \t\t\tatq_mark_fwd_latency(&ev);\n@@ -87,6 +103,25 @@ perf_atq_worker_burst(void *arg, const int enable_fwd_latency)\n \t\t}\n \n \t\tfor (i = 0; i < nb_rx; i++) {\n+\t\t\tif (prod_crypto_type &&\n+\t\t\t    (ev[i].event_type == RTE_EVENT_TYPE_CRYPTODEV)) {\n+\t\t\t\tstruct rte_crypto_op *op = ev[i].event_ptr;\n+\n+\t\t\t\tif (op->status ==\n+\t\t\t\t    RTE_CRYPTO_OP_STATUS_SUCCESS) {\n+\t\t\t\t\tif (op->sym->m_dst == NULL)\n+\t\t\t\t\t\tev[i].event_ptr =\n+\t\t\t\t\t\t\top->sym->m_src;\n+\t\t\t\t\telse\n+\t\t\t\t\t\tev[i].event_ptr =\n+\t\t\t\t\t\t\top->sym->m_dst;\n+\t\t\t\t\trte_crypto_op_free(op);\n+\t\t\t\t} else {\n+\t\t\t\t\trte_crypto_op_free(op);\n+\t\t\t\t\tcontinue;\n+\t\t\t\t}\n+\t\t\t}\n+\n \t\t\tif (enable_fwd_latency && !prod_timer_type) {\n \t\t\t\trte_prefetch0(ev[i+1].event_ptr);\n \t\t\t\t/* first stage in pipeline.\n@@ -254,6 +289,20 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)\n \t\t\t\treturn ret;\n \t\t\t}\n \t\t}\n+\t} else if (opt->prod_type == EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR) {\n+\t\tuint8_t cdev_id, cdev_count;\n+\n+\t\tcdev_count = rte_cryptodev_count();\n+\t\tfor (cdev_id = 0; cdev_id < cdev_count; cdev_id++) {\n+\t\t\tret = rte_cryptodev_start(cdev_id);\n+\t\t\tif (ret) {\n+\t\t\t\tevt_err(\"Failed to start cryptodev %u\",\n+\t\t\t\t\tcdev_id);\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\t\t}\n+\n+\t\trte_event_crypto_adapter_start(t->crypto_adptr.id);\n \t}\n \n \treturn 0;\n@@ -295,12 +344,14 @@ static const struct evt_test_ops perf_atq =  {\n \t.opt_dump           = perf_atq_opt_dump,\n \t.test_setup         = perf_test_setup,\n \t.ethdev_setup       = perf_ethdev_setup,\n+\t.cryptodev_setup    = perf_cryptodev_setup,\n \t.mempool_setup      = perf_mempool_setup,\n \t.eventdev_setup     = perf_atq_eventdev_setup,\n \t.launch_lcores      = perf_atq_launch_lcores,\n \t.eventdev_destroy   = perf_eventdev_destroy,\n \t.mempool_destroy    = perf_mempool_destroy,\n \t.ethdev_destroy     = perf_ethdev_destroy,\n+\t.cryptodev_destroy  = perf_cryptodev_destroy,\n \t.test_result        = perf_test_result,\n \t.test_destroy       = perf_test_destroy,\n };\ndiff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c\nindex 9b73874151..7b964ab8dc 100644\n--- a/app/test-eventdev/test_perf_common.c\n+++ b/app/test-eventdev/test_perf_common.c\n@@ -6,6 +6,8 @@\n \n #include \"test_perf_common.h\"\n \n+#define NB_CRYPTODEV_DESCRIPTORS 128\n+\n int\n perf_test_result(struct evt_test *test, struct evt_options *opt)\n {\n@@ -272,6 +274,121 @@ perf_event_timer_producer_burst(void *arg)\n \treturn 0;\n }\n \n+static inline void\n+crypto_adapter_enq_op_new(struct prod_data *p)\n+{\n+\tstruct test_perf *t = p->t;\n+\tconst uint32_t nb_flows = t->nb_flows;\n+\tconst uint64_t nb_pkts = t->nb_pkts;\n+\tstruct rte_mempool *pool = t->pool;\n+\tstruct rte_crypto_sym_op *sym_op;\n+\tstruct evt_options *opt = t->opt;\n+\tuint32_t flow_counter = 0;\n+\tstruct rte_crypto_op *op;\n+\tstruct rte_mbuf *m;\n+\tuint64_t count = 0;\n+\tuint16_t len;\n+\n+\tif (opt->verbose_level > 1)\n+\t\tprintf(\"%s(): lcore %d queue %d cdev_id %u cdev_qp_id %u\\n\",\n+\t\t       __func__, rte_lcore_id(), p->queue_id, p->cdev_id,\n+\t\t       p->cdev_qp_id);\n+\n+\tlen = opt->mbuf_sz ? opt->mbuf_sz : RTE_ETHER_MIN_LEN;\n+\n+\twhile (count < nb_pkts && t->done == false) {\n+\t\tm = rte_pktmbuf_alloc(pool);\n+\t\tif (m == NULL)\n+\t\t\tcontinue;\n+\n+\t\trte_pktmbuf_append(m, len);\n+\t\top = rte_crypto_op_alloc(t->crypto_adptr.op_pool,\n+\t\t\t\t\t RTE_CRYPTO_OP_TYPE_SYMMETRIC);\n+\t\tsym_op = op->sym;\n+\t\tsym_op->m_src = m;\n+\t\tsym_op->cipher.data.offset = 0;\n+\t\tsym_op->cipher.data.length = len;\n+\t\trte_crypto_op_attach_sym_session(\n+\t\t\top, p->crypto_sess[flow_counter++ % nb_flows]);\n+\t\twhile (rte_cryptodev_enqueue_burst(p->cdev_id, p->cdev_qp_id,\n+\t\t\t\t\t\t   &op, 1) != 1) {\n+\t\t\tif (t->done)\n+\t\t\t\tbreak;\n+\t\t\trte_pause();\n+\t\t}\n+\t\tcount++;\n+\t}\n+}\n+\n+static inline void\n+crypto_adapter_enq_op_fwd(struct prod_data *p)\n+{\n+\tconst uint8_t dev_id = p->dev_id;\n+\tconst uint8_t port = p->port_id;\n+\tstruct test_perf *t = p->t;\n+\tconst uint32_t nb_flows = t->nb_flows;\n+\tconst uint64_t nb_pkts = t->nb_pkts;\n+\tstruct rte_mempool *pool = t->pool;\n+\tstruct evt_options *opt = t->opt;\n+\tstruct rte_crypto_sym_op *sym_op;\n+\tuint32_t flow_counter = 0;\n+\tstruct rte_crypto_op *op;\n+\tstruct rte_event ev;\n+\tstruct rte_mbuf *m;\n+\tuint64_t count = 0;\n+\tuint16_t len;\n+\n+\tif (opt->verbose_level > 1)\n+\t\tprintf(\"%s(): lcore %d port %d queue %d cdev_id %u cdev_qp_id %u\\n\",\n+\t\t       __func__, rte_lcore_id(), port, p->queue_id, p->cdev_id,\n+\t\t       p->cdev_qp_id);\n+\n+\tev.event = 0;\n+\tev.op = RTE_EVENT_OP_NEW;\n+\tev.queue_id = p->queue_id;\n+\tev.sched_type = RTE_SCHED_TYPE_ATOMIC;\n+\tev.event_type = RTE_EVENT_TYPE_CPU;\n+\tlen = opt->mbuf_sz ? opt->mbuf_sz : RTE_ETHER_MIN_LEN;\n+\n+\twhile (count < nb_pkts && t->done == false) {\n+\t\tm = rte_pktmbuf_alloc(pool);\n+\t\tif (m == NULL)\n+\t\t\tcontinue;\n+\n+\t\trte_pktmbuf_append(m, len);\n+\t\top = rte_crypto_op_alloc(t->crypto_adptr.op_pool,\n+\t\t\t\t\t RTE_CRYPTO_OP_TYPE_SYMMETRIC);\n+\t\tsym_op = op->sym;\n+\t\tsym_op->m_src = m;\n+\t\tsym_op->cipher.data.offset = 0;\n+\t\tsym_op->cipher.data.length = len;\n+\t\trte_crypto_op_attach_sym_session(\n+\t\t\top, p->crypto_sess[flow_counter++ % nb_flows]);\n+\t\tev.event_ptr = op;\n+\t\twhile (rte_event_crypto_adapter_enqueue(dev_id, port, &ev, 1) !=\n+\t\t       1) {\n+\t\t\tif (t->done)\n+\t\t\t\tbreak;\n+\t\t\trte_pause();\n+\t\t}\n+\t\tcount++;\n+\t}\n+}\n+\n+static inline int\n+perf_event_crypto_producer(void *arg)\n+{\n+\tstruct prod_data *p = arg;\n+\tstruct evt_options *opt = p->t->opt;\n+\n+\tif (opt->crypto_adptr_mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW)\n+\t\tcrypto_adapter_enq_op_new(p);\n+\telse\n+\t\tcrypto_adapter_enq_op_fwd(p);\n+\n+\treturn 0;\n+}\n+\n static int\n perf_producer_wrapper(void *arg)\n {\n@@ -298,6 +415,8 @@ perf_producer_wrapper(void *arg)\n \telse if (t->opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR &&\n \t\t\tt->opt->timdev_use_burst)\n \t\treturn perf_event_timer_producer_burst(arg);\n+\telse if (t->opt->prod_type == EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR)\n+\t\treturn perf_event_crypto_producer(arg);\n \treturn 0;\n }\n \n@@ -405,8 +524,10 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,\n \t\t\tif (remaining <= 0) {\n \t\t\t\tt->result = EVT_TEST_SUCCESS;\n \t\t\t\tif (opt->prod_type == EVT_PROD_TYPE_SYNT ||\n-\t\t\t\t\topt->prod_type ==\n-\t\t\t\t\tEVT_PROD_TYPE_EVENT_TIMER_ADPTR) {\n+\t\t\t\t    opt->prod_type ==\n+\t\t\t\t\t    EVT_PROD_TYPE_EVENT_TIMER_ADPTR ||\n+\t\t\t\t    opt->prod_type ==\n+\t\t\t\t\t    EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR) {\n \t\t\t\t\tt->done = true;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n@@ -415,7 +536,8 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,\n \n \t\tif (new_cycles - dead_lock_cycles > dead_lock_sample &&\n \t\t    (opt->prod_type == EVT_PROD_TYPE_SYNT ||\n-\t\t     opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR)) {\n+\t\t     opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR ||\n+\t\t     opt->prod_type == EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR)) {\n \t\t\tremaining = t->outstand_pkts - processed_pkts(t);\n \t\t\tif (dead_lock_remaining == remaining) {\n \t\t\t\trte_event_dev_dump(opt->dev_id, stdout);\n@@ -537,6 +659,96 @@ perf_event_timer_adapter_setup(struct test_perf *t)\n \treturn 0;\n }\n \n+static int\n+perf_event_crypto_adapter_setup(struct test_perf *t,\n+\t\t\t\tstruct rte_event_port_conf port_conf)\n+{\n+\tstruct evt_options *opt = t->opt;\n+\tuint8_t cdev_id, cdev_count;\n+\tint ret;\n+\n+\tt->crypto_adptr.id = 0;\n+\tret = rte_event_crypto_adapter_create(t->crypto_adptr.id, opt->dev_id,\n+\t\t\t\t\t      &port_conf, 0);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tcdev_count = rte_cryptodev_count();\n+\tfor (cdev_id = 0; cdev_id < cdev_count; cdev_id++) {\n+\t\tuint32_t cap;\n+\n+\t\tret = rte_event_crypto_adapter_caps_get(opt->dev_id, cdev_id,\n+\t\t\t\t\t\t\t&cap);\n+\t\tif (ret) {\n+\t\t\tevt_err(\"Failed to get crypto adapter capabilities\");\n+\t\t\treturn ret;\n+\t\t}\n+\n+\t\tif (((opt->crypto_adptr_mode ==\n+\t\t      RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&\n+\t\t     !(cap &\n+\t\t       RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW)) ||\n+\t\t    ((opt->crypto_adptr_mode ==\n+\t\t      RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) &&\n+\t\t     !(cap &\n+\t\t       RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))) {\n+\t\t\tevt_err(\"crypto adapter %s mode unsupported\\n\",\n+\t\t\t\topt->crypto_adptr_mode ? \"OP_FORWARD\" :\n+\t\t\t\t\t\t\t \"OP_NEW\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\tif (!(cap &\n+\t\t      RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA)) {\n+\t\t\tevt_err(\"Storing crypto session not supported\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\tif (cap &\n+\t\t    RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {\n+\t\t\tstruct rte_event response_info;\n+\n+\t\t\tresponse_info.event = 0;\n+\t\t\tret = rte_event_crypto_adapter_queue_pair_add(\n+\t\t\t\tt->crypto_adptr.id, cdev_id, -1,\n+\t\t\t\t&response_info);\n+\t\t} else {\n+\t\t\tret = rte_event_crypto_adapter_queue_pair_add(\n+\t\t\t\tt->crypto_adptr.id, cdev_id, -1, NULL);\n+\t\t}\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static struct rte_cryptodev_sym_session *\n+cryptodev_session_create(struct prod_data *p, struct test_perf *t)\n+{\n+\tstruct rte_crypto_sym_xform cipher_xform;\n+\tstruct rte_cryptodev_sym_session *sess;\n+\n+\tcipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;\n+\tcipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;\n+\tcipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;\n+\tcipher_xform.next = NULL;\n+\n+\tsess = rte_cryptodev_sym_session_create(t->crypto_adptr.sess_pool);\n+\tif (sess == NULL) {\n+\t\tevt_err(\"Failed to create sym session\");\n+\t\treturn NULL;\n+\t}\n+\n+\tif (rte_cryptodev_sym_session_init(p->cdev_id, sess, &cipher_xform,\n+\t\t\t\t\t   t->crypto_adptr.sess_priv_pool)) {\n+\t\tevt_err(\"Failed to init session\");\n+\t\treturn NULL;\n+\t}\n+\n+\treturn sess;\n+}\n+\n int\n perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,\n \t\t\t\tuint8_t stride, uint8_t nb_queues,\n@@ -598,6 +810,55 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,\n \t\tret = perf_event_timer_adapter_setup(t);\n \t\tif (ret)\n \t\t\treturn ret;\n+\t} else if (opt->prod_type == EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR) {\n+\t\tuint8_t cdev_id = 0;\n+\t\tuint16_t qp_id = 0;\n+\n+\t\tprod = 0;\n+\t\tfor (; port < perf_nb_event_ports(opt); port++) {\n+\t\t\tstruct rte_cryptodev_sym_session *crypto_sess;\n+\t\t\tunion rte_event_crypto_metadata m_data;\n+\t\t\tstruct prod_data *p = &t->prod[port];\n+\t\t\tuint32_t flow_id;\n+\n+\t\t\tif (qp_id == rte_cryptodev_queue_pair_count(cdev_id)) {\n+\t\t\t\tcdev_id++;\n+\t\t\t\tqp_id = 0;\n+\t\t\t}\n+\n+\t\t\tp->dev_id = opt->dev_id;\n+\t\t\tp->port_id = port;\n+\t\t\tp->queue_id = prod * stride;\n+\t\t\tp->cdev_id = cdev_id;\n+\t\t\tp->cdev_qp_id = qp_id;\n+\t\t\tp->crypto_sess = rte_zmalloc_socket(\n+\t\t\t\tNULL, sizeof(crypto_sess) * t->nb_flows,\n+\t\t\t\tRTE_CACHE_LINE_SIZE, opt->socket_id);\n+\n+\t\t\tm_data.request_info.cdev_id = p->cdev_id;\n+\t\t\tm_data.request_info.queue_pair_id = p->cdev_qp_id;\n+\t\t\tm_data.response_info.op = RTE_EVENT_OP_NEW;\n+\t\t\tm_data.response_info.sched_type = RTE_SCHED_TYPE_ATOMIC;\n+\t\t\tm_data.response_info.event_type = RTE_EVENT_TYPE_CPU;\n+\t\t\tm_data.response_info.queue_id = p->queue_id;\n+\t\t\tfor (flow_id = 0; flow_id < t->nb_flows; flow_id++) {\n+\t\t\t\tcrypto_sess = cryptodev_session_create(p, t);\n+\t\t\t\tif (crypto_sess == NULL)\n+\t\t\t\t\treturn -ENOMEM;\n+\n+\t\t\t\tm_data.response_info.flow_id = flow_id;\n+\t\t\t\trte_cryptodev_sym_session_set_user_data(\n+\t\t\t\t\tcrypto_sess, &m_data, sizeof(m_data));\n+\t\t\t\tp->crypto_sess[flow_id] = crypto_sess;\n+\t\t\t}\n+\t\t\tp->t = t;\n+\t\t\tqp_id++;\n+\t\t\tprod++;\n+\t\t}\n+\n+\t\tret = perf_event_crypto_adapter_setup(t, *port_conf);\n+\t\tif (ret)\n+\t\t\treturn ret;\n \t} else {\n \t\tprod = 0;\n \t\tfor ( ; port < perf_nb_event_ports(opt); port++) {\n@@ -659,7 +920,8 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)\n \t}\n \n \tif (opt->prod_type == EVT_PROD_TYPE_SYNT ||\n-\t\t\topt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR) {\n+\t    opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR ||\n+\t    opt->prod_type == EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR) {\n \t\t/* Validate producer lcores */\n \t\tif (evt_lcores_has_overlap(opt->plcores,\n \t\t\t\t\trte_get_main_lcore())) {\n@@ -767,8 +1029,7 @@ perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)\n \t\t},\n \t};\n \n-\tif (opt->prod_type == EVT_PROD_TYPE_SYNT ||\n-\t\t\topt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR)\n+\tif (opt->prod_type != EVT_PROD_TYPE_ETH_RX_ADPTR)\n \t\treturn 0;\n \n \tif (!rte_eth_dev_count_avail()) {\n@@ -841,6 +1102,139 @@ void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt)\n \t}\n }\n \n+int\n+perf_cryptodev_setup(struct evt_test *test, struct evt_options *opt)\n+{\n+\tuint8_t cdev_count, cdev_id, nb_plcores, nb_qps;\n+\tstruct test_perf *t = evt_test_priv(test);\n+\tunsigned int max_session_size;\n+\tuint32_t nb_sessions;\n+\tint ret;\n+\n+\tif (opt->prod_type != EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR)\n+\t\treturn 0;\n+\n+\tcdev_count = rte_cryptodev_count();\n+\tif (cdev_count == 0) {\n+\t\tevt_err(\"No crypto devices available\\n\");\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tt->crypto_adptr.op_pool = rte_crypto_op_pool_create(\n+\t\t\"crypto_op_pool\", RTE_CRYPTO_OP_TYPE_SYMMETRIC, opt->pool_sz,\n+\t\t128, 0, rte_socket_id());\n+\tif (t->crypto_adptr.op_pool == NULL) {\n+\t\tevt_err(\"Failed to create crypto op pool\");\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\tnb_sessions = evt_nr_active_lcores(opt->plcores) * t->nb_flows;\n+\tt->crypto_adptr.sess_pool = rte_cryptodev_sym_session_pool_create(\n+\t\t\"ca_sess_pool\", nb_sessions, 0, 0,\n+\t\tsizeof(union rte_event_crypto_metadata), SOCKET_ID_ANY);\n+\tif (t->crypto_adptr.sess_pool == NULL) {\n+\t\tevt_err(\"Failed to create sym session pool\");\n+\t\tret = -ENOMEM;\n+\t\tgoto err;\n+\t}\n+\n+\tmax_session_size = 0;\n+\tfor (cdev_id = 0; cdev_id < cdev_count; cdev_id++) {\n+\t\tunsigned int session_size;\n+\n+\t\tsession_size =\n+\t\t\trte_cryptodev_sym_get_private_session_size(cdev_id);\n+\t\tif (session_size > max_session_size)\n+\t\t\tmax_session_size = session_size;\n+\t}\n+\tmax_session_size += sizeof(union rte_event_crypto_metadata);\n+\tt->crypto_adptr.sess_priv_pool = rte_mempool_create(\n+\t\t\"ca_sess_priv_pool\", nb_sessions, max_session_size, 0, 0, NULL,\n+\t\tNULL, NULL, NULL, SOCKET_ID_ANY, 0);\n+\tif (t->crypto_adptr.sess_priv_pool == NULL) {\n+\t\tevt_err(\"failed to create sym session private pool\");\n+\t\tret = -ENOMEM;\n+\t\tgoto err;\n+\t}\n+\n+\tnb_plcores = evt_nr_active_lcores(opt->plcores);\n+\tnb_qps = (nb_plcores % cdev_count) ? (nb_plcores / cdev_count) + 1 :\n+\t\t\t\t\t     nb_plcores / cdev_count;\n+\tfor (cdev_id = 0; cdev_id < cdev_count; cdev_id++) {\n+\t\tstruct rte_cryptodev_qp_conf qp_conf;\n+\t\tstruct rte_cryptodev_config conf;\n+\t\tstruct rte_cryptodev_info info;\n+\t\tint qp_id;\n+\n+\t\trte_cryptodev_info_get(cdev_id, &info);\n+\t\tif (nb_qps > info.max_nb_queue_pairs) {\n+\t\t\tevt_err(\"Not enough queue pairs per cryptodev (%u)\",\n+\t\t\t\tnb_qps);\n+\t\t\tret = -EINVAL;\n+\t\t\tgoto err;\n+\t\t}\n+\n+\t\tconf.nb_queue_pairs = nb_qps;\n+\t\tconf.socket_id = SOCKET_ID_ANY;\n+\t\tconf.ff_disable = RTE_CRYPTODEV_FF_SECURITY;\n+\n+\t\tret = rte_cryptodev_configure(cdev_id, &conf);\n+\t\tif (ret) {\n+\t\t\tevt_err(\"Failed to configure cryptodev (%u)\", cdev_id);\n+\t\t\tgoto err;\n+\t\t}\n+\n+\t\tqp_conf.nb_descriptors = NB_CRYPTODEV_DESCRIPTORS;\n+\t\tqp_conf.mp_session = t->crypto_adptr.sess_pool;\n+\t\tqp_conf.mp_session_private = t->crypto_adptr.sess_priv_pool;\n+\n+\t\tfor (qp_id = 0; qp_id < conf.nb_queue_pairs; qp_id++) {\n+\t\t\tret = rte_cryptodev_queue_pair_setup(\n+\t\t\t\tcdev_id, qp_id, &qp_conf,\n+\t\t\t\trte_cryptodev_socket_id(cdev_id));\n+\t\t\tif (ret) {\n+\t\t\t\tevt_err(\"Failed to setup queue pairs on cryptodev %u\\n\",\n+\t\t\t\t\tcdev_id);\n+\t\t\t\tgoto err;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+err:\n+\trte_mempool_free(t->crypto_adptr.op_pool);\n+\trte_mempool_free(t->crypto_adptr.sess_pool);\n+\trte_mempool_free(t->crypto_adptr.sess_priv_pool);\n+\n+\treturn ret;\n+}\n+\n+void\n+perf_cryptodev_destroy(struct evt_test *test, struct evt_options *opt)\n+{\n+\tuint8_t cdev_id, cdev_count = rte_cryptodev_count();\n+\tstruct test_perf *t = evt_test_priv(test);\n+\n+\tRTE_SET_USED(opt);\n+\n+\tif (opt->prod_type != EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR)\n+\t\treturn;\n+\n+\trte_event_crypto_adapter_stop(t->crypto_adptr.id);\n+\n+\tfor (cdev_id = 0; cdev_id < cdev_count; cdev_id++) {\n+\t\trte_cryptodev_stop(cdev_id);\n+\t\trte_event_crypto_adapter_queue_pair_del(t->crypto_adptr.id,\n+\t\t\t\t\t\t\tcdev_id, -1);\n+\t}\n+\n+\trte_event_crypto_adapter_free(t->crypto_adptr.id);\n+\n+\trte_mempool_free(t->crypto_adptr.op_pool);\n+\trte_mempool_free(t->crypto_adptr.sess_pool);\n+\trte_mempool_free(t->crypto_adptr.sess_priv_pool);\n+}\n+\n int\n perf_mempool_setup(struct evt_test *test, struct evt_options *opt)\n {\ndiff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h\nindex 14dcf80429..d9ad3a0b0d 100644\n--- a/app/test-eventdev/test_perf_common.h\n+++ b/app/test-eventdev/test_perf_common.h\n@@ -9,9 +9,11 @@\n #include <stdbool.h>\n #include <unistd.h>\n \n+#include <rte_cryptodev.h>\n #include <rte_cycles.h>\n #include <rte_ethdev.h>\n #include <rte_eventdev.h>\n+#include <rte_event_crypto_adapter.h>\n #include <rte_event_eth_rx_adapter.h>\n #include <rte_event_timer_adapter.h>\n #include <rte_lcore.h>\n@@ -37,9 +39,18 @@ struct prod_data {\n \tuint8_t dev_id;\n \tuint8_t port_id;\n \tuint8_t queue_id;\n+\tuint8_t cdev_id;\n+\tuint16_t cdev_qp_id;\n+\tstruct rte_cryptodev_sym_session **crypto_sess;\n \tstruct test_perf *t;\n } __rte_cache_aligned;\n \n+struct crypto_adptr_data {\n+\tuint8_t id;\n+\tstruct rte_mempool *op_pool;\n+\tstruct rte_mempool *sess_pool;\n+\tstruct rte_mempool *sess_priv_pool;\n+};\n \n struct test_perf {\n \t/* Don't change the offset of \"done\". Signal handler use this memory\n@@ -58,6 +69,7 @@ struct test_perf {\n \tuint8_t sched_type_list[EVT_MAX_STAGES] __rte_cache_aligned;\n \tstruct rte_event_timer_adapter *timer_adptr[\n \t\tRTE_EVENT_TIMER_ADAPTER_NUM_MAX] __rte_cache_aligned;\n+\tstruct crypto_adptr_data crypto_adptr;\n } __rte_cache_aligned;\n \n struct perf_elt {\n@@ -81,6 +93,8 @@ struct perf_elt {\n \tconst uint8_t port = w->port_id;\\\n \tconst uint8_t prod_timer_type = \\\n \t\topt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR;\\\n+\tconst uint8_t prod_crypto_type = \\\n+\t\topt->prod_type == EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR;\\\n \tuint8_t *const sched_type_list = &t->sched_type_list[0];\\\n \tstruct rte_mempool *const pool = t->pool;\\\n \tconst uint8_t nb_stages = t->opt->nb_stages;\\\n@@ -154,6 +168,7 @@ int perf_test_result(struct evt_test *test, struct evt_options *opt);\n int perf_opt_check(struct evt_options *opt, uint64_t nb_queues);\n int perf_test_setup(struct evt_test *test, struct evt_options *opt);\n int perf_ethdev_setup(struct evt_test *test, struct evt_options *opt);\n+int perf_cryptodev_setup(struct evt_test *test, struct evt_options *opt);\n int perf_mempool_setup(struct evt_test *test, struct evt_options *opt);\n int perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,\n \t\t\t\tuint8_t stride, uint8_t nb_queues,\n@@ -164,6 +179,7 @@ int perf_launch_lcores(struct evt_test *test, struct evt_options *opt,\n void perf_opt_dump(struct evt_options *opt, uint8_t nb_queues);\n void perf_test_destroy(struct evt_test *test, struct evt_options *opt);\n void perf_eventdev_destroy(struct evt_test *test, struct evt_options *opt);\n+void perf_cryptodev_destroy(struct evt_test *test, struct evt_options *opt);\n void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt);\n void perf_mempool_destroy(struct evt_test *test, struct evt_options *opt);\n \ndiff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c\nindex f4ea3a795f..5657c8b3cd 100644\n--- a/app/test-eventdev/test_perf_queue.c\n+++ b/app/test-eventdev/test_perf_queue.c\n@@ -49,6 +49,23 @@ perf_queue_worker(void *arg, const int enable_fwd_latency)\n \t\t\trte_pause();\n \t\t\tcontinue;\n \t\t}\n+\n+\t\tif (prod_crypto_type &&\n+\t\t    (ev.event_type == RTE_EVENT_TYPE_CRYPTODEV)) {\n+\t\t\tstruct rte_crypto_op *op = ev.event_ptr;\n+\n+\t\t\tif (op->status == RTE_CRYPTO_OP_STATUS_SUCCESS) {\n+\t\t\t\tif (op->sym->m_dst == NULL)\n+\t\t\t\t\tev.event_ptr = op->sym->m_src;\n+\t\t\t\telse\n+\t\t\t\t\tev.event_ptr = op->sym->m_dst;\n+\t\t\t\trte_crypto_op_free(op);\n+\t\t\t} else {\n+\t\t\t\trte_crypto_op_free(op);\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t}\n+\n \t\tif (enable_fwd_latency && !prod_timer_type)\n \t\t/* first q in pipeline, mark timestamp to compute fwd latency */\n \t\t\tmark_fwd_latency(&ev, nb_stages);\n@@ -88,6 +105,25 @@ perf_queue_worker_burst(void *arg, const int enable_fwd_latency)\n \t\t}\n \n \t\tfor (i = 0; i < nb_rx; i++) {\n+\t\t\tif (prod_crypto_type &&\n+\t\t\t    (ev[i].event_type == RTE_EVENT_TYPE_CRYPTODEV)) {\n+\t\t\t\tstruct rte_crypto_op *op = ev[i].event_ptr;\n+\n+\t\t\t\tif (op->status ==\n+\t\t\t\t    RTE_CRYPTO_OP_STATUS_SUCCESS) {\n+\t\t\t\t\tif (op->sym->m_dst == NULL)\n+\t\t\t\t\t\tev[i].event_ptr =\n+\t\t\t\t\t\t\top->sym->m_src;\n+\t\t\t\t\telse\n+\t\t\t\t\t\tev[i].event_ptr =\n+\t\t\t\t\t\t\top->sym->m_dst;\n+\t\t\t\t\trte_crypto_op_free(op);\n+\t\t\t\t} else {\n+\t\t\t\t\trte_crypto_op_free(op);\n+\t\t\t\t\tcontinue;\n+\t\t\t\t}\n+\t\t\t}\n+\n \t\t\tif (enable_fwd_latency && !prod_timer_type) {\n \t\t\t\trte_prefetch0(ev[i+1].event_ptr);\n \t\t\t\t/* first queue in pipeline.\n@@ -269,6 +305,20 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)\n \t\t\t\treturn ret;\n \t\t\t}\n \t\t}\n+\t} else if (opt->prod_type == EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR) {\n+\t\tuint8_t cdev_id, cdev_count;\n+\n+\t\tcdev_count = rte_cryptodev_count();\n+\t\tfor (cdev_id = 0; cdev_id < cdev_count; cdev_id++) {\n+\t\t\tret = rte_cryptodev_start(cdev_id);\n+\t\t\tif (ret) {\n+\t\t\t\tevt_err(\"Failed to start cryptodev %u\",\n+\t\t\t\t\tcdev_id);\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\t\t}\n+\n+\t\trte_event_crypto_adapter_start(t->crypto_adptr.id);\n \t}\n \n \treturn 0;\n@@ -311,11 +361,13 @@ static const struct evt_test_ops perf_queue =  {\n \t.test_setup         = perf_test_setup,\n \t.mempool_setup      = perf_mempool_setup,\n \t.ethdev_setup\t    = perf_ethdev_setup,\n+\t.cryptodev_setup    = perf_cryptodev_setup,\n \t.eventdev_setup     = perf_queue_eventdev_setup,\n \t.launch_lcores      = perf_queue_launch_lcores,\n \t.eventdev_destroy   = perf_eventdev_destroy,\n \t.mempool_destroy    = perf_mempool_destroy,\n \t.ethdev_destroy\t    = perf_ethdev_destroy,\n+\t.cryptodev_destroy  = perf_cryptodev_destroy,\n \t.test_result        = perf_test_result,\n \t.test_destroy       = perf_test_destroy,\n };\ndiff --git a/doc/guides/tools/testeventdev.rst b/doc/guides/tools/testeventdev.rst\nindex 48efb9ea6e..f7d813226d 100644\n--- a/doc/guides/tools/testeventdev.rst\n+++ b/doc/guides/tools/testeventdev.rst\n@@ -120,6 +120,10 @@ The following are the application command-line options:\n \n        Use burst mode event timer adapter as producer.\n \n+* ``--prod_type_cryptodev``\n+\n+        Use crypto device as producer.\n+\n * ``--timer_tick_nsec``\n \n        Used to dictate number of nano seconds between bucket traversal of the\n@@ -148,6 +152,11 @@ The following are the application command-line options:\n        timeout is out of the supported range of event device it will be\n        adjusted to the highest/lowest supported dequeue timeout supported.\n \n+* ``--crypto_adptr_mode``\n+\n+        Set crypto adapter mode. Use 0 for OP_NEW (default) and 1 for\n+        OP_FORWARD mode.\n+\n * ``--mbuf_sz``\n \n        Set packet mbuf size. Can be used to configure Jumbo Frames. Only\n@@ -420,6 +429,7 @@ Supported application command line options are following::\n         --prod_type_ethdev\n         --prod_type_timerdev_burst\n         --prod_type_timerdev\n+        --prod_type_cryptodev\n         --prod_enq_burst_sz\n         --timer_tick_nsec\n         --max_tmo_nsec\n@@ -427,6 +437,7 @@ Supported application command line options are following::\n         --nb_timers\n         --nb_timer_adptrs\n         --deq_tmo_nsec\n+        --crypto_adptr_mode\n \n Example\n ^^^^^^^\n@@ -529,12 +540,14 @@ Supported application command line options are following::\n         --prod_type_ethdev\n         --prod_type_timerdev_burst\n         --prod_type_timerdev\n+        --prod_type_cryptodev\n         --timer_tick_nsec\n         --max_tmo_nsec\n         --expiry_nsec\n         --nb_timers\n         --nb_timer_adptrs\n         --deq_tmo_nsec\n+        --crypto_adptr_mode\n \n Example\n ^^^^^^^\n",
    "prefixes": [
        "v2"
    ]
}