DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shijith Thotton <sthotton@marvell.com>
To: <dev@dpdk.org>
Cc: Shijith Thotton <sthotton@marvell.com>, <thomas@monjalon.net>,
	<jerinj@marvell.com>, <abhinandan.gujjar@intel.com>,
	<hemant.agrawal@nxp.com>, <nipun.gupta@nxp.com>,
	<sachin.saxena@oss.nxp.com>, <anoobj@marvell.com>,
	<matan@nvidia.com>, <roy.fan.zhang@intel.com>, <g.singh@nxp.com>,
	<erik.g.carrillo@intel.com>, <jay.jayatheerthan@intel.com>,
	<pbhagavatula@marvell.com>, <harry.van.haaren@intel.com>,
	Akhil Goyal <gakhil@marvell.com>
Subject: [dpdk-dev] [PATCH v5 3/3] test/event_crypto: use crypto adapter enqueue API
Date: Fri, 9 Apr 2021 00:54:17 +0530	[thread overview]
Message-ID: <0194df2a6170aa01fcf88bab33e2b38fcd5949a3.1617909091.git.sthotton@marvell.com> (raw)
In-Reply-To: <cover.1617909090.git.sthotton@marvell.com>

Use rte_event_crypto_adapter_enqueue() API to enqueue events to crypto
adapter if forward mode is supported in driver.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
---
 app/test/test_event_crypto_adapter.c | 33 ++++++++++++++++++----------
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 335211cd8..f689bc1f2 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -64,6 +64,7 @@ struct event_crypto_adapter_test_params {
 	struct rte_mempool *session_priv_mpool;
 	struct rte_cryptodev_config *config;
 	uint8_t crypto_event_port_id;
+	uint8_t internal_port_op_fwd;
 };
 
 struct rte_event response_info = {
@@ -110,9 +111,12 @@ send_recv_ev(struct rte_event *ev)
 	struct rte_event recv_ev;
 	int ret;
 
-	ret = rte_event_enqueue_burst(evdev, TEST_APP_PORT_ID, ev, NUM);
-	TEST_ASSERT_EQUAL(ret, NUM,
-			  "Failed to send event to crypto adapter\n");
+	if (params.internal_port_op_fwd)
+		ret = rte_event_crypto_adapter_enqueue(evdev, TEST_APP_PORT_ID,
+						       ev, NUM);
+	else
+		ret = rte_event_enqueue_burst(evdev, TEST_APP_PORT_ID, ev, NUM);
+	TEST_ASSERT_EQUAL(ret, NUM, "Failed to send event to crypto adapter\n");
 
 	while (rte_event_dequeue_burst(evdev,
 			TEST_APP_PORT_ID, &recv_ev, NUM, 0) == 0)
@@ -747,9 +751,12 @@ configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode)
 	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND))
 		goto adapter_create;
 
-	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) &&
-	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
-		return -ENOTSUP;
+	if (mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) {
+		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD)
+			params.internal_port_op_fwd = 1;
+		else
+			return -ENOTSUP;
+	}
 
 	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&
 	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
@@ -771,9 +778,11 @@ configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode)
 
 	TEST_ASSERT_SUCCESS(ret, "Failed to add queue pair\n");
 
-	ret = rte_event_crypto_adapter_event_port_get(TEST_ADAPTER_ID,
-				&params.crypto_event_port_id);
-	TEST_ASSERT_SUCCESS(ret, "Failed to get event port\n");
+	if (!params.internal_port_op_fwd) {
+		ret = rte_event_crypto_adapter_event_port_get(TEST_ADAPTER_ID,
+						&params.crypto_event_port_id);
+		TEST_ASSERT_SUCCESS(ret, "Failed to get event port\n");
+	}
 
 	return TEST_SUCCESS;
 }
@@ -809,15 +818,15 @@ test_crypto_adapter_conf(enum rte_event_crypto_adapter_mode mode)
 
 	if (!crypto_adapter_setup_done) {
 		ret = configure_event_crypto_adapter(mode);
-		if (!ret) {
+		if (ret)
+			return ret;
+		if (!params.internal_port_op_fwd) {
 			qid = TEST_CRYPTO_EV_QUEUE_ID;
 			ret = rte_event_port_link(evdev,
 				params.crypto_event_port_id, &qid, NULL, 1);
 			TEST_ASSERT(ret >= 0, "Failed to link queue %d "
 					"port=%u\n", qid,
 					params.crypto_event_port_id);
-		} else {
-			return ret;
 		}
 		crypto_adapter_setup_done = 1;
 	}
-- 
2.25.1


  parent reply	other threads:[~2021-04-08 19:24 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18 18:12 [dpdk-dev] [PATCH] [RFC] eventdev: introduce " Akhil Goyal
2021-03-26  9:12 ` [dpdk-dev] [PATCH v1 0/2] Enhancements to crypto adapter forward mode Shijith Thotton
2021-03-26  9:12   ` [dpdk-dev] [PATCH v1 1/2] eventdev: introduce crypto adapter enqueue API Shijith Thotton
2021-03-27  6:04     ` Pavan Nikhilesh Bhagavatula
2021-03-26  9:12   ` [dpdk-dev] [PATCH v1 2/2] event/octeontx2: support crypto adapter forward mode Shijith Thotton
2021-03-27  6:27     ` Pavan Nikhilesh Bhagavatula
2021-03-29  4:31       ` Shijith Thotton
2021-03-29 15:04   ` [dpdk-dev] [PATCH v2 0/2] Enhancements to " Shijith Thotton
2021-03-29 15:04     ` [dpdk-dev] [PATCH v2 1/2] eventdev: introduce crypto adapter enqueue API Shijith Thotton
2021-03-29 15:04     ` [dpdk-dev] [PATCH v2 2/2] event/octeontx2: support crypto adapter forward mode Shijith Thotton
2021-04-02 15:03     ` [dpdk-dev] [PATCH v3 0/3] Enhancements to " Shijith Thotton
2021-04-02 15:03       ` [dpdk-dev] [PATCH v3 1/3] eventdev: introduce crypto adapter enqueue API Shijith Thotton
2021-04-02 15:03       ` [dpdk-dev] [PATCH v3 2/3] event/octeontx2: support crypto adapter forward mode Shijith Thotton
2021-04-02 15:03       ` [dpdk-dev] [PATCH v3 3/3] test/event_crypto: use crypto adapter enqueue API Shijith Thotton
2021-04-02 17:01       ` [dpdk-dev] [PATCH v4 0/3] Enhancements to crypto adapter forward mode Shijith Thotton
2021-04-02 17:01         ` [dpdk-dev] [PATCH v4 1/3] eventdev: introduce crypto adapter enqueue API Shijith Thotton
2021-04-03 12:32           ` Gujjar, Abhinandan S
2021-04-05 17:40             ` Akhil Goyal
2021-04-07 15:28               ` Gujjar, Abhinandan S
2021-04-08 14:56                 ` Akhil Goyal
2021-04-08 16:57                   ` Gujjar, Abhinandan S
2021-04-08 18:44                     ` Akhil Goyal
2021-04-02 17:01         ` [dpdk-dev] [PATCH v4 2/3] event/octeontx2: support crypto adapter forward mode Shijith Thotton
2021-04-03 10:20           ` Gujjar, Abhinandan S
2021-04-06 15:01             ` Anoob Joseph
2021-04-07 15:06               ` Gujjar, Abhinandan S
2021-04-08  6:45                 ` Shijith Thotton
2021-04-02 17:01         ` [dpdk-dev] [PATCH v4 3/3] test/event_crypto: use crypto adapter enqueue API Shijith Thotton
2021-04-03 11:08           ` Gujjar, Abhinandan S
2021-04-05  6:10             ` Shijith Thotton
2021-04-08 19:24         ` [dpdk-dev] [PATCH v5 0/3] Enhancements to crypto adapter forward mode Shijith Thotton
2021-04-08 19:24           ` [dpdk-dev] [PATCH v5 1/3] eventdev: introduce crypto adapter enqueue API Shijith Thotton
2021-04-08 19:24           ` [dpdk-dev] [PATCH v5 2/3] event/octeontx2: support crypto adapter forward mode Shijith Thotton
2021-04-08 19:24           ` Shijith Thotton [this message]
2021-04-09 14:00           ` [dpdk-dev] [PATCH v6 0/3] Enhancements to " Shijith Thotton
2021-04-09 14:00             ` [dpdk-dev] [PATCH v6 1/3] eventdev: introduce crypto adapter enqueue API Shijith Thotton
2021-04-09 14:00             ` [dpdk-dev] [PATCH v6 2/3] event/octeontx2: support crypto adapter forward mode Shijith Thotton
2021-04-09 14:00             ` [dpdk-dev] [PATCH v6 3/3] test/event_crypto: use crypto adapter enqueue API Shijith Thotton
2021-04-12  5:10               ` Gujjar, Abhinandan S
2021-04-12  7:02                 ` Shijith Thotton
2021-04-12  7:24                   ` Gujjar, Abhinandan S
2021-04-12  7:35                     ` Shijith Thotton
2021-04-12 13:52                       ` Shijith Thotton
2021-04-12 15:00                         ` Gujjar, Abhinandan S
2021-04-12  7:43             ` [dpdk-dev] [PATCH v7 0/3] Enhancements to crypto adapter forward mode Shijith Thotton
2021-04-12  7:43               ` [dpdk-dev] [PATCH v7 1/3] eventdev: introduce crypto adapter enqueue API Shijith Thotton
2021-04-13  3:23                 ` Gujjar, Abhinandan S
2021-04-12  7:43               ` [dpdk-dev] [PATCH v7 2/3] event/octeontx2: support crypto adapter forward mode Shijith Thotton
2021-04-13  3:34                 ` Gujjar, Abhinandan S
2021-04-13  8:51                   ` Shijith Thotton
2021-04-12  7:43               ` [dpdk-dev] [PATCH v7 3/3] test/event_crypto: use crypto adapter enqueue API Shijith Thotton
2021-04-13  3:45                 ` Gujjar, Abhinandan S
2021-04-13 10:29               ` [dpdk-dev] [PATCH v8 0/3] Enhancements to crypto adapter forward mode Shijith Thotton
2021-04-13 10:29                 ` [dpdk-dev] [PATCH v8 1/3] eventdev: introduce crypto adapter enqueue API Shijith Thotton
2021-04-14  7:28                   ` Jerin Jacob Kollanukkaran
2021-04-14  7:58                     ` Akhil Goyal
2021-04-14  8:18                       ` Thomas Monjalon
2021-04-14  8:39                         ` [dpdk-dev] [EXT] " Akhil Goyal
2021-04-14  8:43                           ` Thomas Monjalon
2021-04-14 12:20                   ` [dpdk-dev] [PATCH v9 0/4] Enhancements to crypto adapter forward mode gakhil
2021-04-14 12:20                     ` [dpdk-dev] [PATCH v9 1/4] eventdev: introduce crypto adapter enqueue API gakhil
2021-04-14 18:04                       ` [dpdk-dev] [PATCH v10 0/4] Enhancements to crypto adapter forward mode gakhil
2021-04-14 18:04                         ` [dpdk-dev] [PATCH v10 1/4] devtools: add exception for reserved fields gakhil
2021-04-14 20:57                           ` David Marchand
2021-04-15  5:32                             ` [dpdk-dev] [EXT] " Akhil Goyal
2021-04-15  7:26                               ` David Marchand
2021-04-15  8:25                                 ` Bruce Richardson
2021-04-15  8:27                                   ` Thomas Monjalon
2021-04-15  8:31                                 ` Akhil Goyal
2021-04-15 19:56                                   ` Stephen Hemminger
2021-04-15  9:13                           ` [dpdk-dev] [PATCH v11 0/3] Enhancements to crypto adapter forward mode gakhil
2021-04-15  9:13                             ` [dpdk-dev] [PATCH v11 1/3] eventdev: introduce crypto adapter enqueue API gakhil
2021-04-17 16:54                               ` Jerin Jacob
2021-04-15  9:13                             ` [dpdk-dev] [PATCH v11 2/3] event/octeontx2: support crypto adapter forward mode gakhil
2021-04-15  9:13                             ` [dpdk-dev] [PATCH v11 3/3] test/event_crypto: use crypto adapter enqueue API gakhil
2021-04-14 18:04                         ` [dpdk-dev] [PATCH v10 2/4] eventdev: introduce " gakhil
2021-04-14 18:04                         ` [dpdk-dev] [PATCH v10 3/4] event/octeontx2: support crypto adapter forward mode gakhil
2021-04-14 18:04                         ` [dpdk-dev] [PATCH v10 4/4] test/event_crypto: use crypto adapter enqueue API gakhil
2021-04-14 12:20                     ` [dpdk-dev] [PATCH v9 2/4] event/octeontx2: support crypto adapter forward mode gakhil
2021-04-14 12:20                     ` [dpdk-dev] [PATCH v9 3/4] test/event_crypto: use crypto adapter enqueue API gakhil
2021-04-14 12:20                     ` [dpdk-dev] [PATCH v9 4/4] devtools: add exception for reserved fields gakhil
2021-04-14 12:53                       ` Thomas Monjalon
2021-04-14 14:16                         ` [dpdk-dev] [EXT] " Akhil Goyal
2021-04-14 14:22                           ` Thomas Monjalon
2021-04-14 17:56                             ` Akhil Goyal
2021-04-13 10:29                 ` [dpdk-dev] [PATCH v8 2/3] event/octeontx2: support crypto adapter forward mode Shijith Thotton
2021-04-13 10:29                 ` [dpdk-dev] [PATCH v8 3/3] test/event_crypto: use crypto adapter enqueue API Shijith Thotton
2021-04-13 19:40                   ` Jerin Jacob
2021-03-30  4:04   ` [dpdk-dev] [PATCH v1 0/2] Enhancements to crypto adapter forward mode Jerin Jacob
2021-03-30  4:57     ` Gujjar, Abhinandan S

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0194df2a6170aa01fcf88bab33e2b38fcd5949a3.1617909091.git.sthotton@marvell.com \
    --to=sthotton@marvell.com \
    --cc=abhinandan.gujjar@intel.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=erik.g.carrillo@intel.com \
    --cc=g.singh@nxp.com \
    --cc=gakhil@marvell.com \
    --cc=harry.van.haaren@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jay.jayatheerthan@intel.com \
    --cc=jerinj@marvell.com \
    --cc=matan@nvidia.com \
    --cc=nipun.gupta@nxp.com \
    --cc=pbhagavatula@marvell.com \
    --cc=roy.fan.zhang@intel.com \
    --cc=sachin.saxena@oss.nxp.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).