get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 108224,
    "url": "https://patches.dpdk.org/api/patches/108224/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/d1e1521e2482b6bcff52784593fac2085646fd37.1645677641.git.sthotton@marvell.com/",
    "project": {
        "id": 1,
        "url": "https://patches.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": "<d1e1521e2482b6bcff52784593fac2085646fd37.1645677641.git.sthotton@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/d1e1521e2482b6bcff52784593fac2085646fd37.1645677641.git.sthotton@marvell.com",
    "date": "2022-02-24T04:46:07",
    "name": "[v7] app/eventdev: add crypto producer mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "1a00c452bfdf7d03facc237e1942975f3a5586bb",
    "submitter": {
        "id": 2049,
        "url": "https://patches.dpdk.org/api/people/2049/?format=api",
        "name": "Shijith Thotton",
        "email": "sthotton@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "https://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/d1e1521e2482b6bcff52784593fac2085646fd37.1645677641.git.sthotton@marvell.com/mbox/",
    "series": [
        {
            "id": 21841,
            "url": "https://patches.dpdk.org/api/series/21841/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=21841",
            "date": "2022-02-24T04:46:07",
            "name": "[v7] app/eventdev: add crypto producer mode",
            "version": 7,
            "mbox": "https://patches.dpdk.org/series/21841/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/108224/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/108224/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 13DD9A0353;\n\tThu, 24 Feb 2022 05:47:09 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8C73D4114D;\n\tThu, 24 Feb 2022 05:47:08 +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 3BB9F40E5A\n for <dev@dpdk.org>; Thu, 24 Feb 2022 05:47:07 +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 21O4j64o003683;\n Wed, 23 Feb 2022 20:47:06 -0800",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3edjga4rp2-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 23 Feb 2022 20:47:06 -0800",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Wed, 23 Feb 2022 20:47:04 -0800",
            "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; Wed, 23 Feb 2022 20:47:04 -0800",
            "from localhost.localdomain (unknown [10.28.34.29])\n by maili.marvell.com (Postfix) with ESMTP id 4992A5B692B;\n Wed, 23 Feb 2022 20:47:02 -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=Y4md7qav4WS3Iv2csbsqdYTgz1DgCIOqt/J2jOI0iQk=;\n b=Fs9ksOpE4eQfD9teIqeptJVruqQN/klWPuSvza3wC+MQD8hboQ1FQFTJ0vN8Vu493BQj\n 3we1oOZrdHBtX/p++VeGVctiRJrB7wJvPwfbaliZ+gFYg6MWpsheEy/wdcuEIjKrm+ZN\n WYFCIKyrwBlnByBseV1AvoZMxKVVUiCSz6LNpfTlLRz1aTRpSgtq9CxsEnPUIVAQTg3e\n v2OEILS0wVj/D2yYkFvXTvrmLQYTxDt5SdTF0tOj8EZhK8X4zbQGnI1q4j/R9zXEicXu\n IqFl5Z2ikiV5lVBGQqacIEYKSHa7kdp2NRXKp3X4nVSWFNSP6HTwMcBZuRdgO6NsWwla 5g==",
        "From": "Shijith Thotton <sthotton@marvell.com>",
        "To": "<dev@dpdk.org>, <jerinj@marvell.com>",
        "CC": "Shijith Thotton <sthotton@marvell.com>, <abhinandan.gujjar@intel.com>,\n Akhil Goyal <gakhil@marvell.com>",
        "Subject": "[PATCH v7] app/eventdev: add crypto producer mode",
        "Date": "Thu, 24 Feb 2022 10:16:07 +0530",
        "Message-ID": "\n <d1e1521e2482b6bcff52784593fac2085646fd37.1645677641.git.sthotton@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "\n <49488f40d7f7861132b361d78304fe5a3d597bed.1645185299.git.sthotton@marvell.com>",
        "References": "\n <49488f40d7f7861132b361d78304fe5a3d597bed.1645185299.git.sthotton@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "Mcy7m1tO5LPWybhfyPMMel1OyZtIu-LG",
        "X-Proofpoint-GUID": "Mcy7m1tO5LPWybhfyPMMel1OyZtIu-LG",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.64.514\n definitions=2022-02-23_09,2022-02-23_01,2022-02-23_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>\nAcked-by: Akhil Goyal <gakhil@marvell.com>\n---\nv7:\n* Removed setting op and event_type in response info.\n* Fixed op type of event in FORWARD mode.\n\nv6:\n* Added cryptodev close.\n* Fixed cleanup.\n* Updated release notes.\n\nv5:\n* Rebased.\n\nv4:\n* Addressed comments on v3 and rebased.\n* Added cryptodev cleanup in signal handler.\n\nv3:\n* Reduce dereference inside loop.\n\nv2:\n* Fix RHEL compilation warning.\n\n app/test-eventdev/evt_common.h         |   3 +\n app/test-eventdev/evt_main.c           |  17 +-\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      |  49 +++\n app/test-eventdev/test_perf_common.c   | 427 ++++++++++++++++++++++++-\n app/test-eventdev/test_perf_common.h   |  18 +-\n app/test-eventdev/test_perf_queue.c    |  50 +++\n doc/guides/rel_notes/release_22_03.rst |   5 +\n doc/guides/tools/testeventdev.rst      |  13 +\n 11 files changed, 619 insertions(+), 8 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..a7d6b0c1cf 100644\n--- a/app/test-eventdev/evt_main.c\n+++ b/app/test-eventdev/evt_main.c\n@@ -35,6 +35,9 @@ signal_handler(int signum)\n \t\t\tif (test->ops.ethdev_destroy)\n \t\t\t\ttest->ops.ethdev_destroy(test, &opt);\n \n+\t\t\tif (test->ops.cryptodev_destroy)\n+\t\t\t\ttest->ops.cryptodev_destroy(test, &opt);\n+\n \t\t\trte_eal_mp_wait_lcore();\n \n \t\t\tif (test->ops.test_result)\n@@ -162,11 +165,19 @@ main(int argc, char **argv)\n \t\t}\n \t}\n \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 +208,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 4ae44801da..d3c704d2b3 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                     expiry_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..67ff681666 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,18 @@ 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 \t}\n \n \treturn 0;\n@@ -295,12 +342,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..9d1f4a4567 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,123 @@ 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 rte_cryptodev_sym_session **crypto_sess = p->ca.crypto_sess;\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+\tuint16_t qp_id = p->ca.cdev_qp_id;\n+\tuint8_t cdev_id = p->ca.cdev_id;\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->ca.cdev_id,\n+\t\t       p->ca.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->ca_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, crypto_sess[flow_counter++ % nb_flows]);\n+\n+\t\twhile (rte_cryptodev_enqueue_burst(cdev_id, qp_id, &op, 1) != 1 &&\n+\t\t       t->done == false)\n+\t\t\trte_pause();\n+\n+\t\tcount++;\n+\t}\n+}\n+\n+static inline void\n+crypto_adapter_enq_op_fwd(struct prod_data *p)\n+{\n+\tstruct rte_cryptodev_sym_session **crypto_sess = p->ca.crypto_sess;\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,\n+\t\t       p->ca.cdev_id, p->ca.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->ca_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, crypto_sess[flow_counter++ % nb_flows]);\n+\t\tev.event_ptr = op;\n+\n+\t\twhile (rte_event_crypto_adapter_enqueue(dev_id, port, &ev, 1) != 1 &&\n+\t\t       t->done == false)\n+\t\t\trte_pause();\n+\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 +417,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 +526,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 +538,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 +661,74 @@ 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, struct prod_data *p)\n+{\n+\tstruct evt_options *opt = t->opt;\n+\tuint32_t cap;\n+\tint ret;\n+\n+\tret = rte_event_crypto_adapter_caps_get(p->dev_id, p->ca.cdev_id, &cap);\n+\tif (ret) {\n+\t\tevt_err(\"Failed to get crypto adapter capabilities\");\n+\t\treturn ret;\n+\t}\n+\n+\tif (((opt->crypto_adptr_mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&\n+\t     !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW)) ||\n+\t    ((opt->crypto_adptr_mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) &&\n+\t     !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))) {\n+\t\tevt_err(\"crypto adapter %s mode unsupported\\n\",\n+\t\t\topt->crypto_adptr_mode ? \"OP_FORWARD\" : \"OP_NEW\");\n+\t\treturn -ENOTSUP;\n+\t} else if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA)) {\n+\t\tevt_err(\"Storing crypto session not supported\");\n+\t\treturn -ENOTSUP;\n+\t}\n+\n+\tif (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {\n+\t\tstruct rte_event response_info;\n+\n+\t\tresponse_info.event = 0;\n+\t\tresponse_info.sched_type = RTE_SCHED_TYPE_ATOMIC;\n+\t\tresponse_info.queue_id = p->queue_id;\n+\t\tret = rte_event_crypto_adapter_queue_pair_add(\n+\t\t\tTEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id,\n+\t\t\t&response_info);\n+\t} else {\n+\t\tret = rte_event_crypto_adapter_queue_pair_add(\n+\t\t\tTEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id, NULL);\n+\t}\n+\n+\treturn ret;\n+}\n+\n+static struct rte_cryptodev_sym_session *\n+cryptodev_sym_sess_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->ca_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->ca.cdev_id, sess, &cipher_xform,\n+\t\t\t\t\t   t->ca_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 +790,73 @@ 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\tstruct rte_event_port_conf conf = *port_conf;\n+\t\tuint8_t cdev_id = 0;\n+\t\tuint16_t qp_id = 0;\n+\n+\t\tret = rte_event_crypto_adapter_create(TEST_PERF_CA_ID,\n+\t\t\t\t\t\t      opt->dev_id, &conf, 0);\n+\t\tif (ret) {\n+\t\t\tevt_err(\"Failed to create crypto adapter\");\n+\t\t\treturn ret;\n+\t\t}\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->ca.cdev_id = cdev_id;\n+\t\t\tp->ca.cdev_qp_id = qp_id;\n+\t\t\tp->ca.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+\t\t\tp->t = t;\n+\n+\t\t\tm_data.request_info.cdev_id = p->ca.cdev_id;\n+\t\t\tm_data.request_info.queue_pair_id = p->ca.cdev_qp_id;\n+\t\t\tm_data.response_info.sched_type = RTE_SCHED_TYPE_ATOMIC;\n+\t\t\tm_data.response_info.queue_id = p->queue_id;\n+\n+\t\t\tfor (flow_id = 0; flow_id < t->nb_flows; flow_id++) {\n+\t\t\t\tcrypto_sess = cryptodev_sym_sess_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->ca.crypto_sess[flow_id] = crypto_sess;\n+\t\t\t}\n+\n+\t\t\tconf.event_port_cfg |=\n+\t\t\t\tRTE_EVENT_PORT_CFG_HINT_PRODUCER |\n+\t\t\t\tRTE_EVENT_PORT_CFG_HINT_CONSUMER;\n+\n+\t\t\tret = rte_event_port_setup(opt->dev_id, port, &conf);\n+\t\t\tif (ret) {\n+\t\t\t\tevt_err(\"failed to setup port %d\", port);\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\n+\t\t\tret = perf_event_crypto_adapter_setup(t, p);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\n+\t\t\tqp_id++;\n+\t\t\tprod++;\n+\t\t}\n \t} else {\n \t\tprod = 0;\n \t\tfor ( ; port < perf_nb_event_ports(opt); port++) {\n@@ -659,7 +918,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 +1027,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 +1100,162 @@ 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->ca_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->ca_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->ca_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->ca_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+\n+\tmax_session_size += sizeof(union rte_event_crypto_metadata);\n+\tt->ca_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->ca_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+\t/*\n+\t * Calculate number of needed queue pairs, based on the amount of\n+\t * available number of logical cores and crypto devices. For instance,\n+\t * if there are 4 cores and 2 crypto devices, 2 queue pairs will be set\n+\t * up per device.\n+\t */\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->ca_sess_pool;\n+\t\tqp_conf.mp_session_private = t->ca_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+\tfor (cdev_id = 0; cdev_id < cdev_count; cdev_id++)\n+\t\trte_cryptodev_close(cdev_id);\n+\n+\trte_mempool_free(t->ca_op_pool);\n+\trte_mempool_free(t->ca_sess_pool);\n+\trte_mempool_free(t->ca_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+\tuint16_t port;\n+\n+\tif (opt->prod_type != EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR)\n+\t\treturn;\n+\n+\tfor (port = t->nb_workers; port < perf_nb_event_ports(opt); port++) {\n+\t\tstruct rte_cryptodev_sym_session *sess;\n+\t\tstruct prod_data *p = &t->prod[port];\n+\t\tuint32_t flow_id;\n+\t\tuint8_t cdev_id;\n+\n+\t\tfor (flow_id = 0; flow_id < t->nb_flows; flow_id++) {\n+\t\t\tsess = p->ca.crypto_sess[flow_id];\n+\t\t\tcdev_id = p->ca.cdev_id;\n+\t\t\trte_cryptodev_sym_session_clear(cdev_id, sess);\n+\t\t\trte_cryptodev_sym_session_free(sess);\n+\t\t}\n+\n+\t\trte_event_crypto_adapter_queue_pair_del(\n+\t\t\tTEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id);\n+\t}\n+\n+\trte_event_crypto_adapter_free(TEST_PERF_CA_ID);\n+\n+\tfor (cdev_id = 0; cdev_id < cdev_count; cdev_id++) {\n+\t\trte_cryptodev_stop(cdev_id);\n+\t\trte_cryptodev_close(cdev_id);\n+\t}\n+\n+\trte_mempool_free(t->ca_op_pool);\n+\trte_mempool_free(t->ca_sess_pool);\n+\trte_mempool_free(t->ca_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..ea0907d61a 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@@ -23,6 +25,8 @@\n #include \"evt_options.h\"\n #include \"evt_test.h\"\n \n+#define TEST_PERF_CA_ID 0\n+\n struct test_perf;\n \n struct worker_data {\n@@ -33,14 +37,19 @@ struct worker_data {\n \tstruct test_perf *t;\n } __rte_cache_aligned;\n \n+struct crypto_adptr_data {\n+\tuint8_t cdev_id;\n+\tuint16_t cdev_qp_id;\n+\tstruct rte_cryptodev_sym_session **crypto_sess;\n+};\n struct prod_data {\n \tuint8_t dev_id;\n \tuint8_t port_id;\n \tuint8_t queue_id;\n+\tstruct crypto_adptr_data ca;\n \tstruct test_perf *t;\n } __rte_cache_aligned;\n \n-\n struct test_perf {\n \t/* Don't change the offset of \"done\". Signal handler use this memory\n \t * to terminate all lcores work.\n@@ -58,6 +67,9 @@ 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 rte_mempool *ca_op_pool;\n+\tstruct rte_mempool *ca_sess_pool;\n+\tstruct rte_mempool *ca_sess_priv_pool;\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..dcf6d82947 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,18 @@ 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 \t}\n \n \treturn 0;\n@@ -311,11 +359,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/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst\nindex cbc98e798f..72052ef2dc 100644\n--- a/doc/guides/rel_notes/release_22_03.rst\n+++ b/doc/guides/rel_notes/release_22_03.rst\n@@ -159,6 +159,11 @@ New Features\n   * Called ``rte_ipv4/6_udptcp_cksum_mbuf()`` functions in testpmd csum mode\n     to support software UDP/TCP checksum over multiple segments.\n \n+* **Added crypto producer mode in test-eventdev.**\n+\n+  * Crypto producer mode helps to measure performance of OP_NEW and OP_FORWARD\n+    modes of event crypto adapter.\n+\n \n Removed Items\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": [
        "v7"
    ]
}