[dpdk-dev,1/2] example/l2fwd-crypto: add support for cryptodev_start

Message ID 1469098444-2156-1-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/l2fwd-crypto/main.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Patch

diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index dd39cc1..62e1c39 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -1793,6 +1793,12 @@  initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
 		if (retval < 0) {
 			printf("Failed to setup queue pair %u on cryptodev %u",
 					0, cdev_id);
+		}
+		/* Start device */
+		retval = rte_cryptodev_start(cdev_id);
+		if (retval < 0) {
+			printf("rte_cryptodev_start:err=%d, cdev_id=%u\n",
+			       retval, (unsigned)cdev_id);
 			return -1;
 		}