diff mbox series

[v6,3/3] test/event_crypto: use crypto adapter enqueue API

Message ID 2a75b99054e6befb8e3b2583ba645b643a758082.1617972131.git.sthotton@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers show
Series Enhancements to crypto adapter forward mode | expand

Checks

Context Check Description
ci/Intel-compilation fail apply issues
ci/checkpatch success coding style OK

Commit Message

Shijith Thotton April 9, 2021, 2 p.m. UTC
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(-)

Comments

Gujjar, Abhinandan S April 12, 2021, 5:10 a.m. UTC | #1
Hi Shijith,

CI is failing for this patch -> ci/Intel-compilation 	fail 	apply issues
Whereas CI is not running for other patches. Could you please check?

Regards
Abhinandan

> -----Original Message-----
> From: Shijith Thotton <sthotton@marvell.com>
> Sent: Friday, April 9, 2021 7:30 PM
> To: dev@dpdk.org
> Cc: Shijith Thotton <sthotton@marvell.com>; thomas@monjalon.net;
> jerinj@marvell.com; Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> hemant.agrawal@nxp.com; nipun.gupta@nxp.com;
> sachin.saxena@oss.nxp.com; anoobj@marvell.com; matan@nvidia.com;
> Zhang, Roy Fan <roy.fan.zhang@intel.com>; g.singh@nxp.com; Carrillo, Erik
> G <erik.g.carrillo@intel.com>; Jayatheerthan, Jay
> <jay.jayatheerthan@intel.com>; pbhagavatula@marvell.com; Van Haaren,
> Harry <harry.van.haaren@intel.com>; Akhil Goyal <gakhil@marvell.com>
> Subject: [PATCH v6 3/3] test/event_crypto: use crypto adapter enqueue API
> 
> 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
Shijith Thotton April 12, 2021, 7:02 a.m. UTC | #2
On Mon, Apr 12, 2021 at 05:10:56AM +0000, Gujjar, Abhinandan S wrote:
> Hi Shijith,
> 
> CI is failing for this patch -> ci/Intel-compilation 	fail 	apply issues
> Whereas CI is not running for other patches. Could you please check?
> 
[snip]

Hi Abhinandan,

Full CI is run only for the last patch in the series and checkpatch is run for
the remaining. I have rebased the series (v6) on top of dpdk-next-eventdev, but
ci/Intel-compilation is using dpdk repo and apply is failing.

Thanks,
Shijith
Gujjar, Abhinandan S April 12, 2021, 7:24 a.m. UTC | #3
Hi Shijith,

> -----Original Message-----
> From: Shijith Thotton <shijith.thotton@gmail.com>
> Sent: Monday, April 12, 2021 12:33 PM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> Cc: Shijith Thotton <sthotton@marvell.com>; dev@dpdk.org;
> thomas@monjalon.net; jerinj@marvell.com; hemant.agrawal@nxp.com;
> nipun.gupta@nxp.com; sachin.saxena@oss.nxp.com; anoobj@marvell.com;
> matan@nvidia.com; Zhang, Roy Fan <roy.fan.zhang@intel.com>;
> g.singh@nxp.com; Carrillo, Erik G <erik.g.carrillo@intel.com>; Jayatheerthan,
> Jay <jay.jayatheerthan@intel.com>; pbhagavatula@marvell.com; Van
> Haaren, Harry <harry.van.haaren@intel.com>; Akhil Goyal
> <gakhil@marvell.com>
> Subject: Re: [dpdk-dev] [PATCH v6 3/3] test/event_crypto: use crypto
> adapter enqueue API
> 
> On Mon, Apr 12, 2021 at 05:10:56AM +0000, Gujjar, Abhinandan S wrote:
> > Hi Shijith,
> >
> > CI is failing for this patch -> ci/Intel-compilation 	fail 	apply issues
> > Whereas CI is not running for other patches. Could you please check?
> >
> [snip]
> 
> Hi Abhinandan,
> 
> Full CI is run only for the last patch in the series and checkpatch is run for the
> remaining. I have rebased the series (v6) on top of dpdk-next-eventdev, but
> ci/Intel-compilation is using dpdk repo and apply is failing.
Looking at other patches, I somehow feel that full CI is not running on your patch set.
Not sure what is missing.
> 
> Thanks,
> Shijith
Shijith Thotton April 12, 2021, 7:35 a.m. UTC | #4
On Mon, Apr 12, 2021 at 07:24:21AM +0000, Gujjar, Abhinandan S wrote:
> Hi Shijith,
> 
> > -----Original Message-----
> > From: Shijith Thotton <shijith.thotton@gmail.com>
> > Sent: Monday, April 12, 2021 12:33 PM
> > To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> > Cc: Shijith Thotton <sthotton@marvell.com>; dev@dpdk.org;
> > thomas@monjalon.net; jerinj@marvell.com; hemant.agrawal@nxp.com;
> > nipun.gupta@nxp.com; sachin.saxena@oss.nxp.com; anoobj@marvell.com;
> > matan@nvidia.com; Zhang, Roy Fan <roy.fan.zhang@intel.com>;
> > g.singh@nxp.com; Carrillo, Erik G <erik.g.carrillo@intel.com>; Jayatheerthan,
> > Jay <jay.jayatheerthan@intel.com>; pbhagavatula@marvell.com; Van
> > Haaren, Harry <harry.van.haaren@intel.com>; Akhil Goyal
> > <gakhil@marvell.com>
> > Subject: Re: [dpdk-dev] [PATCH v6 3/3] test/event_crypto: use crypto
> > adapter enqueue API
> > 
> > On Mon, Apr 12, 2021 at 05:10:56AM +0000, Gujjar, Abhinandan S wrote:
> > > Hi Shijith,
> > >
> > > CI is failing for this patch -> ci/Intel-compilation 	fail 	apply issues
> > > Whereas CI is not running for other patches. Could you please check?
> > >
> > [snip]
> > 
> > Hi Abhinandan,
> > 
> > Full CI is run only for the last patch in the series and checkpatch is run for the
> > remaining. I have rebased the series (v6) on top of dpdk-next-eventdev, but
> > ci/Intel-compilation is using dpdk repo and apply is failing.
> Looking at other patches, I somehow feel that full CI is not running on your patch set.
> Not sure what is missing.

I will rebase and send again.

Thanks,
Shijith
Shijith Thotton April 12, 2021, 1:52 p.m. UTC | #5
On Mon, Apr 12, 2021 at 01:05:45PM +0530, Shijith Thotton wrote:
> On Mon, Apr 12, 2021 at 07:24:21AM +0000, Gujjar, Abhinandan S wrote:
> > Hi Shijith,
> > 
> > > -----Original Message-----
> > > From: Shijith Thotton <shijith.thotton@gmail.com>
> > > Sent: Monday, April 12, 2021 12:33 PM
> > > To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> > > Cc: Shijith Thotton <sthotton@marvell.com>; dev@dpdk.org;
> > > thomas@monjalon.net; jerinj@marvell.com; hemant.agrawal@nxp.com;
> > > nipun.gupta@nxp.com; sachin.saxena@oss.nxp.com; anoobj@marvell.com;
> > > matan@nvidia.com; Zhang, Roy Fan <roy.fan.zhang@intel.com>;
> > > g.singh@nxp.com; Carrillo, Erik G <erik.g.carrillo@intel.com>; Jayatheerthan,
> > > Jay <jay.jayatheerthan@intel.com>; pbhagavatula@marvell.com; Van
> > > Haaren, Harry <harry.van.haaren@intel.com>; Akhil Goyal
> > > <gakhil@marvell.com>
> > > Subject: Re: [dpdk-dev] [PATCH v6 3/3] test/event_crypto: use crypto
> > > adapter enqueue API
> > > 
> > > On Mon, Apr 12, 2021 at 05:10:56AM +0000, Gujjar, Abhinandan S wrote:
> > > > Hi Shijith,
> > > >
> > > > CI is failing for this patch -> ci/Intel-compilation 	fail 	apply issues
> > > > Whereas CI is not running for other patches. Could you please check?
> > > >
> > > [snip]
> > > 
> > > Hi Abhinandan,
> > > 
> > > Full CI is run only for the last patch in the series and checkpatch is run for the
> > > remaining. I have rebased the series (v6) on top of dpdk-next-eventdev, but
> > > ci/Intel-compilation is using dpdk repo and apply is failing.
> > Looking at other patches, I somehow feel that full CI is not running on your patch set.
> > Not sure what is missing.
> 
> I will rebase and send again.
> 

Issue should be fixed once dpdk-next-eventdev syncs with dpdk repo. I will send
again after the sync. Please let me know if any further comments on the series.

Also please review https://mails.dpdk.org/archives/dev/2021-April/205249.html.

Thanks,
Shijith
Gujjar, Abhinandan S April 12, 2021, 3 p.m. UTC | #6
> -----Original Message-----
> From: Shijith Thotton <shijith.thotton@gmail.com>
> Sent: Monday, April 12, 2021 7:22 PM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> Cc: Shijith Thotton <sthotton@marvell.com>; dev@dpdk.org;
> thomas@monjalon.net; jerinj@marvell.com; hemant.agrawal@nxp.com;
> nipun.gupta@nxp.com; sachin.saxena@oss.nxp.com; anoobj@marvell.com;
> matan@nvidia.com; Zhang, Roy Fan <roy.fan.zhang@intel.com>;
> g.singh@nxp.com; Carrillo, Erik G <erik.g.carrillo@intel.com>; Jayatheerthan,
> Jay <jay.jayatheerthan@intel.com>; pbhagavatula@marvell.com; Van
> Haaren, Harry <harry.van.haaren@intel.com>; Akhil Goyal
> <gakhil@marvell.com>
> Subject: Re: [dpdk-dev] [PATCH v6 3/3] test/event_crypto: use crypto
> adapter enqueue API
> 
> On Mon, Apr 12, 2021 at 01:05:45PM +0530, Shijith Thotton wrote:
> > On Mon, Apr 12, 2021 at 07:24:21AM +0000, Gujjar, Abhinandan S wrote:
> > > Hi Shijith,
> > >
> > > > -----Original Message-----
> > > > From: Shijith Thotton <shijith.thotton@gmail.com>
> > > > Sent: Monday, April 12, 2021 12:33 PM
> > > > To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> > > > Cc: Shijith Thotton <sthotton@marvell.com>; dev@dpdk.org;
> > > > thomas@monjalon.net; jerinj@marvell.com;
> hemant.agrawal@nxp.com;
> > > > nipun.gupta@nxp.com; sachin.saxena@oss.nxp.com;
> > > > anoobj@marvell.com; matan@nvidia.com; Zhang, Roy Fan
> > > > <roy.fan.zhang@intel.com>; g.singh@nxp.com; Carrillo, Erik G
> > > > <erik.g.carrillo@intel.com>; Jayatheerthan, Jay
> > > > <jay.jayatheerthan@intel.com>; pbhagavatula@marvell.com; Van
> > > > Haaren, Harry <harry.van.haaren@intel.com>; Akhil Goyal
> > > > <gakhil@marvell.com>
> > > > Subject: Re: [dpdk-dev] [PATCH v6 3/3] test/event_crypto: use
> > > > crypto adapter enqueue API
> > > >
> > > > On Mon, Apr 12, 2021 at 05:10:56AM +0000, Gujjar, Abhinandan S
> wrote:
> > > > > Hi Shijith,
> > > > >
> > > > > CI is failing for this patch -> ci/Intel-compilation 	fail 	apply issues
> > > > > Whereas CI is not running for other patches. Could you please check?
> > > > >
> > > > [snip]
> > > >
> > > > Hi Abhinandan,
> > > >
> > > > Full CI is run only for the last patch in the series and
> > > > checkpatch is run for the remaining. I have rebased the series
> > > > (v6) on top of dpdk-next-eventdev, but ci/Intel-compilation is using
> dpdk repo and apply is failing.
> > > Looking at other patches, I somehow feel that full CI is not running on
> your patch set.
> > > Not sure what is missing.
> >
> > I will rebase and send again.
> >
> 
> Issue should be fixed once dpdk-next-eventdev syncs with dpdk repo. I will
> send again after the sync. Please let me know if any further comments on
> the series.
> 
> Also please review https://mails.dpdk.org/archives/dev/2021-
> April/205249.html.
Sure Shijith.
> 
> Thanks,
> Shijith
diff mbox series

Patch

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;
 	}