* [dpdk-dev] [PATCH] test/event_crypto: add check for session init failure
@ 2019-09-06 10:42 Hemant Agrawal
2019-09-12 15:08 ` Gujjar, Abhinandan S
0 siblings, 1 reply; 3+ messages in thread
From: Hemant Agrawal @ 2019-09-06 10:42 UTC (permalink / raw)
To: dev; +Cc: jerinj, abhinandan.gujjar, Hemant Agrawal
Mismatch in algo or sec capability can cause session to fail.
This patch handle it and return error timely.
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
app/test/test_event_crypto_adapter.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 73655020d..e7bf80978 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -199,8 +199,9 @@ test_op_forward_mode(uint8_t session_less)
TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
/* Create Crypto session*/
- rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
+ ret = rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
&cipher_xform, params.session_priv_mpool);
+ TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
evdev, &cap);
@@ -398,8 +399,10 @@ test_op_new_mode(uint8_t session_less)
rte_cryptodev_sym_session_set_user_data(sess,
&m_data, sizeof(m_data));
}
- rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
+ ret = rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
&cipher_xform, params.session_priv_mpool);
+ TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
+
rte_crypto_op_attach_sym_session(op, sess);
} else {
struct rte_crypto_sym_xform *first_xform;
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] test/event_crypto: add check for session init failure
2019-09-06 10:42 [dpdk-dev] [PATCH] test/event_crypto: add check for session init failure Hemant Agrawal
@ 2019-09-12 15:08 ` Gujjar, Abhinandan S
2019-09-13 10:28 ` Jerin Jacob
0 siblings, 1 reply; 3+ messages in thread
From: Gujjar, Abhinandan S @ 2019-09-12 15:08 UTC (permalink / raw)
To: Hemant Agrawal, dev; +Cc: jerinj
Acked-by: abhinandan.gujjar@intel.com
> -----Original Message-----
> From: Hemant Agrawal <hemant.agrawal@nxp.com>
> Sent: Friday, September 6, 2019 4:12 PM
> To: dev@dpdk.org
> Cc: jerinj@marvell.com; Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> Hemant Agrawal <hemant.agrawal@nxp.com>
> Subject: [PATCH] test/event_crypto: add check for session init failure
>
> Mismatch in algo or sec capability can cause session to fail.
> This patch handle it and return error timely.
>
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
> app/test/test_event_crypto_adapter.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/app/test/test_event_crypto_adapter.c
> b/app/test/test_event_crypto_adapter.c
> index 73655020d..e7bf80978 100644
> --- a/app/test/test_event_crypto_adapter.c
> +++ b/app/test/test_event_crypto_adapter.c
> @@ -199,8 +199,9 @@ test_op_forward_mode(uint8_t session_less)
> TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
>
> /* Create Crypto session*/
> - rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
> + ret = rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
> &cipher_xform, params.session_priv_mpool);
> + TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
>
> ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> evdev, &cap);
> @@ -398,8 +399,10 @@ test_op_new_mode(uint8_t session_less)
> rte_cryptodev_sym_session_set_user_data(sess,
> &m_data, sizeof(m_data));
> }
> - rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
> + ret = rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
> &cipher_xform, params.session_priv_mpool);
> + TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
> +
> rte_crypto_op_attach_sym_session(op, sess);
> } else {
> struct rte_crypto_sym_xform *first_xform;
> --
> 2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] test/event_crypto: add check for session init failure
2019-09-12 15:08 ` Gujjar, Abhinandan S
@ 2019-09-13 10:28 ` Jerin Jacob
0 siblings, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2019-09-13 10:28 UTC (permalink / raw)
To: Gujjar, Abhinandan S; +Cc: Hemant Agrawal, dev, jerinj
On Thu, Sep 12, 2019 at 8:40 PM Gujjar, Abhinandan S
<abhinandan.gujjar@intel.com> wrote:
>
> Acked-by: abhinandan.gujjar@intel.com
Changed to Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
and
Applied to dpdk-next-eventdev/master. Thanks.
> > -----Original Message-----
> > From: Hemant Agrawal <hemant.agrawal@nxp.com>
> > Sent: Friday, September 6, 2019 4:12 PM
> > To: dev@dpdk.org
> > Cc: jerinj@marvell.com; Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> > Hemant Agrawal <hemant.agrawal@nxp.com>
> > Subject: [PATCH] test/event_crypto: add check for session init failure
> >
> > Mismatch in algo or sec capability can cause session to fail.
> > This patch handle it and return error timely.
> >
> > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> > ---
> > app/test/test_event_crypto_adapter.c | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/app/test/test_event_crypto_adapter.c
> > b/app/test/test_event_crypto_adapter.c
> > index 73655020d..e7bf80978 100644
> > --- a/app/test/test_event_crypto_adapter.c
> > +++ b/app/test/test_event_crypto_adapter.c
> > @@ -199,8 +199,9 @@ test_op_forward_mode(uint8_t session_less)
> > TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
> >
> > /* Create Crypto session*/
> > - rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
> > + ret = rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
> > &cipher_xform, params.session_priv_mpool);
> > + TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
> >
> > ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> > evdev, &cap);
> > @@ -398,8 +399,10 @@ test_op_new_mode(uint8_t session_less)
> > rte_cryptodev_sym_session_set_user_data(sess,
> > &m_data, sizeof(m_data));
> > }
> > - rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
> > + ret = rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
> > &cipher_xform, params.session_priv_mpool);
> > + TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
> > +
> > rte_crypto_op_attach_sym_session(op, sess);
> > } else {
> > struct rte_crypto_sym_xform *first_xform;
> > --
> > 2.17.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-09-13 10:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 10:42 [dpdk-dev] [PATCH] test/event_crypto: add check for session init failure Hemant Agrawal
2019-09-12 15:08 ` Gujjar, Abhinandan S
2019-09-13 10:28 ` Jerin Jacob
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).