[dpdk-dev,2/2] example/ipsec-secgw: add support for cryptodev_start

Message ID 1469098444-2156-2-git-send-email-hemant.agrawal@nxp.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Hemant Agrawal July 21, 2016, 10:54 a.m. UTC
  The usual device sequence is configure, queue setup and start.
Crypto device should be started before use.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 examples/ipsec-secgw/ipsec-secgw.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Thomas Monjalon July 22, 2016, 9:44 a.m. UTC | #1
It seems cryptodev_start() calls empty driver functions,
and is not called in the example applications.

This a v2 of patches from Hemant Agrawal and Akhil Goyal.
There are some improvements to make error messages more
consistent with existing ones and keep the existing error return.

Are they important fixes for 16.07? Please advise.

Hemant Agrawal (2):
  examples/l2fwd-crypto: call start function
  examples/ipsec-secgw: call start function

 examples/ipsec-secgw/ipsec-secgw.c | 4 ++++
 examples/l2fwd-crypto/main.c       | 7 +++++++
 2 files changed, 11 insertions(+)
  
De Lara Guarch, Pablo July 22, 2016, 10:20 a.m. UTC | #2
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Friday, July 22, 2016 10:44 AM
> To: Akhil Goyal; Hemant Agrawal; Doherty, Declan; De Lara Guarch, Pablo
> Cc: dev@dpdk.org
> Subject: [PATCH v2 0/2] cryptodev_start fixes
> 
> It seems cryptodev_start() calls empty driver functions,
> and is not called in the example applications.
> 
> This a v2 of patches from Hemant Agrawal and Akhil Goyal.
> There are some improvements to make error messages more
> consistent with existing ones and keep the existing error return.
> 
> Are they important fixes for 16.07? Please advise.
> 
> Hemant Agrawal (2):
>   examples/l2fwd-crypto: call start function
>   examples/ipsec-secgw: call start function
> 
>  examples/ipsec-secgw/ipsec-secgw.c | 4 ++++
>  examples/l2fwd-crypto/main.c       | 7 +++++++
>  2 files changed, 11 insertions(+)
> 
> --
> 2.7.0

Series-acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
  
Thomas Monjalon July 22, 2016, 10:41 a.m. UTC | #3
2016-07-22 10:20, De Lara Guarch, Pablo:
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > It seems cryptodev_start() calls empty driver functions,
> > and is not called in the example applications.
> > 
> > This a v2 of patches from Hemant Agrawal and Akhil Goyal.
> > There are some improvements to make error messages more
> > consistent with existing ones and keep the existing error return.
> > 
> > Are they important fixes for 16.07? Please advise.
> > 
> > Hemant Agrawal (2):
> >   examples/l2fwd-crypto: call start function
> >   examples/ipsec-secgw: call start function
> 
> Series-acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied, thanks
  

Patch

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 1ca144b..302499c 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -1273,6 +1273,10 @@  cryptodevs_init(void)
 						&qp_conf, dev_conf.socket_id))
 				rte_panic("Failed to setup queue %u for "
 						"cdev_id %u\n",	0, cdev_id);
+		/* Start device */
+		if (rte_cryptodev_start(cdev_id))
+			rte_panic("Failed to start crypto dev for "
+						"cdev_id=%u\n", cdev_id);
 	}
 
 	printf("\n");