[v2] Don't ignore pref_mode in odp_crypto.c

Message ID e879c512551905e8ebd37f59079416bd90c61525.1518513437.git.szymon.sliwa@linaro.org
State New
Headers show
Series
  • [v2] Don't ignore pref_mode in odp_crypto.c
Related show

Commit Message

Szymon Sliwa Feb. 13, 2018, 9:17 a.m.
From: Szymon Sliwa <szs@semihalf.com>

Take pref_mode into consideration when deciding between sync and async

Signed-off-by: Szymon Sliwa <szymon.sliwa@linaro.org>
---
 platform/linux-dpdk/odp_crypto.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Bill Fischofer Feb. 13, 2018, 1:28 p.m. | #1
Thanks. In future, can you please post these as PRs against
https://github.com/linaro/odp-dpdk.git ? We've pretty much switched over to
GitHub for all of our patch process.

On Tue, Feb 13, 2018 at 3:17 AM, Szymon Sliwa <szymon.sliwa@linaro.org>
wrote:

> From: Szymon Sliwa <szs@semihalf.com>
>
> Take pref_mode into consideration when deciding between sync and async
>
> Signed-off-by: Szymon Sliwa <szymon.sliwa@linaro.org>
> ---
>  platform/linux-dpdk/odp_crypto.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_
> crypto.c
> index 466df88..7c9c79b 100644
> --- a/platform/linux-dpdk/odp_crypto.c
> +++ b/platform/linux-dpdk/odp_crypto.c
> @@ -43,6 +43,7 @@ struct crypto_session_entry_s {
>                 } iv;
>                 odp_queue_t compl_queue; /**< Async mode completion
>                                               event queue */
> +               odp_crypto_op_mode_t pref_mode;
>                 odp_pool_t output_pool;  /**< Output buffer pool */
>  };
>
> @@ -917,6 +918,7 @@ int odp_crypto_session_create(odp_crypto_session_param_t
> *param,
>         entry->iv.length = param->iv.length;
>         entry->iv.data = param->iv.data;
>         entry->output_pool = param->output_pool;
> +       entry->pref_mode = param->pref_mode;
>         entry->compl_queue = param->compl_queue;
>
>         /* We're happy */
> @@ -1131,7 +1133,8 @@ int odp_crypto_operation(odp_crypto_op_param_t
> *param,
>         rte_crypto_op_free(op);
>
>         /* If specified during creation post event to completion queue */
> -       if (ODP_QUEUE_INVALID != entry->compl_queue) {
> +       if (ODP_QUEUE_INVALID != entry->compl_queue &&
> +                       entry->pref_mode == ODP_CRYPTO_ASYNC) {
>                 odp_event_t completion_event;
>                 odp_crypto_generic_op_result_t *op_result;
>
> --
> 2.7.4
>
> _______________________________________________
> lng-odp-dpdk mailing list
> lng-odp-dpdk@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp-dpdk
>
Szymon Śliwa Feb. 13, 2018, 2:17 p.m. | #2
ok, I will.

Regards,
Szymon

2018-02-13 14:28 GMT+01:00 Bill Fischofer <bill.fischofer@linaro.org>:

> Thanks. In future, can you please post these as PRs against
> https://github.com/linaro/odp-dpdk.git ? We've pretty much switched over
> to
> GitHub for all of our patch process.
>
> On Tue, Feb 13, 2018 at 3:17 AM, Szymon Sliwa <szymon.sliwa@linaro.org>
> wrote:
>
> > From: Szymon Sliwa <szs@semihalf.com>
> >
> > Take pref_mode into consideration when deciding between sync and async
> >
> > Signed-off-by: Szymon Sliwa <szymon.sliwa@linaro.org>
> > ---
> >  platform/linux-dpdk/odp_crypto.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_
> > crypto.c
> > index 466df88..7c9c79b 100644
> > --- a/platform/linux-dpdk/odp_crypto.c
> > +++ b/platform/linux-dpdk/odp_crypto.c
> > @@ -43,6 +43,7 @@ struct crypto_session_entry_s {
> >                 } iv;
> >                 odp_queue_t compl_queue; /**< Async mode completion
> >                                               event queue */
> > +               odp_crypto_op_mode_t pref_mode;
> >                 odp_pool_t output_pool;  /**< Output buffer pool */
> >  };
> >
> > @@ -917,6 +918,7 @@ int odp_crypto_session_create(odp_
> crypto_session_param_t
> > *param,
> >         entry->iv.length = param->iv.length;
> >         entry->iv.data = param->iv.data;
> >         entry->output_pool = param->output_pool;
> > +       entry->pref_mode = param->pref_mode;
> >         entry->compl_queue = param->compl_queue;
> >
> >         /* We're happy */
> > @@ -1131,7 +1133,8 @@ int odp_crypto_operation(odp_crypto_op_param_t
> > *param,
> >         rte_crypto_op_free(op);
> >
> >         /* If specified during creation post event to completion queue */
> > -       if (ODP_QUEUE_INVALID != entry->compl_queue) {
> > +       if (ODP_QUEUE_INVALID != entry->compl_queue &&
> > +                       entry->pref_mode == ODP_CRYPTO_ASYNC) {
> >                 odp_event_t completion_event;
> >                 odp_crypto_generic_op_result_t *op_result;
> >
> > --
> > 2.7.4
> >
> > _______________________________________________
> > lng-odp-dpdk mailing list
> > lng-odp-dpdk@lists.linaro.org
> > https://lists.linaro.org/mailman/listinfo/lng-odp-dpdk
> >
> _______________________________________________
> lng-odp-dpdk mailing list
> lng-odp-dpdk@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp-dpdk
>

Patch

diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_crypto.c
index 466df88..7c9c79b 100644
--- a/platform/linux-dpdk/odp_crypto.c
+++ b/platform/linux-dpdk/odp_crypto.c
@@ -43,6 +43,7 @@  struct crypto_session_entry_s {
 		} iv;
 		odp_queue_t compl_queue; /**< Async mode completion
 					      event queue */
+		odp_crypto_op_mode_t pref_mode;
 		odp_pool_t output_pool;  /**< Output buffer pool */
 };
 
@@ -917,6 +918,7 @@  int odp_crypto_session_create(odp_crypto_session_param_t *param,
 	entry->iv.length = param->iv.length;
 	entry->iv.data = param->iv.data;
 	entry->output_pool = param->output_pool;
+	entry->pref_mode = param->pref_mode;
 	entry->compl_queue = param->compl_queue;
 
 	/* We're happy */
@@ -1131,7 +1133,8 @@  int odp_crypto_operation(odp_crypto_op_param_t *param,
 	rte_crypto_op_free(op);
 
 	/* If specified during creation post event to completion queue */
-	if (ODP_QUEUE_INVALID != entry->compl_queue) {
+	if (ODP_QUEUE_INVALID != entry->compl_queue &&
+			entry->pref_mode == ODP_CRYPTO_ASYNC) {
 		odp_event_t completion_event;
 		odp_crypto_generic_op_result_t *op_result;