Skip to contentSkip to conversation

cryptodev: API change to rte_crypto_op bursts

PATCH In review Declan Doherty 6 participants 62 messages Jan 30, 2016 – Mar 15, 2016 Page 1 of 2

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cryptodev: API change to rte_crypto_op bursts

This patch modifies the crypto burst enqueue/dequeue APIs to operate on bursts rte_crypto_op's rather than the current implementation which operates on rte_mbuf bursts which simplifies the burst processing in the crypto PMDs and the use of crypto operations in general.

The changes also separates the symmetric operation parameters from the more general operation parameters, this will simplify the integration of asymmetric crypto operations in the future.

As well as the changes to the crypto APIs this patch adds function for managing rte_crypto_op pools to the cryptodev API. It modifies the existing PMDs, unit tests and sample application to work with the modified APIs and finally removes the now unused rte_mbuf_offload library.

---
 MAINTAINERS                                        |   4 -
 app/test/test_cryptodev.c                          | 713 +++++++++++----------
 app/test/test_cryptodev.h                          |   8 +-
 app/test/test_cryptodev_perf.c                     | 242 +++----
 config/common_bsdapp                               |   7 -
 config/common_linuxapp                             |   7 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 182 +++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  12 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   2 +-
 drivers/crypto/qat/qat_crypto.c                    | 117 ++--
 drivers/crypto/qat/qat_crypto.h                    |  10 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   4 +-
 examples/l2fwd-crypto/main.c                       | 229 +++----
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/rte_crypto.h                  | 578 ++++++++++++-----
 lib/librte_cryptodev/rte_cryptodev.c               |  77 +++
 lib/librte_cryptodev/rte_cryptodev.h               | 105 +--
 lib/librte_cryptodev/rte_cryptodev_version.map     |   1 +
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 307 ---------
 .../rte_mbuf_offload_version.map                   |   7 -
 24 files changed, 1342 insertions(+), 1430 deletions(-)
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
MAINTAINERS +0 -4
index b90aeea..7082e20 100644
@@ -218,10 +218,6 @@ F: lib/librte_mbuf/
 F: doc/guides/prog_guide/mbuf_lib.rst
 F: app/test/test_mbuf.c
 
-Packet buffer offload - EXPERIMENTAL
-M: Declan Doherty <[email protected]>
-F: lib/librte_mbuf_offload/
-
 Ethernet API
 M: Thomas Monjalon <[email protected]>
 F: lib/librte_ether/
app/test/test_cryptodev.c +378 -335

1,001 lines not on this page · raw message

app/test/test_cryptodev.h +4 -4
index 034393e..2491ca5 100644
@@ -32,8 +32,6 @@
 #ifndef TEST_CRYPTODEV_H_
 #define TEST_CRYPTODEV_H_
 
-#define HEX_DUMP 0
-
 #define FALSE                           0
 #define TRUE                            1
 
@@ -47,8 +45,9 @@
 #define DEFAULT_NUM_XFORMS              (2)
 #define NUM_MBUFS                       (8191)
 #define MBUF_CACHE_SIZE                 (250)
-#define MBUF_SIZE   (2048 + DIGEST_BYTE_LENGTH_SHA512 + \
-				sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATAPAYLOAD_SIZE		(2048 + DIGEST_BYTE_LENGTH_SHA512)
+#define MBUF_SIZE			(sizeof(struct rte_mbuf) + \
+		RTE_PKTMBUF_HEADROOM + MBUF_DATAPAYLOAD_SIZE)
 
 #define BYTE_LENGTH(x)				(x/8)
 /* HASH DIGEST LENGTHS */
@@ -62,6 +61,7 @@
 #define AES_XCBC_MAC_KEY_SZ			(16)
 
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA1		(12)
+#define TRUNCATED_DIGEST_BYTE_LENGTH_SHA224		(14)
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA256		(16)
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA512		(32)
 
app/test/test_cryptodev_perf.c +128 -114

416 lines not on this page · raw message

config/common_bsdapp +0 -7
index ed7c31c..2868208 100644
@@ -362,13 +362,6 @@ CONFIG_RTE_MBUF_REFCNT_ATOMIC=y
 CONFIG_RTE_PKTMBUF_HEADROOM=128
 
 #
-# Compile librte_mbuf_offload
-# EXPERIMENTAL: API may change without prior notice
-#
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD=y
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD_DEBUG=n
-
-#
 # Compile librte_timer
 #
 CONFIG_RTE_LIBRTE_TIMER=y
config/common_linuxapp +0 -7
index 74bc515..65720a2 100644
@@ -379,13 +379,6 @@ CONFIG_RTE_MBUF_REFCNT_ATOMIC=y
 CONFIG_RTE_PKTMBUF_HEADROOM=128
 
 #
-# Compile librte_mbuf_offload
-# EXPERIMENTAL: API may change without prior notice
-#
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD=y
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD_DEBUG=n
-
-#
 # Compile librte_timer
 #
 CONFIG_RTE_LIBRTE_TIMER=y
doc/api/doxy-api-index.md +0 -1
index 7a91001..f626386 100644
@@ -104,7 +104,6 @@ There are many libraries, so their headers may be grouped by topics:
 
 - **containers**:
   [mbuf]               (@ref rte_mbuf.h),
-  [mbuf_offload]       (@ref rte_mbuf_offload.h),
   [ring]               (@ref rte_ring.h),
   [distributor]        (@ref rte_distributor.h),
   [reorder]            (@ref rte_reorder.h),
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +97 -85

328 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +6 -6
index 96d22f6..612877b 100644
@@ -76,11 +76,11 @@ aesni_mb_pmd_stats_get(struct rte_cryptodev *dev,
 	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
 		struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];
 
-		stats->enqueued_count += qp->qp_stats.enqueued_count;
-		stats->dequeued_count += qp->qp_stats.dequeued_count;
+		stats->enqueued_count += qp->stats.enqueued_count;
+		stats->dequeued_count += qp->stats.dequeued_count;
 
-		stats->enqueue_err_count += qp->qp_stats.enqueue_err_count;
-		stats->dequeue_err_count += qp->qp_stats.dequeue_err_count;
+		stats->enqueue_err_count += qp->stats.enqueue_err_count;
+		stats->dequeue_err_count += qp->stats.dequeue_err_count;
 	}
 }
 
@@ -93,7 +93,7 @@ aesni_mb_pmd_stats_reset(struct rte_cryptodev *dev)
 	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
 		struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];
 
-		memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+		memset(&qp->stats, 0, sizeof(qp->stats));
 	}
 }
 
@@ -196,7 +196,7 @@ aesni_mb_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 
 	qp->sess_mp = dev->data->session_pool;
 
-	memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+	memset(&qp->stats, 0, sizeof(qp->stats));
 
 	/* Initialise multi-buffer manager */
 	(*qp->ops->job.init_mgr)(&qp->mb_mgr);
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +1 -1
index 2f98609..304c85c 100644
@@ -150,7 +150,7 @@ struct aesni_mb_qp {
 	/**< Ring for placing process packets */
 	struct rte_mempool *sess_mp;
 	/**< Session Mempool */
-	struct rte_cryptodev_stats qp_stats;
+	struct rte_cryptodev_stats stats;
 	/**< Queue pair statistics */
 } __rte_cache_aligned;
 
drivers/crypto/qat/qat_crypto.c +59 -58

235 lines not on this page · raw message

drivers/crypto/qat/qat_crypto.h +6 -4
index d680364..c2c2cca 100644
@@ -115,10 +115,12 @@ extern void
 qat_crypto_sym_clear_session(struct rte_cryptodev *dev, void *session);
 
 
-uint16_t
-qat_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
+extern uint16_t
+qat_pmd_enqueue_sym_op_burst(void *qp, struct rte_crypto_op **ops,
+		uint16_t nb_ops);
 
-uint16_t
-qat_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
+extern uint16_t
+qat_pmd_dequeue_sym_op_burst(void *qp, struct rte_crypto_op **ops,
+		uint16_t nb_ops);
 
 #endif /* _QAT_CRYPTO_H_ */
drivers/crypto/qat/rte_qat_cryptodev.c +2 -2
index e500c1e..84086b1 100644
@@ -92,8 +92,8 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_
 	cryptodev->dev_type = RTE_CRYPTODEV_QAT_PMD;
 	cryptodev->dev_ops = &crypto_qat_ops;
 
-	cryptodev->enqueue_burst = qat_crypto_pkt_tx_burst;
-	cryptodev->dequeue_burst = qat_crypto_pkt_rx_burst;
+	cryptodev->enqueue_burst = qat_pmd_enqueue_sym_op_burst;
+	cryptodev->dequeue_burst = qat_pmd_dequeue_sym_op_burst;
 
 
 	internals = cryptodev->data->dev_private;
examples/l2fwd-crypto/main.c +104 -125

467 lines not on this page · raw message

lib/Makefile +0 -1
index ef172ea..4c5c1b4 100644
@@ -36,7 +36,6 @@ DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
 DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
 DIRS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += librte_mempool
 DIRS-$(CONFIG_RTE_LIBRTE_MBUF) += librte_mbuf
-DIRS-$(CONFIG_RTE_LIBRTE_MBUF_OFFLOAD) += librte_mbuf_offload
 DIRS-$(CONFIG_RTE_LIBRTE_TIMER) += librte_timer
 DIRS-$(CONFIG_RTE_LIBRTE_CFGFILE) += librte_cfgfile
 DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline
lib/librte_cryptodev/rte_crypto.h +423 -155

412 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.c +77 -0

77 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.h +56 -49

105 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev_version.map +1 -0
index ff8e93d..24e00bb 100644

Lines of this file are not shown. View the raw message.

lib/librte_mbuf/rte_mbuf.h +0 -6
index f234ac9..def2e33 100644

Lines of this file are not shown. View the raw message.

lib/librte_mbuf_offload/Makefile deleted +0 -52

52 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload.c deleted +0 -100

100 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload.h deleted +0 -307

307 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload_version.map deleted +0 -7
deleted file mode 100644
index 3d3b06a..0000000

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.5.0

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 17 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Declan Doherty
Sent: Saturday, January 30, 2016 1:07 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH] cryptodev: API change to rte_crypto_op bursts

This patch modifies the crypto burst enqueue/dequeue APIs to operate on bursts rte_crypto_op's rather than the current implementation which operates on rte_mbuf bursts which simplifies the burst processing in the crypto PMDs and the use of crypto operations in general.

The changes also separates the symmetric operation parameters from the more general operation parameters, this will simplify the integration of asymmetric crypto operations in the future.

Quoted 7 lines

As well as the changes to the crypto APIs this patch adds function for managing rte_crypto_op pools to the cryptodev API. It modifies the existing PMDs, unit tests and sample application to work with the modified APIs and finally removes the now unused rte_mbuf_offload library.

---

//snip//

lib/librte_cryptodev/rte_crypto.h struct rte_crypto_op { · line 633

Quoted 11 lines
lib/librte_cryptodev/rte_crypto.h +4 -1
+
+/**
+ * Reset the fields of a symmetric operation to their default values.
  *
  * @param	op	The crypto operation to be reset.
  */
 static inline void
-__rte_crypto_op_reset(struct rte_crypto_op *op)
+__rte_crypto_sym_op_reset(struct rte_crypto_sym_op *op)
 {
 	op->type = RTE_CRYPTO_OP_SESSIONLESS;

Maybe rename the type param in struct rte_crypto_sym_op to session_type and op param in this fn to sym_op?
To avoid confusion with op->type in function below.

Quoted 25 lines
lib/librte_cryptodev/rte_crypto.h +13 -2
-	op->dst.m = NULL;
-	op->dst.offset = 0;
+
+	op->m_src = NULL;
+	op->m_dst = NULL;
+}
+
+/**
+ * Reset the fields of a crypto operation to their default values.
+ *
+ * @param	op	The crypto operation to be reset.
+ * @param	type	The crypto operation type.
+ */
+static inline void
+__rte_crypto_op_reset(struct rte_crypto_op *op, enum rte_crypto_op_type

type)

lib/librte_cryptodev/rte_crypto.h +7 -0
+{
+	op->status = RTE_CRYPTO_OP_STATUS_NOT_SUBMITTED;
+
+	if (type == RTE_CRYPTO_OP_TYPE_SYMMETRIC) {
+		op->type = type;
+		__rte_crypto_sym_op_reset(&op->sym);
+	}
 }
#2 lore raw

v2 cover cryptodev API changes

In reply to Declan Doherty

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

This patch set is dependent on the following bug fixes patches:

aesni_mb: strict-aliasing rule compilation fix
(http://dpdk.org/ml/archives/dev/2016-February/033193.html)

qat:fix build on 32-bit systems
(http://dpdk.org/ml/archives/dev/2016-February/033442.html)

aesni_mb: fix wrong return value
(http://dpdk.org/ml/archives/dev/2016-February/033193.html)

Various fixes for L2fwd-crypto

Declan Doherty (1):
cryptodev: change burst API to be crypto op oriented

Fiona Trahe (1):
cryptodev: API tidy and changes to support future extensions

 MAINTAINERS                                        |   4 -
 app/test/test_cryptodev.c                          | 890 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_bsdapp                               |   7 -
 config/common_linuxapp                             |  11 +-
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 199 ++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  18 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   6 +-
 drivers/crypto/qat/qat_crypto.c                    | 154 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 281 ++++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 802 +++++++------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 113 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 183 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   1 +
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 307 -------
 .../rte_mbuf_offload_version.map                   |   7 -
 27 files changed, 2114 insertions(+), 2005 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
Signature · 1 line
2.5.0
#3 lore raw

PATCH v2 1/2 cryptodev: API tidy and changes to support future extensions

From: Fiona Trahe <[email protected]>

This patch splits symmetric specific definitions and functions away from the common crypto APIs to facilitate the future extension and expansion of the cryptodev framework, in order to allow asymmetric crypto operations to be introduced at a later date, as well as to clean the logical structure of the public includes. The patch also introduces the _sym prefix to symmetric specific structure and functions to improve clarity in the API.

---
 app/test/test_cryptodev.c                          | 164 +++---
 app/test/test_cryptodev_perf.c                     |  79 +--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         |  44 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |   6 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   4 +-
 drivers/crypto/qat/qat_crypto.c                    |  51 +-
 drivers/crypto/qat/qat_crypto.h                    |  10 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       |  33 +-
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 563 +------------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 613 +++++++++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               |  39 +-
 lib/librte_cryptodev/rte_cryptodev.h               |  80 ++-
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_mbuf_offload/rte_mbuf_offload.h         |  22 +-
 16 files changed, 912 insertions(+), 837 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
app/test/test_cryptodev.c +87 -77
index 62f8fb0..951b443 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -57,13 +57,13 @@ struct crypto_testsuite_params {
 };
 
 struct crypto_unittest_params {
-	struct rte_crypto_xform cipher_xform;
-	struct rte_crypto_xform auth_xform;
+	struct rte_crypto_sym_xform cipher_xform;
+	struct rte_crypto_sym_xform auth_xform;
 
-	struct rte_cryptodev_session *sess;
+	struct rte_cryptodev_sym_session *sess;
 
 	struct rte_mbuf_offload *ol;
-	struct rte_crypto_op *op;
+	struct rte_crypto_sym_op *op;
 
 	struct rte_mbuf *obuf, *ibuf;
 
@@ -78,7 +78,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 		struct crypto_unittest_params *ut_params);
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_param);
 
@@ -165,7 +165,8 @@ testsuite_setup(void)
 	ts_params->mbuf_ol_pool = rte_pktmbuf_offload_pool_create(
 			"MBUF_OFFLOAD_POOL",
 			NUM_MBUFS, MBUF_CACHE_SIZE,
-			DEFAULT_NUM_XFORMS * sizeof(struct rte_crypto_xform),
+			DEFAULT_NUM_XFORMS *
+					sizeof(struct rte_crypto_sym_xform),
 			rte_socket_id());
 	if (ts_params->mbuf_ol_pool == NULL) {
 		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
@@ -220,7 +221,7 @@ testsuite_setup(void)
 
 		ts_params->conf.nb_queue_pairs = info.max_nb_queue_pairs;
 		ts_params->conf.socket_id = SOCKET_ID_ANY;
-		ts_params->conf.session_mp.nb_objs = info.max_nb_sessions;
+		ts_params->conf.session_mp.nb_objs = info.sym.max_nb_sessions;
 
 		TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id,
 				&ts_params->conf),
@@ -275,7 +276,7 @@ ut_setup(void)
 	ts_params->conf.nb_queue_pairs = DEFAULT_NUM_QPS_PER_QAT_DEVICE;
 	ts_params->conf.socket_id = SOCKET_ID_ANY;
 	ts_params->conf.session_mp.nb_objs =
-			(gbl_cryptodev_type == RTE_CRYPTODEV_QAT_PMD) ?
+			(gbl_cryptodev_type == RTE_CRYPTODEV_QAT_SYM_PMD) ?
 					DEFAULT_NUM_OPS_INFLIGHT :
 					DEFAULT_NUM_OPS_INFLIGHT;
 
@@ -319,7 +320,7 @@ ut_teardown(void)
 
 	/* free crypto session structure */
 	if (ut_params->sess) {
-		rte_cryptodev_session_free(ts_params->valid_devs[0],
+		rte_cryptodev_sym_session_free(ts_params->valid_devs[0],
 				ut_params->sess);
 		ut_params->sess = NULL;
 	}
@@ -464,7 +465,7 @@ test_queue_pair_descriptor_setup(void)
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
-	ts_params->conf.session_mp.nb_objs = dev_info.max_nb_sessions;
+	ts_params->conf.session_mp.nb_objs = dev_info.sym.max_nb_sessions;
 
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
 			&ts_params->conf), "Failed to configure cryptodev %u",
@@ -766,7 +767,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -776,7 +777,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 
 	/* Setup HMAC Parameters */
 
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -786,20 +787,21 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
 	ut_params->op = &ut_params->ol->op.crypto;
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -862,18 +864,18 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
 	ut_params->op = &ut_params->ol->op.crypto;
 
-	TEST_ASSERT_NOT_NULL(rte_pktmbuf_offload_alloc_crypto_xforms(
+	TEST_ASSERT_NOT_NULL(rte_pktmbuf_offload_alloc_crypto_sym_xforms(
 			ut_params->ol, 2),
 			"failed to allocate space for crypto transforms");
 
 	/* Set crypto operation data parameters */
-	ut_params->op->xform->type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->op->xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 
 	/* cipher parameters */
 	ut_params->op->xform->cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
@@ -882,7 +884,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)
 	ut_params->op->xform->cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* hash parameters */
-	ut_params->op->xform->next->type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->op->xform->next->type = RTE_CRYPTO_SYM_XFORM_AUTH;
 
 	ut_params->op->xform->next->auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
 	ut_params->op->xform->next->auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
@@ -958,7 +960,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_SHA1);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -967,7 +969,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -977,13 +979,14 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -991,7 +994,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1066,7 +1069,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1075,7 +1078,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1085,13 +1088,14 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1099,7 +1103,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1168,7 +1172,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_SHA256);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1177,7 +1181,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1187,13 +1191,14 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1201,7 +1206,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1282,7 +1287,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1291,7 +1296,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1301,15 +1306,16 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA512;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1317,7 +1323,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1371,7 +1377,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 		struct crypto_unittest_params *ut_params);
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_params);
 
@@ -1386,8 +1392,9 @@ test_AES_CBC_HMAC_SHA512_decrypt_digest_verify(void)
 			"Failed to create session params");
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	return test_AES_CBC_HMAC_SHA512_decrypt_perform(ut_params->sess,
@@ -1400,7 +1407,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 {
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1409,7 +1416,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1422,7 +1429,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_params)
 {
@@ -1442,7 +1449,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1450,7 +1457,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1522,7 +1529,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1531,7 +1538,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1541,13 +1548,14 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1555,7 +1563,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->iv.data = (uint8_t *)
 		rte_pktmbuf_prepend(ut_params->ibuf,
@@ -1615,7 +1623,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_AES_XCBC);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1624,7 +1632,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1634,13 +1642,14 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1648,7 +1657,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
@@ -1752,7 +1761,7 @@ test_multi_session(void)
 	struct crypto_unittest_params *ut_params = &unittest_params;
 
 	struct rte_cryptodev_info dev_info;
-	struct rte_cryptodev_session **sessions;
+	struct rte_cryptodev_sym_session **sessions;
 
 	uint16_t i;
 
@@ -1761,12 +1770,13 @@ test_multi_session(void)
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
-	sessions = rte_malloc(NULL, (sizeof(struct rte_cryptodev_session *) *
-			dev_info.max_nb_sessions) + 1, 0);
+	sessions = rte_malloc(NULL,
+			(sizeof(struct rte_cryptodev_sym_session *) *
+			dev_info.sym.max_nb_sessions) + 1, 0);
 
 	/* Create multiple crypto sessions*/
-	for (i = 0; i < dev_info.max_nb_sessions; i++) {
-		sessions[i] = rte_cryptodev_session_create(
+	for (i = 0; i < dev_info.sym.max_nb_sessions; i++) {
+		sessions[i] = rte_cryptodev_sym_session_create(
 				ts_params->valid_devs[0],
 			&ut_params->auth_xform);
 		TEST_ASSERT_NOT_NULL(sessions[i],
@@ -1781,13 +1791,13 @@ test_multi_session(void)
 	}
 
 	/* Next session create should fail */
-	sessions[i] = rte_cryptodev_session_create(ts_params->valid_devs[0],
+	sessions[i] = rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
 			&ut_params->auth_xform);
 	TEST_ASSERT_NULL(sessions[i],
 			"Session creation succeeded unexpectedly!");
 
-	for (i = 0; i < dev_info.max_nb_sessions; i++)
-		rte_cryptodev_session_free(ts_params->valid_devs[0],
+	for (i = 0; i < dev_info.sym.max_nb_sessions; i++)
+		rte_cryptodev_sym_session_free(ts_params->valid_devs[0],
 				sessions[i]);
 
 	rte_free(sessions);
@@ -1806,7 +1816,7 @@ test_not_in_place_crypto(void)
 
 	/* Create multiple crypto sessions*/
 
-	ut_params->sess = rte_cryptodev_session_create(
+	ut_params->sess = rte_cryptodev_sym_session_create(
 			ts_params->valid_devs[0], &ut_params->auth_xform);
 
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
@@ -1828,7 +1838,7 @@ test_not_in_place_crypto(void)
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1836,7 +1846,7 @@ test_not_in_place_crypto(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1962,7 +1972,7 @@ static struct unit_test_suite cryptodev_aesni_mb_testsuite  = {
 static int
 test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	gbl_cryptodev_type = RTE_CRYPTODEV_QAT_PMD;
+	gbl_cryptodev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	return unit_test_suite_runner(&cryptodev_qat_testsuite);
 }
 static struct test_command cryptodev_qat_cmd = {
app/test/test_cryptodev_perf.c +45 -34

214 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +23 -21

134 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +3 -3
index e43b898..3cd9990 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -108,7 +108,7 @@ aesni_mb_pmd_info_get(struct rte_cryptodev *dev,
 	if (dev_info != NULL) {
 		dev_info->dev_type = dev->dev_type;
 		dev_info->max_nb_queue_pairs = internals->max_nb_queue_pairs;
-		dev_info->max_nb_sessions = internals->max_nb_sessions;
+		dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
 	}
 }
 
@@ -243,7 +243,7 @@ aesni_mb_pmd_session_get_size(struct rte_cryptodev *dev __rte_unused)
 /** Configure a aesni multi-buffer session from a crypto xform chain */
 static void *
 aesni_mb_pmd_session_configure(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform,	void *sess)
+		struct rte_crypto_sym_xform *xform,	void *sess)
 {
 	struct aesni_mb_private *internals = dev->data->dev_private;
 
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +2 -2
index 2f98609..ab70c15 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -218,7 +218,7 @@ struct aesni_mb_session {
 extern int
 aesni_mb_set_session_parameters(const struct aesni_mb_ops *mb_ops,
 		struct aesni_mb_session *sess,
-		const struct rte_crypto_xform *xform);
+		const struct rte_crypto_sym_xform *xform);
 
 
 /** device specific operations function pointer structure */
drivers/crypto/qat/qat_crypto.c +27 -24

149 lines not on this page · raw message

drivers/crypto/qat/qat_crypto.h +6 -4
index d680364..e9f71fe 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -109,16 +109,18 @@ qat_crypto_sym_session_init(struct rte_mempool *mempool, void *priv_sess);
 
 extern void *
 qat_crypto_sym_configure_session(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform, void *session_private);
+		struct rte_crypto_sym_xform *xform, void *session_private);
 
 extern void
 qat_crypto_sym_clear_session(struct rte_cryptodev *dev, void *session);
 
 
 uint16_t
-qat_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
+qat_sym_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts);
 
 uint16_t
-qat_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
+qat_sym_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts,
+		uint16_t nb_pkts);
 
 #endif /* _QAT_CRYPTO_H_ */
drivers/crypto/qat/rte_qat_cryptodev.c +4 -4
index e500c1e..85700fc 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -89,11 +89,11 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_
 		cryptodev->pci_dev->addr.devid,
 		cryptodev->pci_dev->addr.function);
 
-	cryptodev->dev_type = RTE_CRYPTODEV_QAT_PMD;
+	cryptodev->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	cryptodev->dev_ops = &crypto_qat_ops;
 
-	cryptodev->enqueue_burst = qat_crypto_pkt_tx_burst;
-	cryptodev->dequeue_burst = qat_crypto_pkt_rx_burst;
+	cryptodev->enqueue_burst = qat_sym_crypto_pkt_tx_burst;
+	cryptodev->dequeue_burst = qat_sym_crypto_pkt_rx_burst;
 
 
 	internals = cryptodev->data->dev_private;
examples/l2fwd-crypto/main.c +18 -15
index a950b74..93de786 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -124,13 +124,13 @@ struct l2fwd_crypto_options {
 
 	enum l2fwd_crypto_xform_chain xform_chain;
 
-	struct rte_crypto_xform cipher_xform;
+	struct rte_crypto_sym_xform cipher_xform;
 	uint8_t ckey_data[32];
 
-	struct rte_crypto_key iv_key;
+	struct rte_crypto_sym_key iv_key;
 	uint8_t ivkey_data[16];
 
-	struct rte_crypto_xform auth_xform;
+	struct rte_crypto_sym_xform auth_xform;
 	uint8_t akey_data[128];
 };
 
@@ -142,8 +142,11 @@ struct l2fwd_crypto_params {
 	unsigned digest_length;
 	unsigned block_size;
 
-	struct rte_crypto_key iv_key;
-	struct rte_cryptodev_session *session;
+	struct {
+		uint8_t *data;
+		uint16_t length;
+	} iv;
+	struct rte_cryptodev_sym_session *session;
 };
 
 /** lcore configuration */
@@ -372,7 +375,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,
 	}
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(&ol->op.crypto, cparams->session);
+	rte_crypto_sym_op_attach_session(&ol->op.crypto, cparams->session);
 
 	/* Append space for digest to end of packet */
 	ol->op.crypto.digest.data = (uint8_t *)rte_pktmbuf_append(m,
@@ -474,11 +477,11 @@ generate_random_key(uint8_t *key, unsigned length)
 		key[i] = rand() % 0xff;
 }
 
-static struct rte_cryptodev_session *
+static struct rte_cryptodev_sym_session *
 initialize_crypto_session(struct l2fwd_crypto_options *options,
 		uint8_t cdev_id)
 {
-	struct rte_crypto_xform *first_xform;
+	struct rte_crypto_sym_xform *first_xform;
 
 	if (options->xform_chain == L2FWD_CRYPTO_CIPHER_HASH) {
 		first_xform = &options->cipher_xform;
@@ -489,7 +492,7 @@ initialize_crypto_session(struct l2fwd_crypto_options *options,
 	}
 
 	/* Setup Cipher Parameters */
-	return rte_cryptodev_session_create(cdev_id, first_xform);
+	return rte_cryptodev_sym_session_create(cdev_id, first_xform);
 }
 
 static void
@@ -610,7 +613,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)
 				m = pkts_burst[j];
 				ol = rte_pktmbuf_offload_alloc(
 						l2fwd_mbuf_ol_pool,
-						RTE_PKTMBUF_OL_CRYPTO);
+						RTE_PKTMBUF_OL_CRYPTO_SYM);
 				/*
 				 * If we can't allocate a offload, then drop
 				 * the rest of the burst and dequeue and
@@ -689,7 +692,7 @@ parse_cryptodev_type(enum rte_cryptodev_type *type, char *optarg)
 		*type = RTE_CRYPTODEV_AESNI_MB_PMD;
 		return 0;
 	} else if (strcmp("QAT", optarg) == 0) {
-		*type = RTE_CRYPTODEV_QAT_PMD;
+		*type = RTE_CRYPTODEV_QAT_SYM_PMD;
 		return 0;
 	}
 
@@ -745,7 +748,7 @@ parse_cipher_op(enum rte_crypto_cipher_operation *op, char *optarg)
 
 /** Parse crypto key command line argument */
 static int
-parse_key(struct rte_crypto_key *key __rte_unused,
+parse_key(struct rte_crypto_sym_key *key __rte_unused,
 		unsigned length __rte_unused, char *arg __rte_unused)
 {
 	printf("Currently an unsupported argument!\n");
@@ -982,7 +985,7 @@ l2fwd_crypto_options_print(struct l2fwd_crypto_options *options)
 	switch (options->cdev_type) {
 	case RTE_CRYPTODEV_AESNI_MB_PMD:
 		printf("cryptodev type: AES-NI MB PMD\n"); break;
-	case RTE_CRYPTODEV_QAT_PMD:
+	case RTE_CRYPTODEV_QAT_SYM_PMD:
 		printf("cryptodev type: QAT PMD\n"); break;
 	default:
 		break;
@@ -1179,7 +1182,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports)
 	unsigned i, cdev_id, cdev_count, enabled_cdev_count = 0;
 	int retval;
 
-	if (options->cdev_type == RTE_CRYPTODEV_QAT_PMD) {
+	if (options->cdev_type == RTE_CRYPTODEV_QAT_SYM_PMD) {
 		if (rte_cryptodev_count() < nb_ports)
 			return -1;
 	} else if (options->cdev_type == RTE_CRYPTODEV_AESNI_MB_PMD) {
lib/librte_cryptodev/Makefile +1 -0
index 81fa3fc..0d59229 100644
@@ -45,6 +45,7 @@ SRCS-y += rte_cryptodev.c
 
 # export include files
 SYMLINK-y-include += rte_crypto.h
+SYMLINK-y-include += rte_crypto_sym.h
 SYMLINK-y-include += rte_cryptodev.h
 SYMLINK-y-include += rte_cryptodev_pmd.h
 
lib/librte_cryptodev/rte_crypto.h +3 -560

582 lines not on this page · raw message

lib/librte_cryptodev/rte_crypto_sym.h new file +613 -0

613 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.c +22 -17
index 1106888..f32ddd4 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -584,8 +584,8 @@ rte_cryptodev_queue_pair_stop(uint8_t dev_id, uint16_t queue_pair_id)
 }
 
 static int
-rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
-		unsigned obj_cache_size, int socket_id);
+rte_cryptodev_sym_session_pool_create(struct rte_cryptodev *dev,
+		unsigned nb_objs, unsigned obj_cache_size, int socket_id);
 
 int
 rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
@@ -622,8 +622,10 @@ rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
 	}
 
 	/* Setup Session mempool for device */
-	return rte_crypto_session_pool_create(dev, config->session_mp.nb_objs,
-			config->session_mp.cache_size, config->socket_id);
+	return rte_cryptodev_sym_session_pool_create(dev,
+			config->session_mp.nb_objs,
+			config->session_mp.cache_size,
+			config->socket_id);
 }
 
 
@@ -953,12 +955,12 @@ rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
 
 
 static void
-rte_crypto_session_init(struct rte_mempool *mp,
+rte_cryptodev_sym_session_init(struct rte_mempool *mp,
 		void *opaque_arg,
 		void *_sess,
 		__rte_unused unsigned i)
 {
-	struct rte_cryptodev_session *sess = _sess;
+	struct rte_cryptodev_sym_session *sess = _sess;
 	struct rte_cryptodev *dev = opaque_arg;
 
 	memset(sess, 0, mp->elt_size);
@@ -972,8 +974,8 @@ rte_crypto_session_init(struct rte_mempool *mp,
 }
 
 static int
-rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
-		unsigned obj_cache_size, int socket_id)
+rte_cryptodev_sym_session_pool_create(struct rte_cryptodev *dev,
+		unsigned nb_objs, unsigned obj_cache_size, int socket_id)
 {
 	char mp_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	unsigned priv_sess_size;
@@ -993,7 +995,7 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 		return -ENOMEM;
 	}
 
-	unsigned elt_size = sizeof(struct rte_cryptodev_session) +
+	unsigned elt_size = sizeof(struct rte_cryptodev_sym_session) +
 			priv_sess_size;
 
 	dev->data->session_pool = rte_mempool_lookup(mp_name);
@@ -1017,7 +1019,8 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 				0, /* private data size */
 				NULL, /* obj initialization constructor */
 				NULL, /* obj initialization constructor arg */
-				rte_crypto_session_init, /* obj constructor */
+				rte_cryptodev_sym_session_init,
+				/**< obj constructor*/
 				dev, /* obj constructor arg */
 				socket_id, /* socket id */
 				0); /* flags */
@@ -1032,11 +1035,12 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 	return 0;
 }
 
-struct rte_cryptodev_session *
-rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
+struct rte_cryptodev_sym_session *
+rte_cryptodev_sym_session_create(uint8_t dev_id,
+		struct rte_crypto_sym_xform *xform)
 {
 	struct rte_cryptodev *dev;
-	struct rte_cryptodev_session *sess;
+	struct rte_cryptodev_sym_session *sess;
 	void *_sess;
 
 	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
@@ -1052,7 +1056,7 @@ rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
 		return NULL;
 	}
 
-	sess = (struct rte_cryptodev_session *)_sess;
+	sess = (struct rte_cryptodev_sym_session *)_sess;
 
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->session_configure, NULL);
 	if (dev->dev_ops->session_configure(dev, xform, sess->_private) ==
@@ -1068,8 +1072,9 @@ rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
 	return sess;
 }
 
-struct rte_cryptodev_session *
-rte_cryptodev_session_free(uint8_t dev_id, struct rte_cryptodev_session *sess)
+struct rte_cryptodev_sym_session *
+rte_cryptodev_sym_session_free(uint8_t dev_id,
+		struct rte_cryptodev_sym_session *sess)
 {
 	struct rte_cryptodev *dev;
 
lib/librte_cryptodev/rte_cryptodev.h +34 -46

138 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev_pmd.h +13 -19
index 8270afa..7d049ea 100644
@@ -1,6 +1,6 @@
 /*-
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -56,11 +56,6 @@ extern "C" {
 #include "rte_crypto.h"
 #include "rte_cryptodev.h"
 
-struct rte_cryptodev_stats;
-struct rte_cryptodev_info;
-struct rte_cryptodev_qp_conf;
-
-enum rte_cryptodev_event_type;
 
 #ifdef RTE_LIBRTE_CRYPTODEV_DEBUG
 #define RTE_PMD_DEBUG_TRACE(...) \
@@ -80,7 +75,6 @@ struct rte_cryptodev_session {
 };
 
 struct rte_cryptodev_driver;
-struct rte_cryptodev;
 
 /**
  * Initialisation function of a crypto driver invoked for each matching
@@ -364,7 +358,7 @@ typedef uint32_t (*cryptodev_queue_pair_count_t)(struct rte_cryptodev *dev);
  * - On success returns a pointer to a rte_mempool
  * - On failure returns a NULL pointer
  */
-typedef int (*cryptodev_create_session_pool_t)(
+typedef int (*cryptodev_sym_create_session_pool_t)(
 		struct rte_cryptodev *dev, unsigned nb_objs,
 		unsigned obj_cache_size, int socket_id);
 
@@ -378,7 +372,7 @@ typedef int (*cryptodev_create_session_pool_t)(
  *  - On success returns the size of the session structure for device
  *  - On failure returns 0
  */
-typedef unsigned (*cryptodev_get_session_private_size_t)(
+typedef unsigned (*cryptodev_sym_get_session_private_size_t)(
 		struct rte_cryptodev *dev);
 
 /**
@@ -392,7 +386,7 @@ typedef unsigned (*cryptodev_get_session_private_size_t)(
  *  - Returns private session structure on success.
  *  - Returns NULL on failure.
  */
-typedef void (*cryptodev_initialize_session_t)(struct rte_mempool *mempool,
+typedef void (*cryptodev_sym_initialize_session_t)(struct rte_mempool *mempool,
 		void *session_private);
 
 /**
@@ -406,14 +400,14 @@ typedef void (*cryptodev_initialize_session_t)(struct rte_mempool *mempool,
  *  - Returns private session structure on success.
  *  - Returns NULL on failure.
  */
-typedef void * (*cryptodev_configure_session_t)(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform, void *session_private);
+typedef void * (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev,
+		struct rte_crypto_sym_xform *xform, void *session_private);
 
 /**
  * Free Crypto session.
  * @param	session		Cryptodev session structure to free
  */
-typedef void (*cryptodev_free_session_t)(struct rte_cryptodev *dev,
+typedef void (*cryptodev_sym_free_session_t)(struct rte_cryptodev *dev,
 		void *session_private);
 
 
@@ -427,9 +421,9 @@ struct rte_cryptodev_ops {
 	cryptodev_info_get_t dev_infos_get;	/**< Get device info. */
 
 	cryptodev_stats_get_t stats_get;
-	/**< Get generic device statistics. */
+	/**< Get device statistics. */
 	cryptodev_stats_reset_t stats_reset;
-	/**< Reset generic device statistics. */
+	/**< Reset device statistics. */
 
 	cryptodev_queue_pair_setup_t queue_pair_setup;
 	/**< Set up a device queue pair. */
@@ -442,13 +436,13 @@ struct rte_cryptodev_ops {
 	cryptodev_queue_pair_count_t queue_pair_count;
 	/**< Get count of the queue pairs. */
 
-	cryptodev_get_session_private_size_t session_get_size;
+	cryptodev_sym_get_session_private_size_t session_get_size;
 	/**< Return private session. */
-	cryptodev_initialize_session_t session_initialize;
+	cryptodev_sym_initialize_session_t session_initialize;
 	/**< Initialization function for private session data */
-	cryptodev_configure_session_t session_configure;
+	cryptodev_sym_configure_session_t session_configure;
 	/**< Configure a Crypto session. */
-	cryptodev_free_session_t session_clear;
+	cryptodev_sym_free_session_t session_clear;
 	/**< Clear a Crypto sessions private data. */
 };
 
lib/librte_mbuf_offload/rte_mbuf_offload.h +11 -11
index 4345f06..926ab64 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -64,7 +64,7 @@
 enum rte_mbuf_ol_op_type {
 	RTE_PKTMBUF_OL_NOT_SPECIFIED = 0,
 	/**< Off-load not specified */
-	RTE_PKTMBUF_OL_CRYPTO
+	RTE_PKTMBUF_OL_CRYPTO_SYM
 	/**< Crypto offload operation */
 };
 
@@ -81,7 +81,7 @@ struct rte_mbuf_offload {
 
 	enum rte_mbuf_ol_op_type type;	/**< offload type */
 	union {
-		struct rte_crypto_op crypto;	/**< Crypto operation */
+		struct rte_crypto_sym_op crypto;	/**< Crypto operation */
 	} op;
 };
 
@@ -191,8 +191,8 @@ __rte_pktmbuf_offload_reset(struct rte_mbuf_offload *ol,
 	ol->type = type;
 
 	switch (type) {
-	case RTE_PKTMBUF_OL_CRYPTO:
-		__rte_crypto_op_reset(&ol->op.crypto); break;
+	case RTE_PKTMBUF_OL_CRYPTO_SYM:
+		__rte_crypto_sym_op_reset(&ol->op.crypto); break;
 	default:
 		break;
 	}
@@ -275,24 +275,24 @@ __rte_pktmbuf_offload_check_priv_data_size(struct rte_mbuf_offload *ol,
  * - On success returns pointer to first crypto xform in crypto operations chain
  * - On failure returns NULL
  */
-static inline struct rte_crypto_xform *
-rte_pktmbuf_offload_alloc_crypto_xforms(struct rte_mbuf_offload *ol,
+static inline struct rte_crypto_sym_xform *
+rte_pktmbuf_offload_alloc_crypto_sym_xforms(struct rte_mbuf_offload *ol,
 		unsigned nb_xforms)
 {
-	struct rte_crypto_xform *xform;
+	struct rte_crypto_sym_xform *xform;
 	void *priv_data;
 	uint16_t size;
 
-	size = sizeof(struct rte_crypto_xform) * nb_xforms;
+	size = sizeof(struct rte_crypto_sym_xform) * nb_xforms;
 	priv_data = __rte_pktmbuf_offload_check_priv_data_size(ol, size);
 
 	if (priv_data == NULL)
 		return NULL;
 
-	ol->op.crypto.xform = xform = (struct rte_crypto_xform *)priv_data;
+	ol->op.crypto.xform = xform = (struct rte_crypto_sym_xform *)priv_data;
 
 	do {
-		xform->type = RTE_CRYPTO_XFORM_NOT_SPECIFIED;
+		xform->type = RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED;
 		xform = xform->next = --nb_xforms > 0 ? xform + 1 : NULL;
 	} while (xform);
 
Signature · 1 line
2.5.0
#4 lore raw

PATCH v2 2/2 cryptodev: change burst API to be crypto op oriented

In reply to Declan Doherty

This patch modifies the crypto burst enqueue/dequeue APIs to operate on bursts rte_crypto_op's rather than the current implementation which operates on rte_mbuf bursts, this simplifies the burst processing in the crypto PMDs and the use of crypto operations in general.

This change set also continues the separation of the symmetric operation parameters from the more general operation parameters, this will simplify the integration of asymmetric crypto operations in the future.

As well as the changes to the crypto APIs this patch adds functions for managing rte_crypto_op pools to the cryptodev API. It modifies the existing PMDs, unit tests and sample application to work with the modified APIs.

Finally this change set removes the now unused rte_mbuf_offload library.

---
 MAINTAINERS                                        |   4 -
 app/test/test_cryptodev.c                          | 800 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 253 +++----
 config/common_bsdapp                               |   7 -
 config/common_linuxapp                             |  11 +-
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 171 +++--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  12 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   2 +-
 drivers/crypto/qat/qat_crypto.c                    | 125 ++--
 drivers/crypto/qat/qat_crypto.h                    |  12 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   4 +-
 examples/l2fwd-crypto/main.c                       | 264 ++++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/rte_crypto.h                  | 345 +++++++++
 lib/librte_cryptodev/rte_crypto_sym.h              | 377 +++++-----
 lib/librte_cryptodev/rte_cryptodev.c               |  74 ++
 lib/librte_cryptodev/rte_cryptodev.h               | 107 +--
 lib/librte_cryptodev/rte_cryptodev_version.map     |   1 +
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 307 --------
 .../rte_mbuf_offload_version.map                   |   7 -
 25 files changed, 1543 insertions(+), 1509 deletions(-)
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
MAINTAINERS +0 -4
index 628bc05..8d84dda 100644
@@ -222,10 +222,6 @@ F: lib/librte_mbuf/
 F: doc/guides/prog_guide/mbuf_lib.rst
 F: app/test/test_mbuf.c
 
-Packet buffer offload - EXPERIMENTAL
-M: Declan Doherty <[email protected]>
-F: lib/librte_mbuf_offload/
-
 Ethernet API
 M: Thomas Monjalon <[email protected]>
 F: lib/librte_ether/
app/test/test_cryptodev.c +428 -372

1,127 lines not on this page · raw message

app/test/test_cryptodev.h +5 -4
index 034393e..c84ba42 100644
@@ -32,8 +32,6 @@
 #ifndef TEST_CRYPTODEV_H_
 #define TEST_CRYPTODEV_H_
 
-#define HEX_DUMP 0
-
 #define FALSE                           0
 #define TRUE                            1
 
@@ -47,8 +45,9 @@
 #define DEFAULT_NUM_XFORMS              (2)
 #define NUM_MBUFS                       (8191)
 #define MBUF_CACHE_SIZE                 (250)
-#define MBUF_SIZE   (2048 + DIGEST_BYTE_LENGTH_SHA512 + \
-				sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATAPAYLOAD_SIZE		(2048 + DIGEST_BYTE_LENGTH_SHA512)
+#define MBUF_SIZE			(sizeof(struct rte_mbuf) + \
+		RTE_PKTMBUF_HEADROOM + MBUF_DATAPAYLOAD_SIZE)
 
 #define BYTE_LENGTH(x)				(x/8)
 /* HASH DIGEST LENGTHS */
@@ -62,7 +61,9 @@
 #define AES_XCBC_MAC_KEY_SZ			(16)
 
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA1		(12)
+#define TRUNCATED_DIGEST_BYTE_LENGTH_SHA224		(14)
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA256		(16)
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA512		(32)
+#define TRUNCATED_DIGEST_BYTE_LENGTH_AES_XCBC		(12)
 
 #endif /* TEST_CRYPTODEV_H_ */
app/test/test_cryptodev_perf.c +128 -125

427 lines not on this page · raw message

config/common_bsdapp +0 -7
index 696382c..157f9aa 100644
@@ -357,13 +357,6 @@ CONFIG_RTE_MBUF_REFCNT_ATOMIC=y
 CONFIG_RTE_PKTMBUF_HEADROOM=128
 
 #
-# Compile librte_mbuf_offload
-# EXPERIMENTAL: API may change without prior notice
-#
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD=y
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD_DEBUG=n
-
-#
 # Compile librte_timer
 #
 CONFIG_RTE_LIBRTE_TIMER=y
config/common_linuxapp +2 -9
index f1638db..e2dc636 100644
@@ -330,7 +330,7 @@ CONFIG_RTE_CRYPTODEV_NAME_LEN=64
 #
 # Compile PMD for QuickAssist based devices
 #
-CONFIG_RTE_LIBRTE_PMD_QAT=n
+CONFIG_RTE_LIBRTE_PMD_QAT=y
 CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_INIT=n
 CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_PMD_QAT_DEBUG_RX=n
@@ -344,7 +344,7 @@ CONFIG_RTE_QAT_PMD_MAX_NB_SESSIONS=2048
 #
 # Compile PMD for AESNI backed device
 #
-CONFIG_RTE_LIBRTE_PMD_AESNI_MB=n
+CONFIG_RTE_LIBRTE_PMD_AESNI_MB=y
 CONFIG_RTE_LIBRTE_PMD_AESNI_MB_DEBUG=n
 CONFIG_RTE_AESNI_MB_PMD_MAX_NB_QUEUE_PAIRS=8
 CONFIG_RTE_AESNI_MB_PMD_MAX_NB_SESSIONS=2048
@@ -373,13 +373,6 @@ CONFIG_RTE_MBUF_REFCNT_ATOMIC=y
 CONFIG_RTE_PKTMBUF_HEADROOM=128
 
 #
-# Compile librte_mbuf_offload
-# EXPERIMENTAL: API may change without prior notice
-#
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD=y
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD_DEBUG=n
-
-#
 # Compile librte_timer
 #
 CONFIG_RTE_LIBRTE_TIMER=y
doc/api/doxy-api-index.md +0 -1
index 7a91001..f626386 100644
@@ -104,7 +104,6 @@ There are many libraries, so their headers may be grouped by topics:
 
 - **containers**:
   [mbuf]               (@ref rte_mbuf.h),
-  [mbuf_offload]       (@ref rte_mbuf_offload.h),
   [ring]               (@ref rte_ring.h),
   [distributor]        (@ref rte_distributor.h),
   [reorder]            (@ref rte_reorder.h),
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +93 -78

320 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +6 -6
index 3cd9990..d56de12 100644
@@ -76,11 +76,11 @@ aesni_mb_pmd_stats_get(struct rte_cryptodev *dev,
 	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
 		struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];
 
-		stats->enqueued_count += qp->qp_stats.enqueued_count;
-		stats->dequeued_count += qp->qp_stats.dequeued_count;
+		stats->enqueued_count += qp->stats.enqueued_count;
+		stats->dequeued_count += qp->stats.dequeued_count;
 
-		stats->enqueue_err_count += qp->qp_stats.enqueue_err_count;
-		stats->dequeue_err_count += qp->qp_stats.dequeue_err_count;
+		stats->enqueue_err_count += qp->stats.enqueue_err_count;
+		stats->dequeue_err_count += qp->stats.dequeue_err_count;
 	}
 }
 
@@ -93,7 +93,7 @@ aesni_mb_pmd_stats_reset(struct rte_cryptodev *dev)
 	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
 		struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];
 
-		memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+		memset(&qp->stats, 0, sizeof(qp->stats));
 	}
 }
 
@@ -196,7 +196,7 @@ aesni_mb_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 
 	qp->sess_mp = dev->data->session_pool;
 
-	memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+	memset(&qp->stats, 0, sizeof(qp->stats));
 
 	/* Initialise multi-buffer manager */
 	(*qp->ops->job.init_mgr)(&qp->mb_mgr);
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +1 -1
index ab70c15..0aed177 100644
@@ -150,7 +150,7 @@ struct aesni_mb_qp {
 	/**< Ring for placing process packets */
 	struct rte_mempool *sess_mp;
 	/**< Session Mempool */
-	struct rte_cryptodev_stats qp_stats;
+	struct rte_cryptodev_stats stats;
 	/**< Queue pair statistics */
 } __rte_cache_aligned;
 
drivers/crypto/qat/qat_crypto.c +66 -59

245 lines not on this page · raw message

drivers/crypto/qat/qat_crypto.h +6 -6
index e9f71fe..9323383 100644
@@ -115,12 +115,12 @@ extern void
 qat_crypto_sym_clear_session(struct rte_cryptodev *dev, void *session);
 
 
-uint16_t
-qat_sym_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts,
-		uint16_t nb_pkts);
+extern uint16_t
+qat_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops,
+		uint16_t nb_ops);
 
-uint16_t
-qat_sym_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts,
-		uint16_t nb_pkts);
+extern uint16_t
+qat_pmd_dequeue_op_burst(void *qp, struct rte_crypto_op **ops,
+		uint16_t nb_ops);
 
 #endif /* _QAT_CRYPTO_H_ */
drivers/crypto/qat/rte_qat_cryptodev.c +2 -2
index 85700fc..5e51aca 100644
@@ -92,8 +92,8 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_
 	cryptodev->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	cryptodev->dev_ops = &crypto_qat_ops;
 
-	cryptodev->enqueue_burst = qat_sym_crypto_pkt_tx_burst;
-	cryptodev->dequeue_burst = qat_sym_crypto_pkt_rx_burst;
+	cryptodev->enqueue_burst = qat_pmd_enqueue_op_burst;
+	cryptodev->dequeue_burst = qat_pmd_dequeue_op_burst;
 
 
 	internals = cryptodev->data->dev_private;
examples/l2fwd-crypto/main.c +129 -135

549 lines not on this page · raw message

lib/Makefile +0 -1
index ef172ea..4c5c1b4 100644
@@ -36,7 +36,6 @@ DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
 DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
 DIRS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += librte_mempool
 DIRS-$(CONFIG_RTE_LIBRTE_MBUF) += librte_mbuf
-DIRS-$(CONFIG_RTE_LIBRTE_MBUF_OFFLOAD) += librte_mbuf_offload
 DIRS-$(CONFIG_RTE_LIBRTE_TIMER) += librte_timer
 DIRS-$(CONFIG_RTE_LIBRTE_CFGFILE) += librte_cfgfile
 DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline
lib/librte_cryptodev/rte_crypto.h +345 -0

171 lines not on this page · raw message

lib/librte_cryptodev/rte_crypto_sym.h +203 -174

377 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.c +74 -0

74 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.h +54 -53

107 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev_version.map +1 -0
index ff8e93d..24e00bb 100644

Lines of this file are not shown. View the raw message.

lib/librte_mbuf/rte_mbuf.h +0 -6
index c973e9b..400a849 100644

Lines of this file are not shown. View the raw message.

lib/librte_mbuf_offload/Makefile deleted +0 -52

52 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload.c deleted +0 -100

100 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload.h deleted +0 -307

307 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload_version.map deleted +0 -7
deleted file mode 100644
index 3d3b06a..0000000

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.5.0

Part of the diff is not shown here. View the raw message.

#5 lore raw

Re: [PATCH v2 2/2] cryptodev: change burst API to be crypto op oriented

Hi Declan,

Build fails after make clean.
Fix is following change to include path.
And one unused include file can be removed.

lib/librte_cryptodev/rte_crypto.h +1 -1
index 489314b..5bded98 100644
@@ -49,7 +49,7 @@ extern "C" {
 #include <rte_memory.h>
 #include <rte_mempool.h>
 
-#include <rte_crypto_sym.h>
+#include "rte_crypto_sym.h"
 
 /** Crypto operation types */
 enum rte_crypto_op_type {
lib/librte_cryptodev/rte_cryptodev.h +0 -1
index 5aaa00c..2e6cd9d 100644
@@ -48,7 +48,6 @@
 extern "C" {
 #endif
 
-#include "stddef.h"
 
 #include "rte_crypto.h"
 #include "rte_dev.h"
Quoted 5 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Declan Doherty
Sent: Friday, February 19, 2016 11:01 AM
To: [email protected]
Subject: [dpdk-dev] [PATCH v2 2/2] cryptodev: change burst API to be crypto op oriented

#6 lore raw

Re: [PATCH v2 2/2] cryptodev: change burst API to be crypto op oriented

In reply to Declan Doherty

Hi Declan,

Quoted 17 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Declan Doherty
Sent: Friday, February 19, 2016 11:01 AM
To: [email protected]
Subject: [dpdk-dev] [PATCH v2 2/2] cryptodev: change burst API to be crypto op oriented

This patch modifies the crypto burst enqueue/dequeue APIs to operate on bursts rte_crypto_op's rather than the current implementation which operates on rte_mbuf bursts, this simplifies the burst processing in the crypto PMDs and the use of crypto operations in general.

This change set also continues the separation of the symmetric operation parameters
from the more general operation parameters, this will simplify the integration of asymmetric crypto operations in the future.

Quoted 8 lines

As well as the changes to the crypto APIs this patch adds functions for managing rte_crypto_op pools to the cryptodev API. It modifies the existing PMDs, unit tests and sample application to work with the modified APIs.

Finally this change set removes the now unused rte_mbuf_offload library.

---

Delete unused fn below.

Quoted 40 lines
lib/librte_cryptodev/rte_crypto.h +36 -0
index df0c0b8..489314b 100644
+
+/**
+ * Allocate a symmetric crypto operation in the private data of an mbuf.
+ *
+ * @param	m	mbuf which is associated with the crypto operation, the
+ *			operation will be allocated in the private data of that
+ *			mbuf.
+ *
+ * @returns
+ * - On success returns a pointer to the crypto operation.
+ * - On failure returns NULL.
+ */
+static inline struct rte_crypto_op *
+rte_crypto_sym_op_alloc_from_mbuf_priv_data(struct rte_mbuf *m)
+{
+	if (unlikely(m == NULL))
+		return NULL;
+
+	/*
+	 * check that the mbuf's private data size is sufficient to contain a
+	 * crypto operation
+	 */
+	if (unlikely(m->priv_size < (sizeof(struct rte_crypto_op) +
+			sizeof(struct rte_crypto_sym_op))))
+		return NULL;
+
+	/* private data starts immediately after the mbuf header in the mbuf. */
+	struct rte_crypto_op *op = (struct rte_crypto_op *)(m + 1);
+
+	__rte_crypto_op_reset(op, RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+
+	op->mempool = NULL;
+	op->sym->m_src = m;
+
+	return op;
+}
#7 lore raw

Re: [PATCH v2 2/2] cryptodev: change burst API to be crypto op oriented

In reply to Declan Doherty

Hi Declan,

Bug + fix below

Quoted 17 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Declan Doherty
Sent: Friday, February 19, 2016 11:01 AM
To: [email protected]
Subject: [dpdk-dev] [PATCH v2 2/2] cryptodev: change burst API to be crypto op oriented

This patch modifies the crypto burst enqueue/dequeue APIs to operate on bursts rte_crypto_op's rather than the current implementation which operates on rte_mbuf bursts, this simplifies the burst processing in the crypto PMDs and the use of crypto operations in general.

This change set also continues the separation of the symmetric operation parameters
from the more general operation parameters, this will simplify the integration of asymmetric crypto operations in the future.

Quoted 7 lines

As well as the changes to the crypto APIs this patch adds functions for managing rte_crypto_op pools to the cryptodev API. It modifies the existing PMDs, unit tests and sample application to work with the modified APIs.

Finally this change set removes the now unused rte_mbuf_offload library.

lib/librte_cryptodev/rte_crypto.h +0 -0

//snip
+ * Returns a pointer to the private data of a crypto operation if
+ * that operation has enough capacity for requested size.
+ *
+ * @param op crypto operation.
+ * @param size size of space requested in private data.
+ *
+ * @returns
+ * - if sufficient space available returns pointer to start of private data
+ * - if insufficient space returns NULL
+ */
+static inline void *
+__rte_crypto_op_get_priv_data(struct rte_crypto_op *op, uint32_t size) +{
+ uint32_t priv_size;
+
+ if (likely(op->mempool != NULL)) {
+ priv_size = __rte_crypto_op_get_priv_data_size(op->mempool);
+
+ if (likely(priv_size >= size))
+ return (void *)((op + 1) +
+ sizeof(struct rte_crypto_sym_op));

Jumping by rte_crypto_op increments, should be byte increments, i.e.

			return (void *)((uint8_t *)(op + 1) +
					sizeof(struct rte_crypto_sym_op));

+ }
+
+ return NULL;
+}

#8 lore raw

v3 cover cryptodev API changes

In reply to Declan Doherty

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (1):
cryptodev: change burst API to be crypto op oriented

Fiona Trahe (1):
cryptodev: API tidy and changes to support future extensions

 MAINTAINERS                                        |   6 +-
 app/test/test_cryptodev.c                          | 894 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_bsdapp                               |   8 -
 config/common_linuxapp                             |   8 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 199 ++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  18 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   6 +-
 drivers/crypto/qat/qat_crypto.c                    | 150 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 300 ++++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 822 ++++++++-----------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 185 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   3 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 -------
 .../rte_mbuf_offload_version.map                   |   7 -
 27 files changed, 2146 insertions(+), 2021 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
Signature · 1 line
2.5.0
#9 lore raw

PATCH v3 1/2 cryptodev: API tidy and changes to support future extensions

From: Fiona Trahe <[email protected]>

This patch splits symmetric specific definitions and functions away from the common crypto APIs to facilitate the future extension and expansion of the cryptodev framework, in order to allow asymmetric crypto operations to be introduced at a later date, as well as to clean the logical structure of the public includes. The patch also introduces the _sym prefix to symmetric specific structure and functions to improve clarity in the API.

---
 app/test/test_cryptodev.c                          | 164 +++---
 app/test/test_cryptodev_perf.c                     |  79 +--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         |  44 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |   6 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   4 +-
 drivers/crypto/qat/qat_crypto.c                    |  51 +-
 drivers/crypto/qat/qat_crypto.h                    |  10 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       |  33 +-
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 563 +------------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 613 +++++++++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               |  39 +-
 lib/librte_cryptodev/rte_cryptodev.h               |  80 ++-
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_mbuf_offload/rte_mbuf_offload.h         |  22 +-
 16 files changed, 912 insertions(+), 837 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
app/test/test_cryptodev.c +87 -77
index 62f8fb0..951b443 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -57,13 +57,13 @@ struct crypto_testsuite_params {
 };
 
 struct crypto_unittest_params {
-	struct rte_crypto_xform cipher_xform;
-	struct rte_crypto_xform auth_xform;
+	struct rte_crypto_sym_xform cipher_xform;
+	struct rte_crypto_sym_xform auth_xform;
 
-	struct rte_cryptodev_session *sess;
+	struct rte_cryptodev_sym_session *sess;
 
 	struct rte_mbuf_offload *ol;
-	struct rte_crypto_op *op;
+	struct rte_crypto_sym_op *op;
 
 	struct rte_mbuf *obuf, *ibuf;
 
@@ -78,7 +78,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 		struct crypto_unittest_params *ut_params);
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_param);
 
@@ -165,7 +165,8 @@ testsuite_setup(void)
 	ts_params->mbuf_ol_pool = rte_pktmbuf_offload_pool_create(
 			"MBUF_OFFLOAD_POOL",
 			NUM_MBUFS, MBUF_CACHE_SIZE,
-			DEFAULT_NUM_XFORMS * sizeof(struct rte_crypto_xform),
+			DEFAULT_NUM_XFORMS *
+					sizeof(struct rte_crypto_sym_xform),
 			rte_socket_id());
 	if (ts_params->mbuf_ol_pool == NULL) {
 		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
@@ -220,7 +221,7 @@ testsuite_setup(void)
 
 		ts_params->conf.nb_queue_pairs = info.max_nb_queue_pairs;
 		ts_params->conf.socket_id = SOCKET_ID_ANY;
-		ts_params->conf.session_mp.nb_objs = info.max_nb_sessions;
+		ts_params->conf.session_mp.nb_objs = info.sym.max_nb_sessions;
 
 		TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id,
 				&ts_params->conf),
@@ -275,7 +276,7 @@ ut_setup(void)
 	ts_params->conf.nb_queue_pairs = DEFAULT_NUM_QPS_PER_QAT_DEVICE;
 	ts_params->conf.socket_id = SOCKET_ID_ANY;
 	ts_params->conf.session_mp.nb_objs =
-			(gbl_cryptodev_type == RTE_CRYPTODEV_QAT_PMD) ?
+			(gbl_cryptodev_type == RTE_CRYPTODEV_QAT_SYM_PMD) ?
 					DEFAULT_NUM_OPS_INFLIGHT :
 					DEFAULT_NUM_OPS_INFLIGHT;
 
@@ -319,7 +320,7 @@ ut_teardown(void)
 
 	/* free crypto session structure */
 	if (ut_params->sess) {
-		rte_cryptodev_session_free(ts_params->valid_devs[0],
+		rte_cryptodev_sym_session_free(ts_params->valid_devs[0],
 				ut_params->sess);
 		ut_params->sess = NULL;
 	}
@@ -464,7 +465,7 @@ test_queue_pair_descriptor_setup(void)
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
-	ts_params->conf.session_mp.nb_objs = dev_info.max_nb_sessions;
+	ts_params->conf.session_mp.nb_objs = dev_info.sym.max_nb_sessions;
 
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
 			&ts_params->conf), "Failed to configure cryptodev %u",
@@ -766,7 +767,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -776,7 +777,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 
 	/* Setup HMAC Parameters */
 
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -786,20 +787,21 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
 	ut_params->op = &ut_params->ol->op.crypto;
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -862,18 +864,18 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
 	ut_params->op = &ut_params->ol->op.crypto;
 
-	TEST_ASSERT_NOT_NULL(rte_pktmbuf_offload_alloc_crypto_xforms(
+	TEST_ASSERT_NOT_NULL(rte_pktmbuf_offload_alloc_crypto_sym_xforms(
 			ut_params->ol, 2),
 			"failed to allocate space for crypto transforms");
 
 	/* Set crypto operation data parameters */
-	ut_params->op->xform->type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->op->xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 
 	/* cipher parameters */
 	ut_params->op->xform->cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
@@ -882,7 +884,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)
 	ut_params->op->xform->cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* hash parameters */
-	ut_params->op->xform->next->type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->op->xform->next->type = RTE_CRYPTO_SYM_XFORM_AUTH;
 
 	ut_params->op->xform->next->auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
 	ut_params->op->xform->next->auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
@@ -958,7 +960,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_SHA1);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -967,7 +969,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -977,13 +979,14 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -991,7 +994,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1066,7 +1069,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1075,7 +1078,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1085,13 +1088,14 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1099,7 +1103,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1168,7 +1172,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_SHA256);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1177,7 +1181,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1187,13 +1191,14 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1201,7 +1206,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1282,7 +1287,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1291,7 +1296,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1301,15 +1306,16 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA512;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1317,7 +1323,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1371,7 +1377,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 		struct crypto_unittest_params *ut_params);
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_params);
 
@@ -1386,8 +1392,9 @@ test_AES_CBC_HMAC_SHA512_decrypt_digest_verify(void)
 			"Failed to create session params");
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	return test_AES_CBC_HMAC_SHA512_decrypt_perform(ut_params->sess,
@@ -1400,7 +1407,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 {
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1409,7 +1416,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1422,7 +1429,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_params)
 {
@@ -1442,7 +1449,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1450,7 +1457,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1522,7 +1529,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1531,7 +1538,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1541,13 +1548,14 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1555,7 +1563,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->iv.data = (uint8_t *)
 		rte_pktmbuf_prepend(ut_params->ibuf,
@@ -1615,7 +1623,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_AES_XCBC);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1624,7 +1632,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1634,13 +1642,14 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1648,7 +1657,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
@@ -1752,7 +1761,7 @@ test_multi_session(void)
 	struct crypto_unittest_params *ut_params = &unittest_params;
 
 	struct rte_cryptodev_info dev_info;
-	struct rte_cryptodev_session **sessions;
+	struct rte_cryptodev_sym_session **sessions;
 
 	uint16_t i;
 
@@ -1761,12 +1770,13 @@ test_multi_session(void)
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
-	sessions = rte_malloc(NULL, (sizeof(struct rte_cryptodev_session *) *
-			dev_info.max_nb_sessions) + 1, 0);
+	sessions = rte_malloc(NULL,
+			(sizeof(struct rte_cryptodev_sym_session *) *
+			dev_info.sym.max_nb_sessions) + 1, 0);
 
 	/* Create multiple crypto sessions*/
-	for (i = 0; i < dev_info.max_nb_sessions; i++) {
-		sessions[i] = rte_cryptodev_session_create(
+	for (i = 0; i < dev_info.sym.max_nb_sessions; i++) {
+		sessions[i] = rte_cryptodev_sym_session_create(
 				ts_params->valid_devs[0],
 			&ut_params->auth_xform);
 		TEST_ASSERT_NOT_NULL(sessions[i],
@@ -1781,13 +1791,13 @@ test_multi_session(void)
 	}
 
 	/* Next session create should fail */
-	sessions[i] = rte_cryptodev_session_create(ts_params->valid_devs[0],
+	sessions[i] = rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
 			&ut_params->auth_xform);
 	TEST_ASSERT_NULL(sessions[i],
 			"Session creation succeeded unexpectedly!");
 
-	for (i = 0; i < dev_info.max_nb_sessions; i++)
-		rte_cryptodev_session_free(ts_params->valid_devs[0],
+	for (i = 0; i < dev_info.sym.max_nb_sessions; i++)
+		rte_cryptodev_sym_session_free(ts_params->valid_devs[0],
 				sessions[i]);
 
 	rte_free(sessions);
@@ -1806,7 +1816,7 @@ test_not_in_place_crypto(void)
 
 	/* Create multiple crypto sessions*/
 
-	ut_params->sess = rte_cryptodev_session_create(
+	ut_params->sess = rte_cryptodev_sym_session_create(
 			ts_params->valid_devs[0], &ut_params->auth_xform);
 
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
@@ -1828,7 +1838,7 @@ test_not_in_place_crypto(void)
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1836,7 +1846,7 @@ test_not_in_place_crypto(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1962,7 +1972,7 @@ static struct unit_test_suite cryptodev_aesni_mb_testsuite  = {
 static int
 test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	gbl_cryptodev_type = RTE_CRYPTODEV_QAT_PMD;
+	gbl_cryptodev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	return unit_test_suite_runner(&cryptodev_qat_testsuite);
 }
 static struct test_command cryptodev_qat_cmd = {
app/test/test_cryptodev_perf.c +45 -34

214 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +23 -21

134 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +3 -3
index e43b898..3cd9990 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -108,7 +108,7 @@ aesni_mb_pmd_info_get(struct rte_cryptodev *dev,
 	if (dev_info != NULL) {
 		dev_info->dev_type = dev->dev_type;
 		dev_info->max_nb_queue_pairs = internals->max_nb_queue_pairs;
-		dev_info->max_nb_sessions = internals->max_nb_sessions;
+		dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
 	}
 }
 
@@ -243,7 +243,7 @@ aesni_mb_pmd_session_get_size(struct rte_cryptodev *dev __rte_unused)
 /** Configure a aesni multi-buffer session from a crypto xform chain */
 static void *
 aesni_mb_pmd_session_configure(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform,	void *sess)
+		struct rte_crypto_sym_xform *xform,	void *sess)
 {
 	struct aesni_mb_private *internals = dev->data->dev_private;
 
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +2 -2
index 2f98609..ab70c15 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -218,7 +218,7 @@ struct aesni_mb_session {
 extern int
 aesni_mb_set_session_parameters(const struct aesni_mb_ops *mb_ops,
 		struct aesni_mb_session *sess,
-		const struct rte_crypto_xform *xform);
+		const struct rte_crypto_sym_xform *xform);
 
 
 /** device specific operations function pointer structure */
drivers/crypto/qat/qat_crypto.c +27 -24

149 lines not on this page · raw message

drivers/crypto/qat/qat_crypto.h +6 -4
index d680364..e9f71fe 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -109,16 +109,18 @@ qat_crypto_sym_session_init(struct rte_mempool *mempool, void *priv_sess);
 
 extern void *
 qat_crypto_sym_configure_session(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform, void *session_private);
+		struct rte_crypto_sym_xform *xform, void *session_private);
 
 extern void
 qat_crypto_sym_clear_session(struct rte_cryptodev *dev, void *session);
 
 
 uint16_t
-qat_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
+qat_sym_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts);
 
 uint16_t
-qat_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
+qat_sym_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts,
+		uint16_t nb_pkts);
 
 #endif /* _QAT_CRYPTO_H_ */
drivers/crypto/qat/rte_qat_cryptodev.c +4 -4
index e500c1e..85700fc 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -89,11 +89,11 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_
 		cryptodev->pci_dev->addr.devid,
 		cryptodev->pci_dev->addr.function);
 
-	cryptodev->dev_type = RTE_CRYPTODEV_QAT_PMD;
+	cryptodev->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	cryptodev->dev_ops = &crypto_qat_ops;
 
-	cryptodev->enqueue_burst = qat_crypto_pkt_tx_burst;
-	cryptodev->dequeue_burst = qat_crypto_pkt_rx_burst;
+	cryptodev->enqueue_burst = qat_sym_crypto_pkt_tx_burst;
+	cryptodev->dequeue_burst = qat_sym_crypto_pkt_rx_burst;
 
 
 	internals = cryptodev->data->dev_private;
examples/l2fwd-crypto/main.c +18 -15
index a950b74..93de786 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -124,13 +124,13 @@ struct l2fwd_crypto_options {
 
 	enum l2fwd_crypto_xform_chain xform_chain;
 
-	struct rte_crypto_xform cipher_xform;
+	struct rte_crypto_sym_xform cipher_xform;
 	uint8_t ckey_data[32];
 
-	struct rte_crypto_key iv_key;
+	struct rte_crypto_sym_key iv_key;
 	uint8_t ivkey_data[16];
 
-	struct rte_crypto_xform auth_xform;
+	struct rte_crypto_sym_xform auth_xform;
 	uint8_t akey_data[128];
 };
 
@@ -142,8 +142,11 @@ struct l2fwd_crypto_params {
 	unsigned digest_length;
 	unsigned block_size;
 
-	struct rte_crypto_key iv_key;
-	struct rte_cryptodev_session *session;
+	struct {
+		uint8_t *data;
+		uint16_t length;
+	} iv;
+	struct rte_cryptodev_sym_session *session;
 };
 
 /** lcore configuration */
@@ -372,7 +375,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,
 	}
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(&ol->op.crypto, cparams->session);
+	rte_crypto_sym_op_attach_session(&ol->op.crypto, cparams->session);
 
 	/* Append space for digest to end of packet */
 	ol->op.crypto.digest.data = (uint8_t *)rte_pktmbuf_append(m,
@@ -474,11 +477,11 @@ generate_random_key(uint8_t *key, unsigned length)
 		key[i] = rand() % 0xff;
 }
 
-static struct rte_cryptodev_session *
+static struct rte_cryptodev_sym_session *
 initialize_crypto_session(struct l2fwd_crypto_options *options,
 		uint8_t cdev_id)
 {
-	struct rte_crypto_xform *first_xform;
+	struct rte_crypto_sym_xform *first_xform;
 
 	if (options->xform_chain == L2FWD_CRYPTO_CIPHER_HASH) {
 		first_xform = &options->cipher_xform;
@@ -489,7 +492,7 @@ initialize_crypto_session(struct l2fwd_crypto_options *options,
 	}
 
 	/* Setup Cipher Parameters */
-	return rte_cryptodev_session_create(cdev_id, first_xform);
+	return rte_cryptodev_sym_session_create(cdev_id, first_xform);
 }
 
 static void
@@ -610,7 +613,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)
 				m = pkts_burst[j];
 				ol = rte_pktmbuf_offload_alloc(
 						l2fwd_mbuf_ol_pool,
-						RTE_PKTMBUF_OL_CRYPTO);
+						RTE_PKTMBUF_OL_CRYPTO_SYM);
 				/*
 				 * If we can't allocate a offload, then drop
 				 * the rest of the burst and dequeue and
@@ -689,7 +692,7 @@ parse_cryptodev_type(enum rte_cryptodev_type *type, char *optarg)
 		*type = RTE_CRYPTODEV_AESNI_MB_PMD;
 		return 0;
 	} else if (strcmp("QAT", optarg) == 0) {
-		*type = RTE_CRYPTODEV_QAT_PMD;
+		*type = RTE_CRYPTODEV_QAT_SYM_PMD;
 		return 0;
 	}
 
@@ -745,7 +748,7 @@ parse_cipher_op(enum rte_crypto_cipher_operation *op, char *optarg)
 
 /** Parse crypto key command line argument */
 static int
-parse_key(struct rte_crypto_key *key __rte_unused,
+parse_key(struct rte_crypto_sym_key *key __rte_unused,
 		unsigned length __rte_unused, char *arg __rte_unused)
 {
 	printf("Currently an unsupported argument!\n");
@@ -982,7 +985,7 @@ l2fwd_crypto_options_print(struct l2fwd_crypto_options *options)
 	switch (options->cdev_type) {
 	case RTE_CRYPTODEV_AESNI_MB_PMD:
 		printf("cryptodev type: AES-NI MB PMD\n"); break;
-	case RTE_CRYPTODEV_QAT_PMD:
+	case RTE_CRYPTODEV_QAT_SYM_PMD:
 		printf("cryptodev type: QAT PMD\n"); break;
 	default:
 		break;
@@ -1179,7 +1182,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports)
 	unsigned i, cdev_id, cdev_count, enabled_cdev_count = 0;
 	int retval;
 
-	if (options->cdev_type == RTE_CRYPTODEV_QAT_PMD) {
+	if (options->cdev_type == RTE_CRYPTODEV_QAT_SYM_PMD) {
 		if (rte_cryptodev_count() < nb_ports)
 			return -1;
 	} else if (options->cdev_type == RTE_CRYPTODEV_AESNI_MB_PMD) {
lib/librte_cryptodev/Makefile +1 -0
index 81fa3fc..0d59229 100644
@@ -45,6 +45,7 @@ SRCS-y += rte_cryptodev.c
 
 # export include files
 SYMLINK-y-include += rte_crypto.h
+SYMLINK-y-include += rte_crypto_sym.h
 SYMLINK-y-include += rte_cryptodev.h
 SYMLINK-y-include += rte_cryptodev_pmd.h
 
lib/librte_cryptodev/rte_crypto.h +3 -560

582 lines not on this page · raw message

lib/librte_cryptodev/rte_crypto_sym.h new file +613 -0

613 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.c +22 -17
index 2838852..c7fef6a 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -572,8 +572,8 @@ rte_cryptodev_queue_pair_stop(uint8_t dev_id, uint16_t queue_pair_id)
 }
 
 static int
-rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
-		unsigned obj_cache_size, int socket_id);
+rte_cryptodev_sym_session_pool_create(struct rte_cryptodev *dev,
+		unsigned nb_objs, unsigned obj_cache_size, int socket_id);
 
 int
 rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
@@ -604,8 +604,10 @@ rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
 	}
 
 	/* Setup Session mempool for device */
-	return rte_crypto_session_pool_create(dev, config->session_mp.nb_objs,
-			config->session_mp.cache_size, config->socket_id);
+	return rte_cryptodev_sym_session_pool_create(dev,
+			config->session_mp.nb_objs,
+			config->session_mp.cache_size,
+			config->socket_id);
 }
 
 
@@ -911,12 +913,12 @@ rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
 
 
 static void
-rte_crypto_session_init(struct rte_mempool *mp,
+rte_cryptodev_sym_session_init(struct rte_mempool *mp,
 		void *opaque_arg,
 		void *_sess,
 		__rte_unused unsigned i)
 {
-	struct rte_cryptodev_session *sess = _sess;
+	struct rte_cryptodev_sym_session *sess = _sess;
 	struct rte_cryptodev *dev = opaque_arg;
 
 	memset(sess, 0, mp->elt_size);
@@ -930,8 +932,8 @@ rte_crypto_session_init(struct rte_mempool *mp,
 }
 
 static int
-rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
-		unsigned obj_cache_size, int socket_id)
+rte_cryptodev_sym_session_pool_create(struct rte_cryptodev *dev,
+		unsigned nb_objs, unsigned obj_cache_size, int socket_id)
 {
 	char mp_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	unsigned priv_sess_size;
@@ -951,7 +953,7 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 		return -ENOMEM;
 	}
 
-	unsigned elt_size = sizeof(struct rte_cryptodev_session) +
+	unsigned elt_size = sizeof(struct rte_cryptodev_sym_session) +
 			priv_sess_size;
 
 	dev->data->session_pool = rte_mempool_lookup(mp_name);
@@ -975,7 +977,8 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 				0, /* private data size */
 				NULL, /* obj initialization constructor */
 				NULL, /* obj initialization constructor arg */
-				rte_crypto_session_init, /* obj constructor */
+				rte_cryptodev_sym_session_init,
+				/**< obj constructor*/
 				dev, /* obj constructor arg */
 				socket_id, /* socket id */
 				0); /* flags */
@@ -990,11 +993,12 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 	return 0;
 }
 
-struct rte_cryptodev_session *
-rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
+struct rte_cryptodev_sym_session *
+rte_cryptodev_sym_session_create(uint8_t dev_id,
+		struct rte_crypto_sym_xform *xform)
 {
 	struct rte_cryptodev *dev;
-	struct rte_cryptodev_session *sess;
+	struct rte_cryptodev_sym_session *sess;
 	void *_sess;
 
 	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
@@ -1010,7 +1014,7 @@ rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
 		return NULL;
 	}
 
-	sess = (struct rte_cryptodev_session *)_sess;
+	sess = (struct rte_cryptodev_sym_session *)_sess;
 
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->session_configure, NULL);
 	if (dev->dev_ops->session_configure(dev, xform, sess->_private) ==
@@ -1026,8 +1030,9 @@ rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
 	return sess;
 }
 
-struct rte_cryptodev_session *
-rte_cryptodev_session_free(uint8_t dev_id, struct rte_cryptodev_session *sess)
+struct rte_cryptodev_sym_session *
+rte_cryptodev_sym_session_free(uint8_t dev_id,
+		struct rte_cryptodev_sym_session *sess)
 {
 	struct rte_cryptodev *dev;
 
lib/librte_cryptodev/rte_cryptodev.h +34 -46

138 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev_pmd.h +13 -19
index 8270afa..7d049ea 100644
@@ -1,6 +1,6 @@
 /*-
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -56,11 +56,6 @@ extern "C" {
 #include "rte_crypto.h"
 #include "rte_cryptodev.h"
 
-struct rte_cryptodev_stats;
-struct rte_cryptodev_info;
-struct rte_cryptodev_qp_conf;
-
-enum rte_cryptodev_event_type;
 
 #ifdef RTE_LIBRTE_CRYPTODEV_DEBUG
 #define RTE_PMD_DEBUG_TRACE(...) \
@@ -80,7 +75,6 @@ struct rte_cryptodev_session {
 };
 
 struct rte_cryptodev_driver;
-struct rte_cryptodev;
 
 /**
  * Initialisation function of a crypto driver invoked for each matching
@@ -364,7 +358,7 @@ typedef uint32_t (*cryptodev_queue_pair_count_t)(struct rte_cryptodev *dev);
  * - On success returns a pointer to a rte_mempool
  * - On failure returns a NULL pointer
  */
-typedef int (*cryptodev_create_session_pool_t)(
+typedef int (*cryptodev_sym_create_session_pool_t)(
 		struct rte_cryptodev *dev, unsigned nb_objs,
 		unsigned obj_cache_size, int socket_id);
 
@@ -378,7 +372,7 @@ typedef int (*cryptodev_create_session_pool_t)(
  *  - On success returns the size of the session structure for device
  *  - On failure returns 0
  */
-typedef unsigned (*cryptodev_get_session_private_size_t)(
+typedef unsigned (*cryptodev_sym_get_session_private_size_t)(
 		struct rte_cryptodev *dev);
 
 /**
@@ -392,7 +386,7 @@ typedef unsigned (*cryptodev_get_session_private_size_t)(
  *  - Returns private session structure on success.
  *  - Returns NULL on failure.
  */
-typedef void (*cryptodev_initialize_session_t)(struct rte_mempool *mempool,
+typedef void (*cryptodev_sym_initialize_session_t)(struct rte_mempool *mempool,
 		void *session_private);
 
 /**
@@ -406,14 +400,14 @@ typedef void (*cryptodev_initialize_session_t)(struct rte_mempool *mempool,
  *  - Returns private session structure on success.
  *  - Returns NULL on failure.
  */
-typedef void * (*cryptodev_configure_session_t)(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform, void *session_private);
+typedef void * (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev,
+		struct rte_crypto_sym_xform *xform, void *session_private);
 
 /**
  * Free Crypto session.
  * @param	session		Cryptodev session structure to free
  */
-typedef void (*cryptodev_free_session_t)(struct rte_cryptodev *dev,
+typedef void (*cryptodev_sym_free_session_t)(struct rte_cryptodev *dev,
 		void *session_private);
 
 
@@ -427,9 +421,9 @@ struct rte_cryptodev_ops {
 	cryptodev_info_get_t dev_infos_get;	/**< Get device info. */
 
 	cryptodev_stats_get_t stats_get;
-	/**< Get generic device statistics. */
+	/**< Get device statistics. */
 	cryptodev_stats_reset_t stats_reset;
-	/**< Reset generic device statistics. */
+	/**< Reset device statistics. */
 
 	cryptodev_queue_pair_setup_t queue_pair_setup;
 	/**< Set up a device queue pair. */
@@ -442,13 +436,13 @@ struct rte_cryptodev_ops {
 	cryptodev_queue_pair_count_t queue_pair_count;
 	/**< Get count of the queue pairs. */
 
-	cryptodev_get_session_private_size_t session_get_size;
+	cryptodev_sym_get_session_private_size_t session_get_size;
 	/**< Return private session. */
-	cryptodev_initialize_session_t session_initialize;
+	cryptodev_sym_initialize_session_t session_initialize;
 	/**< Initialization function for private session data */
-	cryptodev_configure_session_t session_configure;
+	cryptodev_sym_configure_session_t session_configure;
 	/**< Configure a Crypto session. */
-	cryptodev_free_session_t session_clear;
+	cryptodev_sym_free_session_t session_clear;
 	/**< Clear a Crypto sessions private data. */
 };
 
lib/librte_mbuf_offload/rte_mbuf_offload.h +11 -11
index 77993b6..5ce6058 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -67,7 +67,7 @@ extern "C" {
 enum rte_mbuf_ol_op_type {
 	RTE_PKTMBUF_OL_NOT_SPECIFIED = 0,
 	/**< Off-load not specified */
-	RTE_PKTMBUF_OL_CRYPTO
+	RTE_PKTMBUF_OL_CRYPTO_SYM
 	/**< Crypto offload operation */
 };
 
@@ -84,7 +84,7 @@ struct rte_mbuf_offload {
 
 	enum rte_mbuf_ol_op_type type;	/**< offload type */
 	union {
-		struct rte_crypto_op crypto;	/**< Crypto operation */
+		struct rte_crypto_sym_op crypto;	/**< Crypto operation */
 	} op;
 };
 
@@ -194,8 +194,8 @@ __rte_pktmbuf_offload_reset(struct rte_mbuf_offload *ol,
 	ol->type = type;
 
 	switch (type) {
-	case RTE_PKTMBUF_OL_CRYPTO:
-		__rte_crypto_op_reset(&ol->op.crypto); break;
+	case RTE_PKTMBUF_OL_CRYPTO_SYM:
+		__rte_crypto_sym_op_reset(&ol->op.crypto); break;
 	default:
 		break;
 	}
@@ -278,24 +278,24 @@ __rte_pktmbuf_offload_check_priv_data_size(struct rte_mbuf_offload *ol,
  * - On success returns pointer to first crypto xform in crypto operations chain
  * - On failure returns NULL
  */
-static inline struct rte_crypto_xform *
-rte_pktmbuf_offload_alloc_crypto_xforms(struct rte_mbuf_offload *ol,
+static inline struct rte_crypto_sym_xform *
+rte_pktmbuf_offload_alloc_crypto_sym_xforms(struct rte_mbuf_offload *ol,
 		unsigned nb_xforms)
 {
-	struct rte_crypto_xform *xform;
+	struct rte_crypto_sym_xform *xform;
 	void *priv_data;
 	uint16_t size;
 
-	size = sizeof(struct rte_crypto_xform) * nb_xforms;
+	size = sizeof(struct rte_crypto_sym_xform) * nb_xforms;
 	priv_data = __rte_pktmbuf_offload_check_priv_data_size(ol, size);
 
 	if (priv_data == NULL)
 		return NULL;
 
-	ol->op.crypto.xform = xform = (struct rte_crypto_xform *)priv_data;
+	ol->op.crypto.xform = xform = (struct rte_crypto_sym_xform *)priv_data;
 
 	do {
-		xform->type = RTE_CRYPTO_XFORM_NOT_SPECIFIED;
+		xform->type = RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED;
 		xform = xform->next = --nb_xforms > 0 ? xform + 1 : NULL;
 	} while (xform);
 
Signature · 1 line
2.5.0
#10 lore raw

PATCH v3 2/2 cryptodev: change burst API to be crypto op oriented

In reply to Declan Doherty

This patch modifies the crypto burst enqueue/dequeue APIs to operate on bursts rte_crypto_op's rather than the current implementation which operates on rte_mbuf bursts, this simplifies the burst processing in the crypto PMDs and the use of crypto operations in general.

The changes also continues the separatation of the symmetric operation parameters from the more general operation parameters, this will simplify the integration of asymmetric crypto operations in the future.

As well as the changes to the crypto APIs this patch adds functions for managing rte_crypto_op pools to the cryptodev API. It modifies the existing PMDs, unit tests and sample application to work with the modified APIs and finally removes the now unused rte_mbuf_offload library.

---
 MAINTAINERS                                        |   6 +-
 app/test/test_cryptodev.c                          | 804 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 253 +++----
 config/common_bsdapp                               |   8 -
 config/common_linuxapp                             |   8 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 171 +++--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  12 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   2 +-
 drivers/crypto/qat/qat_crypto.c                    | 123 ++--
 drivers/crypto/qat/qat_crypto.h                    |  12 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   4 +-
 examples/l2fwd-crypto/main.c                       | 283 ++++----
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/rte_crypto.h                  | 367 +++++++++-
 lib/librte_cryptodev/rte_crypto_sym.h              | 377 +++++-----
 lib/librte_cryptodev/rte_cryptodev.c               |  76 ++
 lib/librte_cryptodev/rte_cryptodev.h               | 109 ++-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   3 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 --------
 .../rte_mbuf_offload_version.map                   |   7 -
 25 files changed, 1577 insertions(+), 1527 deletions(-)
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
MAINTAINERS +1 -5
index 628bc05..ad6b45e 100644
@@ -222,16 +222,12 @@ F: lib/librte_mbuf/
 F: doc/guides/prog_guide/mbuf_lib.rst
 F: app/test/test_mbuf.c
 
-Packet buffer offload - EXPERIMENTAL
-M: Declan Doherty <[email protected]>
-F: lib/librte_mbuf_offload/
-
 Ethernet API
 M: Thomas Monjalon <[email protected]>
 F: lib/librte_ether/
 F: scripts/test-null.sh
 
-Crypto API - EXPERIMENTAL
+Crypto API
 M: Declan Doherty <[email protected]>
 F: lib/librte_cryptodev/
 F: app/test/test_cryptodev*
app/test/test_cryptodev.c +432 -372

1,131 lines not on this page · raw message

app/test/test_cryptodev.h +5 -4
index 034393e..c84ba42 100644
@@ -32,8 +32,6 @@
 #ifndef TEST_CRYPTODEV_H_
 #define TEST_CRYPTODEV_H_
 
-#define HEX_DUMP 0
-
 #define FALSE                           0
 #define TRUE                            1
 
@@ -47,8 +45,9 @@
 #define DEFAULT_NUM_XFORMS              (2)
 #define NUM_MBUFS                       (8191)
 #define MBUF_CACHE_SIZE                 (250)
-#define MBUF_SIZE   (2048 + DIGEST_BYTE_LENGTH_SHA512 + \
-				sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATAPAYLOAD_SIZE		(2048 + DIGEST_BYTE_LENGTH_SHA512)
+#define MBUF_SIZE			(sizeof(struct rte_mbuf) + \
+		RTE_PKTMBUF_HEADROOM + MBUF_DATAPAYLOAD_SIZE)
 
 #define BYTE_LENGTH(x)				(x/8)
 /* HASH DIGEST LENGTHS */
@@ -62,7 +61,9 @@
 #define AES_XCBC_MAC_KEY_SZ			(16)
 
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA1		(12)
+#define TRUNCATED_DIGEST_BYTE_LENGTH_SHA224		(14)
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA256		(16)
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA512		(32)
+#define TRUNCATED_DIGEST_BYTE_LENGTH_AES_XCBC		(12)
 
 #endif /* TEST_CRYPTODEV_H_ */
app/test/test_cryptodev_perf.c +128 -125

427 lines not on this page · raw message

config/common_bsdapp +0 -8
index 696382c..69a1016 100644
@@ -306,7 +306,6 @@ CONFIG_RTE_PMD_PACKET_PREFETCH=y
 
 #
 # Compile generic crypto device library
-# EXPERIMENTAL: API may change without prior notice
 #
 CONFIG_RTE_LIBRTE_CRYPTODEV=y
 CONFIG_RTE_LIBRTE_CRYPTODEV_DEBUG=n
@@ -357,13 +356,6 @@ CONFIG_RTE_MBUF_REFCNT_ATOMIC=y
 CONFIG_RTE_PKTMBUF_HEADROOM=128
 
 #
-# Compile librte_mbuf_offload
-# EXPERIMENTAL: API may change without prior notice
-#
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD=y
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD_DEBUG=n
-
-#
 # Compile librte_timer
 #
 CONFIG_RTE_LIBRTE_TIMER=y
config/common_linuxapp +0 -8
index f1638db..6da8f54 100644
@@ -320,7 +320,6 @@ CONFIG_RTE_PMD_PACKET_PREFETCH=y
 
 #
 # Compile generic crypto device library
-# EXPERIMENTAL: API may change without prior notice
 #
 CONFIG_RTE_LIBRTE_CRYPTODEV=y
 CONFIG_RTE_LIBRTE_CRYPTODEV_DEBUG=n
@@ -373,13 +372,6 @@ CONFIG_RTE_MBUF_REFCNT_ATOMIC=y
 CONFIG_RTE_PKTMBUF_HEADROOM=128
 
 #
-# Compile librte_mbuf_offload
-# EXPERIMENTAL: API may change without prior notice
-#
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD=y
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD_DEBUG=n
-
-#
 # Compile librte_timer
 #
 CONFIG_RTE_LIBRTE_TIMER=y
doc/api/doxy-api-index.md +0 -1
index 7a91001..f626386 100644
@@ -104,7 +104,6 @@ There are many libraries, so their headers may be grouped by topics:
 
 - **containers**:
   [mbuf]               (@ref rte_mbuf.h),
-  [mbuf_offload]       (@ref rte_mbuf_offload.h),
   [ring]               (@ref rte_ring.h),
   [distributor]        (@ref rte_distributor.h),
   [reorder]            (@ref rte_reorder.h),
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +93 -78

320 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +6 -6
index 3cd9990..d56de12 100644
@@ -76,11 +76,11 @@ aesni_mb_pmd_stats_get(struct rte_cryptodev *dev,
 	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
 		struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];
 
-		stats->enqueued_count += qp->qp_stats.enqueued_count;
-		stats->dequeued_count += qp->qp_stats.dequeued_count;
+		stats->enqueued_count += qp->stats.enqueued_count;
+		stats->dequeued_count += qp->stats.dequeued_count;
 
-		stats->enqueue_err_count += qp->qp_stats.enqueue_err_count;
-		stats->dequeue_err_count += qp->qp_stats.dequeue_err_count;
+		stats->enqueue_err_count += qp->stats.enqueue_err_count;
+		stats->dequeue_err_count += qp->stats.dequeue_err_count;
 	}
 }
 
@@ -93,7 +93,7 @@ aesni_mb_pmd_stats_reset(struct rte_cryptodev *dev)
 	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
 		struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];
 
-		memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+		memset(&qp->stats, 0, sizeof(qp->stats));
 	}
 }
 
@@ -196,7 +196,7 @@ aesni_mb_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 
 	qp->sess_mp = dev->data->session_pool;
 
-	memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+	memset(&qp->stats, 0, sizeof(qp->stats));
 
 	/* Initialise multi-buffer manager */
 	(*qp->ops->job.init_mgr)(&qp->mb_mgr);
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +1 -1
index ab70c15..0aed177 100644
@@ -150,7 +150,7 @@ struct aesni_mb_qp {
 	/**< Ring for placing process packets */
 	struct rte_mempool *sess_mp;
 	/**< Session Mempool */
-	struct rte_cryptodev_stats qp_stats;
+	struct rte_cryptodev_stats stats;
 	/**< Queue pair statistics */
 } __rte_cache_aligned;
 
drivers/crypto/qat/qat_crypto.c +65 -58

244 lines not on this page · raw message

drivers/crypto/qat/qat_crypto.h +6 -6
index e9f71fe..9323383 100644
@@ -115,12 +115,12 @@ extern void
 qat_crypto_sym_clear_session(struct rte_cryptodev *dev, void *session);
 
 
-uint16_t
-qat_sym_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts,
-		uint16_t nb_pkts);
+extern uint16_t
+qat_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops,
+		uint16_t nb_ops);
 
-uint16_t
-qat_sym_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts,
-		uint16_t nb_pkts);
+extern uint16_t
+qat_pmd_dequeue_op_burst(void *qp, struct rte_crypto_op **ops,
+		uint16_t nb_ops);
 
 #endif /* _QAT_CRYPTO_H_ */
drivers/crypto/qat/rte_qat_cryptodev.c +2 -2
index 85700fc..5e51aca 100644
@@ -92,8 +92,8 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_
 	cryptodev->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	cryptodev->dev_ops = &crypto_qat_ops;
 
-	cryptodev->enqueue_burst = qat_sym_crypto_pkt_tx_burst;
-	cryptodev->dequeue_burst = qat_sym_crypto_pkt_rx_burst;
+	cryptodev->enqueue_burst = qat_pmd_enqueue_op_burst;
+	cryptodev->dequeue_burst = qat_pmd_dequeue_op_burst;
 
 
 	internals = cryptodev->data->dev_private;
examples/l2fwd-crypto/main.c +137 -146

563 lines not on this page · raw message

lib/Makefile +0 -1
index ef172ea..4c5c1b4 100644
@@ -36,7 +36,6 @@ DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
 DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
 DIRS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += librte_mempool
 DIRS-$(CONFIG_RTE_LIBRTE_MBUF) += librte_mbuf
-DIRS-$(CONFIG_RTE_LIBRTE_MBUF_OFFLOAD) += librte_mbuf_offload
 DIRS-$(CONFIG_RTE_LIBRTE_TIMER) += librte_timer
 DIRS-$(CONFIG_RTE_LIBRTE_CFGFILE) += librte_cfgfile
 DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline
lib/librte_cryptodev/rte_crypto.h +366 -1

149 lines not on this page · raw message

lib/librte_cryptodev/rte_crypto_sym.h +203 -174

377 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.c +76 -0

76 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.h +54 -55

109 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev_version.map +2 -1
index ff8e93d..39cd9ec 100644

Lines of this file are not shown. View the raw message.

lib/librte_mbuf/rte_mbuf.h +0 -6
index c973e9b..400a849 100644

Lines of this file are not shown. View the raw message.

lib/librte_mbuf_offload/Makefile deleted +0 -52

52 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload.c deleted +0 -100

100 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload.h deleted +0 -310

310 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload_version.map deleted +0 -7
deleted file mode 100644
index 3d3b06a..0000000

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.5.0

Part of the diff is not shown here. View the raw message.

#11 lore raw

Re: [PATCH v3 0/2] cryptodev API changes

In reply to Declan Doherty
Quoted 42 lines · Declan Doherty

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (1):
cryptodev: change burst API to be crypto op oriented

Fiona Trahe (1):
cryptodev: API tidy and changes to support future extensions

  MAINTAINERS                                        |   6 +-
  app/test/test_cryptodev.c                          | 894 +++++++++++----------
  app/test/test_cryptodev.h                          |   9 +-
  app/test/test_cryptodev_perf.c                     | 270 ++++---
  config/common_bsdapp                               |   8 -
  config/common_linuxapp                             |   8 -
  doc/api/doxy-api-index.md                          |   1 -
  drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 199 ++---
  drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  18 +-
  drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   6 +-
  drivers/crypto/qat/qat_crypto.c                    | 150 ++--
  drivers/crypto/qat/qat_crypto.h                    |  14 +-
  drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
  examples/l2fwd-crypto/main.c                       | 300 ++++---
  lib/Makefile                                       |   1 -
  lib/librte_cryptodev/Makefile                      |   1 +
  lib/librte_cryptodev/rte_crypto.h                  | 822 ++++++++-----------
  lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
  lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
  lib/librte_cryptodev/rte_cryptodev.h               | 185 ++---
  lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
  lib/librte_cryptodev/rte_cryptodev_version.map     |   3 +-
  lib/librte_mbuf/rte_mbuf.h                         |   6 -
  lib/librte_mbuf_offload/Makefile                   |  52 --
  lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
  lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 -------
  .../rte_mbuf_offload_version.map                   |   7 -
  27 files changed, 2146 insertions(+), 2021 deletions(-)
Quoted 6 lines

create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h delete mode 100644 lib/librte_mbuf_offload/Makefile
delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map

self NAK.

There is an issue with mis-merged code in __rte_crypto_op_raw_bulk_alloc function in rte_crypto.h

#12 lore raw

v4 cover cryptodev API changes

In reply to Declan Doherty

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

V4:
- Fixes for issues introduced in __rte_crypto_op_raw_bulk_alloc in V3 patcheset.
- Typo fix in cached attribute on rte_crypto_op structure.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (1):
cryptodev: change burst API to be crypto op oriented

Fiona Trahe (1):
cryptodev: API tidy and changes to support future extensions

 MAINTAINERS                                        |   6 +-
 app/test/test_cryptodev.c                          | 894 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_bsdapp                               |   8 -
 config/common_linuxapp                             |   8 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 199 ++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  18 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   6 +-
 drivers/crypto/qat/qat_crypto.c                    | 150 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 300 ++++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 819 +++++++------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 185 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   3 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 -------
 .../rte_mbuf_offload_version.map                   |   7 -
 27 files changed, 2143 insertions(+), 2021 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
Signature · 1 line
2.5.0
#13 lore raw

PATCH v4 1/2 cryptodev: API tidy and changes to support future extensions

From: Fiona Trahe <[email protected]>

This patch splits symmetric specific definitions and functions away from the common crypto APIs to facilitate the future extension and expansion of the cryptodev framework, in order to allow asymmetric crypto operations to be introduced at a later date, as well as to clean the logical structure of the public includes. The patch also introduces the _sym prefix to symmetric specific structure and functions to improve clarity in the API.

---
 app/test/test_cryptodev.c                          | 164 +++---
 app/test/test_cryptodev_perf.c                     |  79 +--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         |  44 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |   6 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   4 +-
 drivers/crypto/qat/qat_crypto.c                    |  51 +-
 drivers/crypto/qat/qat_crypto.h                    |  10 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       |  33 +-
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 563 +------------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 613 +++++++++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               |  39 +-
 lib/librte_cryptodev/rte_cryptodev.h               |  80 ++-
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_mbuf_offload/rte_mbuf_offload.h         |  22 +-
 16 files changed, 912 insertions(+), 837 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
app/test/test_cryptodev.c +87 -77
index 62f8fb0..951b443 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -57,13 +57,13 @@ struct crypto_testsuite_params {
 };
 
 struct crypto_unittest_params {
-	struct rte_crypto_xform cipher_xform;
-	struct rte_crypto_xform auth_xform;
+	struct rte_crypto_sym_xform cipher_xform;
+	struct rte_crypto_sym_xform auth_xform;
 
-	struct rte_cryptodev_session *sess;
+	struct rte_cryptodev_sym_session *sess;
 
 	struct rte_mbuf_offload *ol;
-	struct rte_crypto_op *op;
+	struct rte_crypto_sym_op *op;
 
 	struct rte_mbuf *obuf, *ibuf;
 
@@ -78,7 +78,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 		struct crypto_unittest_params *ut_params);
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_param);
 
@@ -165,7 +165,8 @@ testsuite_setup(void)
 	ts_params->mbuf_ol_pool = rte_pktmbuf_offload_pool_create(
 			"MBUF_OFFLOAD_POOL",
 			NUM_MBUFS, MBUF_CACHE_SIZE,
-			DEFAULT_NUM_XFORMS * sizeof(struct rte_crypto_xform),
+			DEFAULT_NUM_XFORMS *
+					sizeof(struct rte_crypto_sym_xform),
 			rte_socket_id());
 	if (ts_params->mbuf_ol_pool == NULL) {
 		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
@@ -220,7 +221,7 @@ testsuite_setup(void)
 
 		ts_params->conf.nb_queue_pairs = info.max_nb_queue_pairs;
 		ts_params->conf.socket_id = SOCKET_ID_ANY;
-		ts_params->conf.session_mp.nb_objs = info.max_nb_sessions;
+		ts_params->conf.session_mp.nb_objs = info.sym.max_nb_sessions;
 
 		TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id,
 				&ts_params->conf),
@@ -275,7 +276,7 @@ ut_setup(void)
 	ts_params->conf.nb_queue_pairs = DEFAULT_NUM_QPS_PER_QAT_DEVICE;
 	ts_params->conf.socket_id = SOCKET_ID_ANY;
 	ts_params->conf.session_mp.nb_objs =
-			(gbl_cryptodev_type == RTE_CRYPTODEV_QAT_PMD) ?
+			(gbl_cryptodev_type == RTE_CRYPTODEV_QAT_SYM_PMD) ?
 					DEFAULT_NUM_OPS_INFLIGHT :
 					DEFAULT_NUM_OPS_INFLIGHT;
 
@@ -319,7 +320,7 @@ ut_teardown(void)
 
 	/* free crypto session structure */
 	if (ut_params->sess) {
-		rte_cryptodev_session_free(ts_params->valid_devs[0],
+		rte_cryptodev_sym_session_free(ts_params->valid_devs[0],
 				ut_params->sess);
 		ut_params->sess = NULL;
 	}
@@ -464,7 +465,7 @@ test_queue_pair_descriptor_setup(void)
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
-	ts_params->conf.session_mp.nb_objs = dev_info.max_nb_sessions;
+	ts_params->conf.session_mp.nb_objs = dev_info.sym.max_nb_sessions;
 
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
 			&ts_params->conf), "Failed to configure cryptodev %u",
@@ -766,7 +767,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -776,7 +777,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 
 	/* Setup HMAC Parameters */
 
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -786,20 +787,21 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
 	ut_params->op = &ut_params->ol->op.crypto;
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -862,18 +864,18 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
 	ut_params->op = &ut_params->ol->op.crypto;
 
-	TEST_ASSERT_NOT_NULL(rte_pktmbuf_offload_alloc_crypto_xforms(
+	TEST_ASSERT_NOT_NULL(rte_pktmbuf_offload_alloc_crypto_sym_xforms(
 			ut_params->ol, 2),
 			"failed to allocate space for crypto transforms");
 
 	/* Set crypto operation data parameters */
-	ut_params->op->xform->type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->op->xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 
 	/* cipher parameters */
 	ut_params->op->xform->cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
@@ -882,7 +884,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)
 	ut_params->op->xform->cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* hash parameters */
-	ut_params->op->xform->next->type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->op->xform->next->type = RTE_CRYPTO_SYM_XFORM_AUTH;
 
 	ut_params->op->xform->next->auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
 	ut_params->op->xform->next->auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
@@ -958,7 +960,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_SHA1);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -967,7 +969,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -977,13 +979,14 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -991,7 +994,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1066,7 +1069,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1075,7 +1078,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1085,13 +1088,14 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1099,7 +1103,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1168,7 +1172,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_SHA256);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1177,7 +1181,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1187,13 +1191,14 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1201,7 +1206,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1282,7 +1287,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1291,7 +1296,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1301,15 +1306,16 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA512;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1317,7 +1323,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1371,7 +1377,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 		struct crypto_unittest_params *ut_params);
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_params);
 
@@ -1386,8 +1392,9 @@ test_AES_CBC_HMAC_SHA512_decrypt_digest_verify(void)
 			"Failed to create session params");
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	return test_AES_CBC_HMAC_SHA512_decrypt_perform(ut_params->sess,
@@ -1400,7 +1407,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 {
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1409,7 +1416,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1422,7 +1429,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_params)
 {
@@ -1442,7 +1449,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1450,7 +1457,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1522,7 +1529,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1531,7 +1538,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1541,13 +1548,14 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1555,7 +1563,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->iv.data = (uint8_t *)
 		rte_pktmbuf_prepend(ut_params->ibuf,
@@ -1615,7 +1623,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_AES_XCBC);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1624,7 +1632,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1634,13 +1642,14 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1648,7 +1657,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
@@ -1752,7 +1761,7 @@ test_multi_session(void)
 	struct crypto_unittest_params *ut_params = &unittest_params;
 
 	struct rte_cryptodev_info dev_info;
-	struct rte_cryptodev_session **sessions;
+	struct rte_cryptodev_sym_session **sessions;
 
 	uint16_t i;
 
@@ -1761,12 +1770,13 @@ test_multi_session(void)
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
-	sessions = rte_malloc(NULL, (sizeof(struct rte_cryptodev_session *) *
-			dev_info.max_nb_sessions) + 1, 0);
+	sessions = rte_malloc(NULL,
+			(sizeof(struct rte_cryptodev_sym_session *) *
+			dev_info.sym.max_nb_sessions) + 1, 0);
 
 	/* Create multiple crypto sessions*/
-	for (i = 0; i < dev_info.max_nb_sessions; i++) {
-		sessions[i] = rte_cryptodev_session_create(
+	for (i = 0; i < dev_info.sym.max_nb_sessions; i++) {
+		sessions[i] = rte_cryptodev_sym_session_create(
 				ts_params->valid_devs[0],
 			&ut_params->auth_xform);
 		TEST_ASSERT_NOT_NULL(sessions[i],
@@ -1781,13 +1791,13 @@ test_multi_session(void)
 	}
 
 	/* Next session create should fail */
-	sessions[i] = rte_cryptodev_session_create(ts_params->valid_devs[0],
+	sessions[i] = rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
 			&ut_params->auth_xform);
 	TEST_ASSERT_NULL(sessions[i],
 			"Session creation succeeded unexpectedly!");
 
-	for (i = 0; i < dev_info.max_nb_sessions; i++)
-		rte_cryptodev_session_free(ts_params->valid_devs[0],
+	for (i = 0; i < dev_info.sym.max_nb_sessions; i++)
+		rte_cryptodev_sym_session_free(ts_params->valid_devs[0],
 				sessions[i]);
 
 	rte_free(sessions);
@@ -1806,7 +1816,7 @@ test_not_in_place_crypto(void)
 
 	/* Create multiple crypto sessions*/
 
-	ut_params->sess = rte_cryptodev_session_create(
+	ut_params->sess = rte_cryptodev_sym_session_create(
 			ts_params->valid_devs[0], &ut_params->auth_xform);
 
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
@@ -1828,7 +1838,7 @@ test_not_in_place_crypto(void)
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1836,7 +1846,7 @@ test_not_in_place_crypto(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1962,7 +1972,7 @@ static struct unit_test_suite cryptodev_aesni_mb_testsuite  = {
 static int
 test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	gbl_cryptodev_type = RTE_CRYPTODEV_QAT_PMD;
+	gbl_cryptodev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	return unit_test_suite_runner(&cryptodev_qat_testsuite);
 }
 static struct test_command cryptodev_qat_cmd = {
app/test/test_cryptodev_perf.c +45 -34

214 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +23 -21

134 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +3 -3
index e43b898..3cd9990 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -108,7 +108,7 @@ aesni_mb_pmd_info_get(struct rte_cryptodev *dev,
 	if (dev_info != NULL) {
 		dev_info->dev_type = dev->dev_type;
 		dev_info->max_nb_queue_pairs = internals->max_nb_queue_pairs;
-		dev_info->max_nb_sessions = internals->max_nb_sessions;
+		dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
 	}
 }
 
@@ -243,7 +243,7 @@ aesni_mb_pmd_session_get_size(struct rte_cryptodev *dev __rte_unused)
 /** Configure a aesni multi-buffer session from a crypto xform chain */
 static void *
 aesni_mb_pmd_session_configure(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform,	void *sess)
+		struct rte_crypto_sym_xform *xform,	void *sess)
 {
 	struct aesni_mb_private *internals = dev->data->dev_private;
 
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +2 -2
index 2f98609..ab70c15 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -218,7 +218,7 @@ struct aesni_mb_session {
 extern int
 aesni_mb_set_session_parameters(const struct aesni_mb_ops *mb_ops,
 		struct aesni_mb_session *sess,
-		const struct rte_crypto_xform *xform);
+		const struct rte_crypto_sym_xform *xform);
 
 
 /** device specific operations function pointer structure */
drivers/crypto/qat/qat_crypto.c +27 -24

149 lines not on this page · raw message

drivers/crypto/qat/qat_crypto.h +6 -4
index d680364..e9f71fe 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -109,16 +109,18 @@ qat_crypto_sym_session_init(struct rte_mempool *mempool, void *priv_sess);
 
 extern void *
 qat_crypto_sym_configure_session(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform, void *session_private);
+		struct rte_crypto_sym_xform *xform, void *session_private);
 
 extern void
 qat_crypto_sym_clear_session(struct rte_cryptodev *dev, void *session);
 
 
 uint16_t
-qat_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
+qat_sym_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts);
 
 uint16_t
-qat_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
+qat_sym_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts,
+		uint16_t nb_pkts);
 
 #endif /* _QAT_CRYPTO_H_ */
drivers/crypto/qat/rte_qat_cryptodev.c +4 -4
index e500c1e..85700fc 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -89,11 +89,11 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_
 		cryptodev->pci_dev->addr.devid,
 		cryptodev->pci_dev->addr.function);
 
-	cryptodev->dev_type = RTE_CRYPTODEV_QAT_PMD;
+	cryptodev->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	cryptodev->dev_ops = &crypto_qat_ops;
 
-	cryptodev->enqueue_burst = qat_crypto_pkt_tx_burst;
-	cryptodev->dequeue_burst = qat_crypto_pkt_rx_burst;
+	cryptodev->enqueue_burst = qat_sym_crypto_pkt_tx_burst;
+	cryptodev->dequeue_burst = qat_sym_crypto_pkt_rx_burst;
 
 
 	internals = cryptodev->data->dev_private;
examples/l2fwd-crypto/main.c +18 -15
index a950b74..93de786 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -124,13 +124,13 @@ struct l2fwd_crypto_options {
 
 	enum l2fwd_crypto_xform_chain xform_chain;
 
-	struct rte_crypto_xform cipher_xform;
+	struct rte_crypto_sym_xform cipher_xform;
 	uint8_t ckey_data[32];
 
-	struct rte_crypto_key iv_key;
+	struct rte_crypto_sym_key iv_key;
 	uint8_t ivkey_data[16];
 
-	struct rte_crypto_xform auth_xform;
+	struct rte_crypto_sym_xform auth_xform;
 	uint8_t akey_data[128];
 };
 
@@ -142,8 +142,11 @@ struct l2fwd_crypto_params {
 	unsigned digest_length;
 	unsigned block_size;
 
-	struct rte_crypto_key iv_key;
-	struct rte_cryptodev_session *session;
+	struct {
+		uint8_t *data;
+		uint16_t length;
+	} iv;
+	struct rte_cryptodev_sym_session *session;
 };
 
 /** lcore configuration */
@@ -372,7 +375,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,
 	}
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(&ol->op.crypto, cparams->session);
+	rte_crypto_sym_op_attach_session(&ol->op.crypto, cparams->session);
 
 	/* Append space for digest to end of packet */
 	ol->op.crypto.digest.data = (uint8_t *)rte_pktmbuf_append(m,
@@ -474,11 +477,11 @@ generate_random_key(uint8_t *key, unsigned length)
 		key[i] = rand() % 0xff;
 }
 
-static struct rte_cryptodev_session *
+static struct rte_cryptodev_sym_session *
 initialize_crypto_session(struct l2fwd_crypto_options *options,
 		uint8_t cdev_id)
 {
-	struct rte_crypto_xform *first_xform;
+	struct rte_crypto_sym_xform *first_xform;
 
 	if (options->xform_chain == L2FWD_CRYPTO_CIPHER_HASH) {
 		first_xform = &options->cipher_xform;
@@ -489,7 +492,7 @@ initialize_crypto_session(struct l2fwd_crypto_options *options,
 	}
 
 	/* Setup Cipher Parameters */
-	return rte_cryptodev_session_create(cdev_id, first_xform);
+	return rte_cryptodev_sym_session_create(cdev_id, first_xform);
 }
 
 static void
@@ -610,7 +613,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)
 				m = pkts_burst[j];
 				ol = rte_pktmbuf_offload_alloc(
 						l2fwd_mbuf_ol_pool,
-						RTE_PKTMBUF_OL_CRYPTO);
+						RTE_PKTMBUF_OL_CRYPTO_SYM);
 				/*
 				 * If we can't allocate a offload, then drop
 				 * the rest of the burst and dequeue and
@@ -689,7 +692,7 @@ parse_cryptodev_type(enum rte_cryptodev_type *type, char *optarg)
 		*type = RTE_CRYPTODEV_AESNI_MB_PMD;
 		return 0;
 	} else if (strcmp("QAT", optarg) == 0) {
-		*type = RTE_CRYPTODEV_QAT_PMD;
+		*type = RTE_CRYPTODEV_QAT_SYM_PMD;
 		return 0;
 	}
 
@@ -745,7 +748,7 @@ parse_cipher_op(enum rte_crypto_cipher_operation *op, char *optarg)
 
 /** Parse crypto key command line argument */
 static int
-parse_key(struct rte_crypto_key *key __rte_unused,
+parse_key(struct rte_crypto_sym_key *key __rte_unused,
 		unsigned length __rte_unused, char *arg __rte_unused)
 {
 	printf("Currently an unsupported argument!\n");
@@ -982,7 +985,7 @@ l2fwd_crypto_options_print(struct l2fwd_crypto_options *options)
 	switch (options->cdev_type) {
 	case RTE_CRYPTODEV_AESNI_MB_PMD:
 		printf("cryptodev type: AES-NI MB PMD\n"); break;
-	case RTE_CRYPTODEV_QAT_PMD:
+	case RTE_CRYPTODEV_QAT_SYM_PMD:
 		printf("cryptodev type: QAT PMD\n"); break;
 	default:
 		break;
@@ -1179,7 +1182,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports)
 	unsigned i, cdev_id, cdev_count, enabled_cdev_count = 0;
 	int retval;
 
-	if (options->cdev_type == RTE_CRYPTODEV_QAT_PMD) {
+	if (options->cdev_type == RTE_CRYPTODEV_QAT_SYM_PMD) {
 		if (rte_cryptodev_count() < nb_ports)
 			return -1;
 	} else if (options->cdev_type == RTE_CRYPTODEV_AESNI_MB_PMD) {
lib/librte_cryptodev/Makefile +1 -0
index 81fa3fc..0d59229 100644
@@ -45,6 +45,7 @@ SRCS-y += rte_cryptodev.c
 
 # export include files
 SYMLINK-y-include += rte_crypto.h
+SYMLINK-y-include += rte_crypto_sym.h
 SYMLINK-y-include += rte_cryptodev.h
 SYMLINK-y-include += rte_cryptodev_pmd.h
 
lib/librte_cryptodev/rte_crypto.h +3 -560

582 lines not on this page · raw message

lib/librte_cryptodev/rte_crypto_sym.h new file +613 -0

613 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.c +22 -17
index 2838852..c7fef6a 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -572,8 +572,8 @@ rte_cryptodev_queue_pair_stop(uint8_t dev_id, uint16_t queue_pair_id)
 }
 
 static int
-rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
-		unsigned obj_cache_size, int socket_id);
+rte_cryptodev_sym_session_pool_create(struct rte_cryptodev *dev,
+		unsigned nb_objs, unsigned obj_cache_size, int socket_id);
 
 int
 rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
@@ -604,8 +604,10 @@ rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
 	}
 
 	/* Setup Session mempool for device */
-	return rte_crypto_session_pool_create(dev, config->session_mp.nb_objs,
-			config->session_mp.cache_size, config->socket_id);
+	return rte_cryptodev_sym_session_pool_create(dev,
+			config->session_mp.nb_objs,
+			config->session_mp.cache_size,
+			config->socket_id);
 }
 
 
@@ -911,12 +913,12 @@ rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
 
 
 static void
-rte_crypto_session_init(struct rte_mempool *mp,
+rte_cryptodev_sym_session_init(struct rte_mempool *mp,
 		void *opaque_arg,
 		void *_sess,
 		__rte_unused unsigned i)
 {
-	struct rte_cryptodev_session *sess = _sess;
+	struct rte_cryptodev_sym_session *sess = _sess;
 	struct rte_cryptodev *dev = opaque_arg;
 
 	memset(sess, 0, mp->elt_size);
@@ -930,8 +932,8 @@ rte_crypto_session_init(struct rte_mempool *mp,
 }
 
 static int
-rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
-		unsigned obj_cache_size, int socket_id)
+rte_cryptodev_sym_session_pool_create(struct rte_cryptodev *dev,
+		unsigned nb_objs, unsigned obj_cache_size, int socket_id)
 {
 	char mp_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	unsigned priv_sess_size;
@@ -951,7 +953,7 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 		return -ENOMEM;
 	}
 
-	unsigned elt_size = sizeof(struct rte_cryptodev_session) +
+	unsigned elt_size = sizeof(struct rte_cryptodev_sym_session) +
 			priv_sess_size;
 
 	dev->data->session_pool = rte_mempool_lookup(mp_name);
@@ -975,7 +977,8 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 				0, /* private data size */
 				NULL, /* obj initialization constructor */
 				NULL, /* obj initialization constructor arg */
-				rte_crypto_session_init, /* obj constructor */
+				rte_cryptodev_sym_session_init,
+				/**< obj constructor*/
 				dev, /* obj constructor arg */
 				socket_id, /* socket id */
 				0); /* flags */
@@ -990,11 +993,12 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 	return 0;
 }
 
-struct rte_cryptodev_session *
-rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
+struct rte_cryptodev_sym_session *
+rte_cryptodev_sym_session_create(uint8_t dev_id,
+		struct rte_crypto_sym_xform *xform)
 {
 	struct rte_cryptodev *dev;
-	struct rte_cryptodev_session *sess;
+	struct rte_cryptodev_sym_session *sess;
 	void *_sess;
 
 	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
@@ -1010,7 +1014,7 @@ rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
 		return NULL;
 	}
 
-	sess = (struct rte_cryptodev_session *)_sess;
+	sess = (struct rte_cryptodev_sym_session *)_sess;
 
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->session_configure, NULL);
 	if (dev->dev_ops->session_configure(dev, xform, sess->_private) ==
@@ -1026,8 +1030,9 @@ rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
 	return sess;
 }
 
-struct rte_cryptodev_session *
-rte_cryptodev_session_free(uint8_t dev_id, struct rte_cryptodev_session *sess)
+struct rte_cryptodev_sym_session *
+rte_cryptodev_sym_session_free(uint8_t dev_id,
+		struct rte_cryptodev_sym_session *sess)
 {
 	struct rte_cryptodev *dev;
 
lib/librte_cryptodev/rte_cryptodev.h +34 -46

138 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev_pmd.h +13 -19
index 8270afa..7d049ea 100644
@@ -1,6 +1,6 @@
 /*-
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -56,11 +56,6 @@ extern "C" {
 #include "rte_crypto.h"
 #include "rte_cryptodev.h"
 
-struct rte_cryptodev_stats;
-struct rte_cryptodev_info;
-struct rte_cryptodev_qp_conf;
-
-enum rte_cryptodev_event_type;
 
 #ifdef RTE_LIBRTE_CRYPTODEV_DEBUG
 #define RTE_PMD_DEBUG_TRACE(...) \
@@ -80,7 +75,6 @@ struct rte_cryptodev_session {
 };
 
 struct rte_cryptodev_driver;
-struct rte_cryptodev;
 
 /**
  * Initialisation function of a crypto driver invoked for each matching
@@ -364,7 +358,7 @@ typedef uint32_t (*cryptodev_queue_pair_count_t)(struct rte_cryptodev *dev);
  * - On success returns a pointer to a rte_mempool
  * - On failure returns a NULL pointer
  */
-typedef int (*cryptodev_create_session_pool_t)(
+typedef int (*cryptodev_sym_create_session_pool_t)(
 		struct rte_cryptodev *dev, unsigned nb_objs,
 		unsigned obj_cache_size, int socket_id);
 
@@ -378,7 +372,7 @@ typedef int (*cryptodev_create_session_pool_t)(
  *  - On success returns the size of the session structure for device
  *  - On failure returns 0
  */
-typedef unsigned (*cryptodev_get_session_private_size_t)(
+typedef unsigned (*cryptodev_sym_get_session_private_size_t)(
 		struct rte_cryptodev *dev);
 
 /**
@@ -392,7 +386,7 @@ typedef unsigned (*cryptodev_get_session_private_size_t)(
  *  - Returns private session structure on success.
  *  - Returns NULL on failure.
  */
-typedef void (*cryptodev_initialize_session_t)(struct rte_mempool *mempool,
+typedef void (*cryptodev_sym_initialize_session_t)(struct rte_mempool *mempool,
 		void *session_private);
 
 /**
@@ -406,14 +400,14 @@ typedef void (*cryptodev_initialize_session_t)(struct rte_mempool *mempool,
  *  - Returns private session structure on success.
  *  - Returns NULL on failure.
  */
-typedef void * (*cryptodev_configure_session_t)(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform, void *session_private);
+typedef void * (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev,
+		struct rte_crypto_sym_xform *xform, void *session_private);
 
 /**
  * Free Crypto session.
  * @param	session		Cryptodev session structure to free
  */
-typedef void (*cryptodev_free_session_t)(struct rte_cryptodev *dev,
+typedef void (*cryptodev_sym_free_session_t)(struct rte_cryptodev *dev,
 		void *session_private);
 
 
@@ -427,9 +421,9 @@ struct rte_cryptodev_ops {
 	cryptodev_info_get_t dev_infos_get;	/**< Get device info. */
 
 	cryptodev_stats_get_t stats_get;
-	/**< Get generic device statistics. */
+	/**< Get device statistics. */
 	cryptodev_stats_reset_t stats_reset;
-	/**< Reset generic device statistics. */
+	/**< Reset device statistics. */
 
 	cryptodev_queue_pair_setup_t queue_pair_setup;
 	/**< Set up a device queue pair. */
@@ -442,13 +436,13 @@ struct rte_cryptodev_ops {
 	cryptodev_queue_pair_count_t queue_pair_count;
 	/**< Get count of the queue pairs. */
 
-	cryptodev_get_session_private_size_t session_get_size;
+	cryptodev_sym_get_session_private_size_t session_get_size;
 	/**< Return private session. */
-	cryptodev_initialize_session_t session_initialize;
+	cryptodev_sym_initialize_session_t session_initialize;
 	/**< Initialization function for private session data */
-	cryptodev_configure_session_t session_configure;
+	cryptodev_sym_configure_session_t session_configure;
 	/**< Configure a Crypto session. */
-	cryptodev_free_session_t session_clear;
+	cryptodev_sym_free_session_t session_clear;
 	/**< Clear a Crypto sessions private data. */
 };
 
lib/librte_mbuf_offload/rte_mbuf_offload.h +11 -11
index 77993b6..5ce6058 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -67,7 +67,7 @@ extern "C" {
 enum rte_mbuf_ol_op_type {
 	RTE_PKTMBUF_OL_NOT_SPECIFIED = 0,
 	/**< Off-load not specified */
-	RTE_PKTMBUF_OL_CRYPTO
+	RTE_PKTMBUF_OL_CRYPTO_SYM
 	/**< Crypto offload operation */
 };
 
@@ -84,7 +84,7 @@ struct rte_mbuf_offload {
 
 	enum rte_mbuf_ol_op_type type;	/**< offload type */
 	union {
-		struct rte_crypto_op crypto;	/**< Crypto operation */
+		struct rte_crypto_sym_op crypto;	/**< Crypto operation */
 	} op;
 };
 
@@ -194,8 +194,8 @@ __rte_pktmbuf_offload_reset(struct rte_mbuf_offload *ol,
 	ol->type = type;
 
 	switch (type) {
-	case RTE_PKTMBUF_OL_CRYPTO:
-		__rte_crypto_op_reset(&ol->op.crypto); break;
+	case RTE_PKTMBUF_OL_CRYPTO_SYM:
+		__rte_crypto_sym_op_reset(&ol->op.crypto); break;
 	default:
 		break;
 	}
@@ -278,24 +278,24 @@ __rte_pktmbuf_offload_check_priv_data_size(struct rte_mbuf_offload *ol,
  * - On success returns pointer to first crypto xform in crypto operations chain
  * - On failure returns NULL
  */
-static inline struct rte_crypto_xform *
-rte_pktmbuf_offload_alloc_crypto_xforms(struct rte_mbuf_offload *ol,
+static inline struct rte_crypto_sym_xform *
+rte_pktmbuf_offload_alloc_crypto_sym_xforms(struct rte_mbuf_offload *ol,
 		unsigned nb_xforms)
 {
-	struct rte_crypto_xform *xform;
+	struct rte_crypto_sym_xform *xform;
 	void *priv_data;
 	uint16_t size;
 
-	size = sizeof(struct rte_crypto_xform) * nb_xforms;
+	size = sizeof(struct rte_crypto_sym_xform) * nb_xforms;
 	priv_data = __rte_pktmbuf_offload_check_priv_data_size(ol, size);
 
 	if (priv_data == NULL)
 		return NULL;
 
-	ol->op.crypto.xform = xform = (struct rte_crypto_xform *)priv_data;
+	ol->op.crypto.xform = xform = (struct rte_crypto_sym_xform *)priv_data;
 
 	do {
-		xform->type = RTE_CRYPTO_XFORM_NOT_SPECIFIED;
+		xform->type = RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED;
 		xform = xform->next = --nb_xforms > 0 ? xform + 1 : NULL;
 	} while (xform);
 
Signature · 1 line
2.5.0
#14 lore raw

Re: [PATCH v4 1/2] cryptodev: API tidy and changes to support future extensions

2016-02-29 16:52, Declan Doherty:

Quoted 11 lines

From: Fiona Trahe <[email protected]>

This patch splits symmetric specific definitions and functions away from the common crypto APIs to facilitate the future extension and expansion of the cryptodev framework, in order to allow asymmetric crypto operations to be introduced at a later date, as well as to clean the logical structure of the public includes. The patch also introduces the _sym prefix to symmetric specific structure and functions to improve clarity in the API.

Linking test application fails because you forgot renaming the symbols in .map.

#15 lore raw

PATCH v4 2/2 cryptodev: change burst API to be crypto op oriented

In reply to Declan Doherty

This patch modifies the crypto burst enqueue/dequeue APIs to operate on bursts rte_crypto_op's rather than the current implementation which operates on rte_mbuf bursts, this simplifies the burst processing in the crypto PMDs and the use of crypto operations in general.

The changes also continues the separatation of the symmetric operation parameters from the more general operation parameters, this will simplify the integration of asymmetric crypto operations in the future.

As well as the changes to the crypto APIs this patch adds functions for managing rte_crypto_op pools to the cryptodev API. It modifies the existing PMDs, unit tests and sample application to work with the modified APIs and finally removes the now unused rte_mbuf_offload library.

---
 MAINTAINERS                                        |   6 +-
 app/test/test_cryptodev.c                          | 804 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 253 +++----
 config/common_bsdapp                               |   8 -
 config/common_linuxapp                             |   8 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 171 +++--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  12 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   2 +-
 drivers/crypto/qat/qat_crypto.c                    | 123 ++--
 drivers/crypto/qat/qat_crypto.h                    |  12 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   4 +-
 examples/l2fwd-crypto/main.c                       | 283 ++++----
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/rte_crypto.h                  | 364 +++++++++-
 lib/librte_cryptodev/rte_crypto_sym.h              | 379 +++++-----
 lib/librte_cryptodev/rte_cryptodev.c               |  76 ++
 lib/librte_cryptodev/rte_cryptodev.h               | 109 ++-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   3 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 --------
 .../rte_mbuf_offload_version.map                   |   7 -
 25 files changed, 1575 insertions(+), 1528 deletions(-)
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
MAINTAINERS +1 -5
index 628bc05..ad6b45e 100644
@@ -222,16 +222,12 @@ F: lib/librte_mbuf/
 F: doc/guides/prog_guide/mbuf_lib.rst
 F: app/test/test_mbuf.c
 
-Packet buffer offload - EXPERIMENTAL
-M: Declan Doherty <[email protected]>
-F: lib/librte_mbuf_offload/
-
 Ethernet API
 M: Thomas Monjalon <[email protected]>
 F: lib/librte_ether/
 F: scripts/test-null.sh
 
-Crypto API - EXPERIMENTAL
+Crypto API
 M: Declan Doherty <[email protected]>
 F: lib/librte_cryptodev/
 F: app/test/test_cryptodev*
app/test/test_cryptodev.c +432 -372

1,131 lines not on this page · raw message

app/test/test_cryptodev.h +5 -4
index 034393e..c84ba42 100644
@@ -32,8 +32,6 @@
 #ifndef TEST_CRYPTODEV_H_
 #define TEST_CRYPTODEV_H_
 
-#define HEX_DUMP 0
-
 #define FALSE                           0
 #define TRUE                            1
 
@@ -47,8 +45,9 @@
 #define DEFAULT_NUM_XFORMS              (2)
 #define NUM_MBUFS                       (8191)
 #define MBUF_CACHE_SIZE                 (250)
-#define MBUF_SIZE   (2048 + DIGEST_BYTE_LENGTH_SHA512 + \
-				sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATAPAYLOAD_SIZE		(2048 + DIGEST_BYTE_LENGTH_SHA512)
+#define MBUF_SIZE			(sizeof(struct rte_mbuf) + \
+		RTE_PKTMBUF_HEADROOM + MBUF_DATAPAYLOAD_SIZE)
 
 #define BYTE_LENGTH(x)				(x/8)
 /* HASH DIGEST LENGTHS */
@@ -62,7 +61,9 @@
 #define AES_XCBC_MAC_KEY_SZ			(16)
 
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA1		(12)
+#define TRUNCATED_DIGEST_BYTE_LENGTH_SHA224		(14)
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA256		(16)
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA512		(32)
+#define TRUNCATED_DIGEST_BYTE_LENGTH_AES_XCBC		(12)
 
 #endif /* TEST_CRYPTODEV_H_ */
app/test/test_cryptodev_perf.c +128 -125

427 lines not on this page · raw message

config/common_bsdapp +0 -8
index 696382c..69a1016 100644
@@ -306,7 +306,6 @@ CONFIG_RTE_PMD_PACKET_PREFETCH=y
 
 #
 # Compile generic crypto device library
-# EXPERIMENTAL: API may change without prior notice
 #
 CONFIG_RTE_LIBRTE_CRYPTODEV=y
 CONFIG_RTE_LIBRTE_CRYPTODEV_DEBUG=n
@@ -357,13 +356,6 @@ CONFIG_RTE_MBUF_REFCNT_ATOMIC=y
 CONFIG_RTE_PKTMBUF_HEADROOM=128
 
 #
-# Compile librte_mbuf_offload
-# EXPERIMENTAL: API may change without prior notice
-#
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD=y
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD_DEBUG=n
-
-#
 # Compile librte_timer
 #
 CONFIG_RTE_LIBRTE_TIMER=y
config/common_linuxapp +0 -8
index f1638db..6da8f54 100644
@@ -320,7 +320,6 @@ CONFIG_RTE_PMD_PACKET_PREFETCH=y
 
 #
 # Compile generic crypto device library
-# EXPERIMENTAL: API may change without prior notice
 #
 CONFIG_RTE_LIBRTE_CRYPTODEV=y
 CONFIG_RTE_LIBRTE_CRYPTODEV_DEBUG=n
@@ -373,13 +372,6 @@ CONFIG_RTE_MBUF_REFCNT_ATOMIC=y
 CONFIG_RTE_PKTMBUF_HEADROOM=128
 
 #
-# Compile librte_mbuf_offload
-# EXPERIMENTAL: API may change without prior notice
-#
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD=y
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD_DEBUG=n
-
-#
 # Compile librte_timer
 #
 CONFIG_RTE_LIBRTE_TIMER=y
doc/api/doxy-api-index.md +0 -1
index 7a91001..f626386 100644
@@ -104,7 +104,6 @@ There are many libraries, so their headers may be grouped by topics:
 
 - **containers**:
   [mbuf]               (@ref rte_mbuf.h),
-  [mbuf_offload]       (@ref rte_mbuf_offload.h),
   [ring]               (@ref rte_ring.h),
   [distributor]        (@ref rte_distributor.h),
   [reorder]            (@ref rte_reorder.h),
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +93 -78

320 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +6 -6
index 3cd9990..d56de12 100644
@@ -76,11 +76,11 @@ aesni_mb_pmd_stats_get(struct rte_cryptodev *dev,
 	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
 		struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];
 
-		stats->enqueued_count += qp->qp_stats.enqueued_count;
-		stats->dequeued_count += qp->qp_stats.dequeued_count;
+		stats->enqueued_count += qp->stats.enqueued_count;
+		stats->dequeued_count += qp->stats.dequeued_count;
 
-		stats->enqueue_err_count += qp->qp_stats.enqueue_err_count;
-		stats->dequeue_err_count += qp->qp_stats.dequeue_err_count;
+		stats->enqueue_err_count += qp->stats.enqueue_err_count;
+		stats->dequeue_err_count += qp->stats.dequeue_err_count;
 	}
 }
 
@@ -93,7 +93,7 @@ aesni_mb_pmd_stats_reset(struct rte_cryptodev *dev)
 	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
 		struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];
 
-		memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+		memset(&qp->stats, 0, sizeof(qp->stats));
 	}
 }
 
@@ -196,7 +196,7 @@ aesni_mb_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 
 	qp->sess_mp = dev->data->session_pool;
 
-	memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+	memset(&qp->stats, 0, sizeof(qp->stats));
 
 	/* Initialise multi-buffer manager */
 	(*qp->ops->job.init_mgr)(&qp->mb_mgr);
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +1 -1
index ab70c15..0aed177 100644
@@ -150,7 +150,7 @@ struct aesni_mb_qp {
 	/**< Ring for placing process packets */
 	struct rte_mempool *sess_mp;
 	/**< Session Mempool */
-	struct rte_cryptodev_stats qp_stats;
+	struct rte_cryptodev_stats stats;
 	/**< Queue pair statistics */
 } __rte_cache_aligned;
 
drivers/crypto/qat/qat_crypto.c +65 -58

244 lines not on this page · raw message

drivers/crypto/qat/qat_crypto.h +6 -6
index e9f71fe..9323383 100644
@@ -115,12 +115,12 @@ extern void
 qat_crypto_sym_clear_session(struct rte_cryptodev *dev, void *session);
 
 
-uint16_t
-qat_sym_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts,
-		uint16_t nb_pkts);
+extern uint16_t
+qat_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops,
+		uint16_t nb_ops);
 
-uint16_t
-qat_sym_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts,
-		uint16_t nb_pkts);
+extern uint16_t
+qat_pmd_dequeue_op_burst(void *qp, struct rte_crypto_op **ops,
+		uint16_t nb_ops);
 
 #endif /* _QAT_CRYPTO_H_ */
drivers/crypto/qat/rte_qat_cryptodev.c +2 -2
index 85700fc..5e51aca 100644
@@ -92,8 +92,8 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_
 	cryptodev->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	cryptodev->dev_ops = &crypto_qat_ops;
 
-	cryptodev->enqueue_burst = qat_sym_crypto_pkt_tx_burst;
-	cryptodev->dequeue_burst = qat_sym_crypto_pkt_rx_burst;
+	cryptodev->enqueue_burst = qat_pmd_enqueue_op_burst;
+	cryptodev->dequeue_burst = qat_pmd_dequeue_op_burst;
 
 
 	internals = cryptodev->data->dev_private;
examples/l2fwd-crypto/main.c +137 -146

563 lines not on this page · raw message

lib/Makefile +0 -1
index ef172ea..4c5c1b4 100644
@@ -36,7 +36,6 @@ DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
 DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
 DIRS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += librte_mempool
 DIRS-$(CONFIG_RTE_LIBRTE_MBUF) += librte_mbuf
-DIRS-$(CONFIG_RTE_LIBRTE_MBUF_OFFLOAD) += librte_mbuf_offload
 DIRS-$(CONFIG_RTE_LIBRTE_TIMER) += librte_timer
 DIRS-$(CONFIG_RTE_LIBRTE_CFGFILE) += librte_cfgfile
 DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline
lib/librte_cryptodev/rte_crypto.h +363 -1

149 lines not on this page · raw message

lib/librte_cryptodev/rte_crypto_sym.h +204 -175

379 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.c +76 -0

76 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.h +54 -55

109 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev_version.map +2 -1
index ff8e93d..39cd9ec 100644

Lines of this file are not shown. View the raw message.

lib/librte_mbuf/rte_mbuf.h +0 -6
index c973e9b..400a849 100644

Lines of this file are not shown. View the raw message.

lib/librte_mbuf_offload/Makefile deleted +0 -52

52 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload.c deleted +0 -100

100 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload.h deleted +0 -310

310 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload_version.map deleted +0 -7
deleted file mode 100644
index 3d3b06a..0000000

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.5.0

Part of the diff is not shown here. View the raw message.

#16 lore raw

Re: [PATCH v4 0/2] cryptodev API changes

In reply to Declan Doherty
Quoted 61 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Declan Doherty
Sent: Monday, February 29, 2016 4:52 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH v4 0/2] cryptodev API changes

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

V4:
- Fixes for issues introduced in __rte_crypto_op_raw_bulk_alloc in V3 patcheset.
- Typo fix in cached attribute on rte_crypto_op structure.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (1):
cryptodev: change burst API to be crypto op oriented

Fiona Trahe (1):
cryptodev: API tidy and changes to support future extensions

 MAINTAINERS                                        |   6 +-
 app/test/test_cryptodev.c                          | 894 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_bsdapp                               |   8 -
 config/common_linuxapp                             |   8 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 199 ++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  18 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   6 +-
 drivers/crypto/qat/qat_crypto.c                    | 150 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 300 ++++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 819 +++++++------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 185 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   3 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 -------
 .../rte_mbuf_offload_version.map                   |   7 -
 27 files changed, 2143 insertions(+), 2021 deletions(-)  create mode 100644
lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile  delete mode 100644
lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
Quoted 2 lines

--
2.5.0

Series Acked-by: Fiona Trahe <[email protected]>

#17 lore raw

v5 cover cryptodev API changes

In reply to Declan Doherty

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

V4:
- Fixes for issues introduced in __rte_crypto_op_raw_bulk_alloc in V3 patcheset.
- Typo fix in cached attribute on rte_crypto_op structure.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (1):
cryptodev: change burst API to be crypto op oriented

Fiona Trahe (1):
cryptodev: API tidy and changes to support future extensions

 MAINTAINERS                                        |   6 +-
 app/test/test_cryptodev.c                          | 894 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_bsdapp                               |   8 -
 config/common_linuxapp                             |   8 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 199 ++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  18 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   6 +-
 drivers/crypto/qat/qat_crypto.c                    | 150 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 300 ++++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 819 +++++++------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 189 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   7 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 -------
 .../rte_mbuf_offload_version.map                   |   7 -
 27 files changed, 2145 insertions(+), 2027 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
Signature · 1 line
2.1.0
#18 lore raw

Re: [PATCH v5 0/2] cryptodev API changes

Quoted 67 lines

-----Original Message-----
From: Trahe, Fiona
Sent: Friday, March 04, 2016 5:18 PM
To: [email protected]
Cc: Doherty, Declan; Trahe, Fiona
Subject: [PATCH v5 0/2] cryptodev API changes

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

V4:
- Fixes for issues introduced in __rte_crypto_op_raw_bulk_alloc in V3 patcheset.
- Typo fix in cached attribute on rte_crypto_op structure.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (1):
cryptodev: change burst API to be crypto op oriented

Fiona Trahe (1):
cryptodev: API tidy and changes to support future extensions

 MAINTAINERS                                        |   6 +-
 app/test/test_cryptodev.c                          | 894 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_bsdapp                               |   8 -
 config/common_linuxapp                             |   8 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 199 ++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  18 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   6 +-
 drivers/crypto/qat/qat_crypto.c                    | 150 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 300 ++++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 819 +++++++------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 189 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   7 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 -------
 .../rte_mbuf_offload_version.map                   |   7 -
 27 files changed, 2145 insertions(+), 2027 deletions(-)  create mode 100644
lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile  delete mode 100644
lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
Quoted 2 lines

--
2.1.0

NACK - email subject of patches got screwed up. I'll resend.

#19 lore raw

Re: [PATCH v5 0/2] cryptodev API changes

In reply to Fiona Trahe

2016-03-04 17:17, Fiona Trahe:

Quoted 5 lines

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

Why do you want to remove the experimental label?

#20 lore raw

Re: [PATCH v5 0/2] cryptodev API changes

Quoted 10 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Friday, March 04, 2016 5:39 PM
To: Trahe, Fiona
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v5 0/2] cryptodev API changes

2016-03-04 17:17, Fiona Trahe:

Quoted 1 line

This patch set separates the symmetric crypto operations from generic

Quoted 8 lines

operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

Quoted 4 lines

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

Why do you want to remove the experimental label?

Declan had already removed from the MAINTAINERS file and other places in previous patches. This one was just forgotten as far as we know, though as Declan is out we can't confirm with him. Do you think we should keep the label ?

#21 lore raw

Re: [PATCH v5 0/2] cryptodev API changes

2016-03-04 17:43, Trahe, Fiona:

Quoted 10 lines

From: Thomas Monjalon [mailto:[email protected]]

Quoted 9 lines

2016-03-04 17:17, Fiona Trahe:

Quoted 1 line

This patch set separates the symmetric crypto operations from generic

operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

Quoted 4 lines

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

Quoted 5 lines
Quoted 1 line

Why do you want to remove the experimental label?

Declan had already removed from the MAINTAINERS file and other places in previous patches. This one was just forgotten as far as we know, though as Declan is out we can't confirm with him. Do you think we should keep the label ?

I cannot really decide because it's hard to understand the improvements in a such big patch. It would be easier if the changes were split in several steps.
Maybe the last step (last patch) would be to remove the flag. Having it in a separate patch would give the opportunity to detail the reason of the removal in the commit message.

#22 lore raw

Re: [PATCH v5 0/2] cryptodev API changes

Quoted 26 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Friday, March 04, 2016 5:46 PM
To: Trahe, Fiona
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v5 0/2] cryptodev API changes

2016-03-04 17:43, Trahe, Fiona:

Quoted 7 lines

From: Thomas Monjalon [mailto:[email protected]]

Quoted 6 lines

2016-03-04 17:17, Fiona Trahe:

Quoted 2 lines

This patch set separates the symmetric crypto operations from generic

operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

Quoted 1 line
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

Why do you want to remove the experimental label?

Declan had already removed from the MAINTAINERS file and other places in

previous patches.

Quoted 1 line

This one was just forgotten as far as we know, though as Declan is out we

Quoted 8 lines

can't confirm with him.

Quoted 1 line

Do you think we should keep the label ?

I cannot really decide because it's hard to understand the improvements in a such big patch. It would be easier if the changes were split in several steps. Maybe the last step (last patch) would be to remove the flag. Having it in a separate patch would give the opportunity to detail the reason of the removal in the commit message.

Fair enough.
I'll put the label back in.
And we'll handle later with a separate explicit commit to give people a chance to comment.

Tested-by on the v5 series
#23 lore raw

Re: [PATCH v5 0/2] cryptodev API changes

In reply to Fiona Trahe

- Tested Commit: e45ef10c34540c3f543689d833db8bb7296d9e85
- OS: Fedora20 3.11.10-301.fc20.x86_64
- GCC: gcc (GCC) 4.8.3
- CPU: Intel(R) Xeon(R) CPU E5-2658 v3 @ 2.20GHz
- NIC: Niantic
- Default x86_64-native-linuxapp-gcc configuration
- Prerequisites:
- Total 23 cases, 23 passed, 0 failed

- test case 1: QAT Unit test
Total 13 cases, 13 passed, 0 failed

- test case 2: AES_NI Unit test
Total 10 cases, 10 passed, 0 failed

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Fiona Trahe
Sent: Saturday, March 05, 2016 1:18 AM
To: [email protected]
Subject: [dpdk-dev] [PATCH v5 0/2] cryptodev API changes

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

V4:
- Fixes for issues introduced in __rte_crypto_op_raw_bulk_alloc in V3 patcheset.
- Typo fix in cached attribute on rte_crypto_op structure.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (1):
cryptodev: change burst API to be crypto op oriented

Fiona Trahe (1):
cryptodev: API tidy and changes to support future extensions

 MAINTAINERS                                        |   6 +-
 app/test/test_cryptodev.c                          | 894 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_bsdapp                               |   8 -
 config/common_linuxapp                             |   8 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 199 ++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  18 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   6 +-
 drivers/crypto/qat/qat_crypto.c                    | 150 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 300 ++++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 819 +++++++------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 189 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   7 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 -------
 .../rte_mbuf_offload_version.map                   |   7 -
 27 files changed, 2145 insertions(+), 2027 deletions(-)  create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile  delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map

--
2.1.0

#24 lore raw

PATCH v5 1/2 This patch splits symmetric specific definitions and functions away from the common crypto APIs to facilitate the future extension and expansion of the cryptodev framework, in order to allow asymmetric crypto operations to be introduced at a later date, as well as to clean the logical structure of the public includes. The patch also introduces the _sym prefix to symmetric specific structure and functions to improve clarity in the API.

In reply to Declan Doherty
---
 app/test/test_cryptodev.c                          | 164 +++---
 app/test/test_cryptodev_perf.c                     |  79 +--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         |  44 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |   6 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   4 +-
 drivers/crypto/qat/qat_crypto.c                    |  51 +-
 drivers/crypto/qat/qat_crypto.h                    |  10 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       |  33 +-
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 563 +------------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 613 +++++++++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               |  39 +-
 lib/librte_cryptodev/rte_cryptodev.h               |  80 ++-
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   6 +-
 lib/librte_mbuf_offload/rte_mbuf_offload.h         |  22 +-
 17 files changed, 915 insertions(+), 840 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
app/test/test_cryptodev.c +87 -77
index 62f8fb0..951b443 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -57,13 +57,13 @@ struct crypto_testsuite_params {
 };
 
 struct crypto_unittest_params {
-	struct rte_crypto_xform cipher_xform;
-	struct rte_crypto_xform auth_xform;
+	struct rte_crypto_sym_xform cipher_xform;
+	struct rte_crypto_sym_xform auth_xform;
 
-	struct rte_cryptodev_session *sess;
+	struct rte_cryptodev_sym_session *sess;
 
 	struct rte_mbuf_offload *ol;
-	struct rte_crypto_op *op;
+	struct rte_crypto_sym_op *op;
 
 	struct rte_mbuf *obuf, *ibuf;
 
@@ -78,7 +78,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 		struct crypto_unittest_params *ut_params);
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_param);
 
@@ -165,7 +165,8 @@ testsuite_setup(void)
 	ts_params->mbuf_ol_pool = rte_pktmbuf_offload_pool_create(
 			"MBUF_OFFLOAD_POOL",
 			NUM_MBUFS, MBUF_CACHE_SIZE,
-			DEFAULT_NUM_XFORMS * sizeof(struct rte_crypto_xform),
+			DEFAULT_NUM_XFORMS *
+					sizeof(struct rte_crypto_sym_xform),
 			rte_socket_id());
 	if (ts_params->mbuf_ol_pool == NULL) {
 		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
@@ -220,7 +221,7 @@ testsuite_setup(void)
 
 		ts_params->conf.nb_queue_pairs = info.max_nb_queue_pairs;
 		ts_params->conf.socket_id = SOCKET_ID_ANY;
-		ts_params->conf.session_mp.nb_objs = info.max_nb_sessions;
+		ts_params->conf.session_mp.nb_objs = info.sym.max_nb_sessions;
 
 		TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id,
 				&ts_params->conf),
@@ -275,7 +276,7 @@ ut_setup(void)
 	ts_params->conf.nb_queue_pairs = DEFAULT_NUM_QPS_PER_QAT_DEVICE;
 	ts_params->conf.socket_id = SOCKET_ID_ANY;
 	ts_params->conf.session_mp.nb_objs =
-			(gbl_cryptodev_type == RTE_CRYPTODEV_QAT_PMD) ?
+			(gbl_cryptodev_type == RTE_CRYPTODEV_QAT_SYM_PMD) ?
 					DEFAULT_NUM_OPS_INFLIGHT :
 					DEFAULT_NUM_OPS_INFLIGHT;
 
@@ -319,7 +320,7 @@ ut_teardown(void)
 
 	/* free crypto session structure */
 	if (ut_params->sess) {
-		rte_cryptodev_session_free(ts_params->valid_devs[0],
+		rte_cryptodev_sym_session_free(ts_params->valid_devs[0],
 				ut_params->sess);
 		ut_params->sess = NULL;
 	}
@@ -464,7 +465,7 @@ test_queue_pair_descriptor_setup(void)
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
-	ts_params->conf.session_mp.nb_objs = dev_info.max_nb_sessions;
+	ts_params->conf.session_mp.nb_objs = dev_info.sym.max_nb_sessions;
 
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
 			&ts_params->conf), "Failed to configure cryptodev %u",
@@ -766,7 +767,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -776,7 +777,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 
 	/* Setup HMAC Parameters */
 
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -786,20 +787,21 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
 	ut_params->op = &ut_params->ol->op.crypto;
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -862,18 +864,18 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
 	ut_params->op = &ut_params->ol->op.crypto;
 
-	TEST_ASSERT_NOT_NULL(rte_pktmbuf_offload_alloc_crypto_xforms(
+	TEST_ASSERT_NOT_NULL(rte_pktmbuf_offload_alloc_crypto_sym_xforms(
 			ut_params->ol, 2),
 			"failed to allocate space for crypto transforms");
 
 	/* Set crypto operation data parameters */
-	ut_params->op->xform->type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->op->xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 
 	/* cipher parameters */
 	ut_params->op->xform->cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
@@ -882,7 +884,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)
 	ut_params->op->xform->cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* hash parameters */
-	ut_params->op->xform->next->type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->op->xform->next->type = RTE_CRYPTO_SYM_XFORM_AUTH;
 
 	ut_params->op->xform->next->auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
 	ut_params->op->xform->next->auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
@@ -958,7 +960,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_SHA1);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -967,7 +969,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -977,13 +979,14 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -991,7 +994,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1066,7 +1069,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1075,7 +1078,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1085,13 +1088,14 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1099,7 +1103,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1168,7 +1172,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_SHA256);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1177,7 +1181,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1187,13 +1191,14 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1201,7 +1206,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1282,7 +1287,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1291,7 +1296,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1301,15 +1306,16 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA512;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1317,7 +1323,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1371,7 +1377,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 		struct crypto_unittest_params *ut_params);
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_params);
 
@@ -1386,8 +1392,9 @@ test_AES_CBC_HMAC_SHA512_decrypt_digest_verify(void)
 			"Failed to create session params");
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	return test_AES_CBC_HMAC_SHA512_decrypt_perform(ut_params->sess,
@@ -1400,7 +1407,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 {
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1409,7 +1416,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1422,7 +1429,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_params)
 {
@@ -1442,7 +1449,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1450,7 +1457,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1522,7 +1529,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1531,7 +1538,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1541,13 +1548,14 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1555,7 +1563,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->iv.data = (uint8_t *)
 		rte_pktmbuf_prepend(ut_params->ibuf,
@@ -1615,7 +1623,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_AES_XCBC);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1624,7 +1632,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1634,13 +1642,14 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1648,7 +1657,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
@@ -1752,7 +1761,7 @@ test_multi_session(void)
 	struct crypto_unittest_params *ut_params = &unittest_params;
 
 	struct rte_cryptodev_info dev_info;
-	struct rte_cryptodev_session **sessions;
+	struct rte_cryptodev_sym_session **sessions;
 
 	uint16_t i;
 
@@ -1761,12 +1770,13 @@ test_multi_session(void)
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
-	sessions = rte_malloc(NULL, (sizeof(struct rte_cryptodev_session *) *
-			dev_info.max_nb_sessions) + 1, 0);
+	sessions = rte_malloc(NULL,
+			(sizeof(struct rte_cryptodev_sym_session *) *
+			dev_info.sym.max_nb_sessions) + 1, 0);
 
 	/* Create multiple crypto sessions*/
-	for (i = 0; i < dev_info.max_nb_sessions; i++) {
-		sessions[i] = rte_cryptodev_session_create(
+	for (i = 0; i < dev_info.sym.max_nb_sessions; i++) {
+		sessions[i] = rte_cryptodev_sym_session_create(
 				ts_params->valid_devs[0],
 			&ut_params->auth_xform);
 		TEST_ASSERT_NOT_NULL(sessions[i],
@@ -1781,13 +1791,13 @@ test_multi_session(void)
 	}
 
 	/* Next session create should fail */
-	sessions[i] = rte_cryptodev_session_create(ts_params->valid_devs[0],
+	sessions[i] = rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
 			&ut_params->auth_xform);
 	TEST_ASSERT_NULL(sessions[i],
 			"Session creation succeeded unexpectedly!");
 
-	for (i = 0; i < dev_info.max_nb_sessions; i++)
-		rte_cryptodev_session_free(ts_params->valid_devs[0],
+	for (i = 0; i < dev_info.sym.max_nb_sessions; i++)
+		rte_cryptodev_sym_session_free(ts_params->valid_devs[0],
 				sessions[i]);
 
 	rte_free(sessions);
@@ -1806,7 +1816,7 @@ test_not_in_place_crypto(void)
 
 	/* Create multiple crypto sessions*/
 
-	ut_params->sess = rte_cryptodev_session_create(
+	ut_params->sess = rte_cryptodev_sym_session_create(
 			ts_params->valid_devs[0], &ut_params->auth_xform);
 
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
@@ -1828,7 +1838,7 @@ test_not_in_place_crypto(void)
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1836,7 +1846,7 @@ test_not_in_place_crypto(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1962,7 +1972,7 @@ static struct unit_test_suite cryptodev_aesni_mb_testsuite  = {
 static int
 test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	gbl_cryptodev_type = RTE_CRYPTODEV_QAT_PMD;
+	gbl_cryptodev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	return unit_test_suite_runner(&cryptodev_qat_testsuite);
 }
 static struct test_command cryptodev_qat_cmd = {
app/test/test_cryptodev_perf.c +45 -34

214 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +23 -21

134 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +3 -3
index e43b898..3cd9990 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -108,7 +108,7 @@ aesni_mb_pmd_info_get(struct rte_cryptodev *dev,
 	if (dev_info != NULL) {
 		dev_info->dev_type = dev->dev_type;
 		dev_info->max_nb_queue_pairs = internals->max_nb_queue_pairs;
-		dev_info->max_nb_sessions = internals->max_nb_sessions;
+		dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
 	}
 }
 
@@ -243,7 +243,7 @@ aesni_mb_pmd_session_get_size(struct rte_cryptodev *dev __rte_unused)
 /** Configure a aesni multi-buffer session from a crypto xform chain */
 static void *
 aesni_mb_pmd_session_configure(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform,	void *sess)
+		struct rte_crypto_sym_xform *xform,	void *sess)
 {
 	struct aesni_mb_private *internals = dev->data->dev_private;
 
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +2 -2
index 2f98609..ab70c15 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -218,7 +218,7 @@ struct aesni_mb_session {
 extern int
 aesni_mb_set_session_parameters(const struct aesni_mb_ops *mb_ops,
 		struct aesni_mb_session *sess,
-		const struct rte_crypto_xform *xform);
+		const struct rte_crypto_sym_xform *xform);
 
 
 /** device specific operations function pointer structure */
drivers/crypto/qat/qat_crypto.c +27 -24

149 lines not on this page · raw message

drivers/crypto/qat/qat_crypto.h +6 -4
index d680364..e9f71fe 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -109,16 +109,18 @@ qat_crypto_sym_session_init(struct rte_mempool *mempool, void *priv_sess);
 
 extern void *
 qat_crypto_sym_configure_session(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform, void *session_private);
+		struct rte_crypto_sym_xform *xform, void *session_private);
 
 extern void
 qat_crypto_sym_clear_session(struct rte_cryptodev *dev, void *session);
 
 
 uint16_t
-qat_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
+qat_sym_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts);
 
 uint16_t
-qat_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
+qat_sym_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts,
+		uint16_t nb_pkts);
 
 #endif /* _QAT_CRYPTO_H_ */
drivers/crypto/qat/rte_qat_cryptodev.c +4 -4
index e500c1e..85700fc 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -89,11 +89,11 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_
 		cryptodev->pci_dev->addr.devid,
 		cryptodev->pci_dev->addr.function);
 
-	cryptodev->dev_type = RTE_CRYPTODEV_QAT_PMD;
+	cryptodev->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	cryptodev->dev_ops = &crypto_qat_ops;
 
-	cryptodev->enqueue_burst = qat_crypto_pkt_tx_burst;
-	cryptodev->dequeue_burst = qat_crypto_pkt_rx_burst;
+	cryptodev->enqueue_burst = qat_sym_crypto_pkt_tx_burst;
+	cryptodev->dequeue_burst = qat_sym_crypto_pkt_rx_burst;
 
 
 	internals = cryptodev->data->dev_private;
examples/l2fwd-crypto/main.c +18 -15
index a950b74..93de786 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -124,13 +124,13 @@ struct l2fwd_crypto_options {
 
 	enum l2fwd_crypto_xform_chain xform_chain;
 
-	struct rte_crypto_xform cipher_xform;
+	struct rte_crypto_sym_xform cipher_xform;
 	uint8_t ckey_data[32];
 
-	struct rte_crypto_key iv_key;
+	struct rte_crypto_sym_key iv_key;
 	uint8_t ivkey_data[16];
 
-	struct rte_crypto_xform auth_xform;
+	struct rte_crypto_sym_xform auth_xform;
 	uint8_t akey_data[128];
 };
 
@@ -142,8 +142,11 @@ struct l2fwd_crypto_params {
 	unsigned digest_length;
 	unsigned block_size;
 
-	struct rte_crypto_key iv_key;
-	struct rte_cryptodev_session *session;
+	struct {
+		uint8_t *data;
+		uint16_t length;
+	} iv;
+	struct rte_cryptodev_sym_session *session;
 };
 
 /** lcore configuration */
@@ -372,7 +375,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,
 	}
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(&ol->op.crypto, cparams->session);
+	rte_crypto_sym_op_attach_session(&ol->op.crypto, cparams->session);
 
 	/* Append space for digest to end of packet */
 	ol->op.crypto.digest.data = (uint8_t *)rte_pktmbuf_append(m,
@@ -474,11 +477,11 @@ generate_random_key(uint8_t *key, unsigned length)
 		key[i] = rand() % 0xff;
 }
 
-static struct rte_cryptodev_session *
+static struct rte_cryptodev_sym_session *
 initialize_crypto_session(struct l2fwd_crypto_options *options,
 		uint8_t cdev_id)
 {
-	struct rte_crypto_xform *first_xform;
+	struct rte_crypto_sym_xform *first_xform;
 
 	if (options->xform_chain == L2FWD_CRYPTO_CIPHER_HASH) {
 		first_xform = &options->cipher_xform;
@@ -489,7 +492,7 @@ initialize_crypto_session(struct l2fwd_crypto_options *options,
 	}
 
 	/* Setup Cipher Parameters */
-	return rte_cryptodev_session_create(cdev_id, first_xform);
+	return rte_cryptodev_sym_session_create(cdev_id, first_xform);
 }
 
 static void
@@ -610,7 +613,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)
 				m = pkts_burst[j];
 				ol = rte_pktmbuf_offload_alloc(
 						l2fwd_mbuf_ol_pool,
-						RTE_PKTMBUF_OL_CRYPTO);
+						RTE_PKTMBUF_OL_CRYPTO_SYM);
 				/*
 				 * If we can't allocate a offload, then drop
 				 * the rest of the burst and dequeue and
@@ -689,7 +692,7 @@ parse_cryptodev_type(enum rte_cryptodev_type *type, char *optarg)
 		*type = RTE_CRYPTODEV_AESNI_MB_PMD;
 		return 0;
 	} else if (strcmp("QAT", optarg) == 0) {
-		*type = RTE_CRYPTODEV_QAT_PMD;
+		*type = RTE_CRYPTODEV_QAT_SYM_PMD;
 		return 0;
 	}
 
@@ -745,7 +748,7 @@ parse_cipher_op(enum rte_crypto_cipher_operation *op, char *optarg)
 
 /** Parse crypto key command line argument */
 static int
-parse_key(struct rte_crypto_key *key __rte_unused,
+parse_key(struct rte_crypto_sym_key *key __rte_unused,
 		unsigned length __rte_unused, char *arg __rte_unused)
 {
 	printf("Currently an unsupported argument!\n");
@@ -982,7 +985,7 @@ l2fwd_crypto_options_print(struct l2fwd_crypto_options *options)
 	switch (options->cdev_type) {
 	case RTE_CRYPTODEV_AESNI_MB_PMD:
 		printf("cryptodev type: AES-NI MB PMD\n"); break;
-	case RTE_CRYPTODEV_QAT_PMD:
+	case RTE_CRYPTODEV_QAT_SYM_PMD:
 		printf("cryptodev type: QAT PMD\n"); break;
 	default:
 		break;
@@ -1179,7 +1182,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports)
 	unsigned i, cdev_id, cdev_count, enabled_cdev_count = 0;
 	int retval;
 
-	if (options->cdev_type == RTE_CRYPTODEV_QAT_PMD) {
+	if (options->cdev_type == RTE_CRYPTODEV_QAT_SYM_PMD) {
 		if (rte_cryptodev_count() < nb_ports)
 			return -1;
 	} else if (options->cdev_type == RTE_CRYPTODEV_AESNI_MB_PMD) {
lib/librte_cryptodev/Makefile +1 -0
index 81fa3fc..0d59229 100644
@@ -45,6 +45,7 @@ SRCS-y += rte_cryptodev.c
 
 # export include files
 SYMLINK-y-include += rte_crypto.h
+SYMLINK-y-include += rte_crypto_sym.h
 SYMLINK-y-include += rte_cryptodev.h
 SYMLINK-y-include += rte_cryptodev_pmd.h
 
lib/librte_cryptodev/rte_crypto.h +3 -560

582 lines not on this page · raw message

lib/librte_cryptodev/rte_crypto_sym.h new file +613 -0

613 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.c +22 -17
index 2838852..c7fef6a 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -572,8 +572,8 @@ rte_cryptodev_queue_pair_stop(uint8_t dev_id, uint16_t queue_pair_id)
 }
 
 static int
-rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
-		unsigned obj_cache_size, int socket_id);
+rte_cryptodev_sym_session_pool_create(struct rte_cryptodev *dev,
+		unsigned nb_objs, unsigned obj_cache_size, int socket_id);
 
 int
 rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
@@ -604,8 +604,10 @@ rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
 	}
 
 	/* Setup Session mempool for device */
-	return rte_crypto_session_pool_create(dev, config->session_mp.nb_objs,
-			config->session_mp.cache_size, config->socket_id);
+	return rte_cryptodev_sym_session_pool_create(dev,
+			config->session_mp.nb_objs,
+			config->session_mp.cache_size,
+			config->socket_id);
 }
 
 
@@ -911,12 +913,12 @@ rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
 
 
 static void
-rte_crypto_session_init(struct rte_mempool *mp,
+rte_cryptodev_sym_session_init(struct rte_mempool *mp,
 		void *opaque_arg,
 		void *_sess,
 		__rte_unused unsigned i)
 {
-	struct rte_cryptodev_session *sess = _sess;
+	struct rte_cryptodev_sym_session *sess = _sess;
 	struct rte_cryptodev *dev = opaque_arg;
 
 	memset(sess, 0, mp->elt_size);
@@ -930,8 +932,8 @@ rte_crypto_session_init(struct rte_mempool *mp,
 }
 
 static int
-rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
-		unsigned obj_cache_size, int socket_id)
+rte_cryptodev_sym_session_pool_create(struct rte_cryptodev *dev,
+		unsigned nb_objs, unsigned obj_cache_size, int socket_id)
 {
 	char mp_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	unsigned priv_sess_size;
@@ -951,7 +953,7 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 		return -ENOMEM;
 	}
 
-	unsigned elt_size = sizeof(struct rte_cryptodev_session) +
+	unsigned elt_size = sizeof(struct rte_cryptodev_sym_session) +
 			priv_sess_size;
 
 	dev->data->session_pool = rte_mempool_lookup(mp_name);
@@ -975,7 +977,8 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 				0, /* private data size */
 				NULL, /* obj initialization constructor */
 				NULL, /* obj initialization constructor arg */
-				rte_crypto_session_init, /* obj constructor */
+				rte_cryptodev_sym_session_init,
+				/**< obj constructor*/
 				dev, /* obj constructor arg */
 				socket_id, /* socket id */
 				0); /* flags */
@@ -990,11 +993,12 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 	return 0;
 }
 
-struct rte_cryptodev_session *
-rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
+struct rte_cryptodev_sym_session *
+rte_cryptodev_sym_session_create(uint8_t dev_id,
+		struct rte_crypto_sym_xform *xform)
 {
 	struct rte_cryptodev *dev;
-	struct rte_cryptodev_session *sess;
+	struct rte_cryptodev_sym_session *sess;
 	void *_sess;
 
 	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
@@ -1010,7 +1014,7 @@ rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
 		return NULL;
 	}
 
-	sess = (struct rte_cryptodev_session *)_sess;
+	sess = (struct rte_cryptodev_sym_session *)_sess;
 
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->session_configure, NULL);
 	if (dev->dev_ops->session_configure(dev, xform, sess->_private) ==
@@ -1026,8 +1030,9 @@ rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
 	return sess;
 }
 
-struct rte_cryptodev_session *
-rte_cryptodev_session_free(uint8_t dev_id, struct rte_cryptodev_session *sess)
+struct rte_cryptodev_sym_session *
+rte_cryptodev_sym_session_free(uint8_t dev_id,
+		struct rte_cryptodev_sym_session *sess)
 {
 	struct rte_cryptodev *dev;
 
lib/librte_cryptodev/rte_cryptodev.h +34 -46

138 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev_pmd.h +13 -19
index 8270afa..7d049ea 100644
@@ -1,6 +1,6 @@
 /*-
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -56,11 +56,6 @@ extern "C" {
 #include "rte_crypto.h"
 #include "rte_cryptodev.h"
 
-struct rte_cryptodev_stats;
-struct rte_cryptodev_info;
-struct rte_cryptodev_qp_conf;
-
-enum rte_cryptodev_event_type;
 
 #ifdef RTE_LIBRTE_CRYPTODEV_DEBUG
 #define RTE_PMD_DEBUG_TRACE(...) \
@@ -80,7 +75,6 @@ struct rte_cryptodev_session {
 };
 
 struct rte_cryptodev_driver;
-struct rte_cryptodev;
 
 /**
  * Initialisation function of a crypto driver invoked for each matching
@@ -364,7 +358,7 @@ typedef uint32_t (*cryptodev_queue_pair_count_t)(struct rte_cryptodev *dev);
  * - On success returns a pointer to a rte_mempool
  * - On failure returns a NULL pointer
  */
-typedef int (*cryptodev_create_session_pool_t)(
+typedef int (*cryptodev_sym_create_session_pool_t)(
 		struct rte_cryptodev *dev, unsigned nb_objs,
 		unsigned obj_cache_size, int socket_id);
 
@@ -378,7 +372,7 @@ typedef int (*cryptodev_create_session_pool_t)(
  *  - On success returns the size of the session structure for device
  *  - On failure returns 0
  */
-typedef unsigned (*cryptodev_get_session_private_size_t)(
+typedef unsigned (*cryptodev_sym_get_session_private_size_t)(
 		struct rte_cryptodev *dev);
 
 /**
@@ -392,7 +386,7 @@ typedef unsigned (*cryptodev_get_session_private_size_t)(
  *  - Returns private session structure on success.
  *  - Returns NULL on failure.
  */
-typedef void (*cryptodev_initialize_session_t)(struct rte_mempool *mempool,
+typedef void (*cryptodev_sym_initialize_session_t)(struct rte_mempool *mempool,
 		void *session_private);
 
 /**
@@ -406,14 +400,14 @@ typedef void (*cryptodev_initialize_session_t)(struct rte_mempool *mempool,
  *  - Returns private session structure on success.
  *  - Returns NULL on failure.
  */
-typedef void * (*cryptodev_configure_session_t)(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform, void *session_private);
+typedef void * (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev,
+		struct rte_crypto_sym_xform *xform, void *session_private);
 
 /**
  * Free Crypto session.
  * @param	session		Cryptodev session structure to free
  */
-typedef void (*cryptodev_free_session_t)(struct rte_cryptodev *dev,
+typedef void (*cryptodev_sym_free_session_t)(struct rte_cryptodev *dev,
 		void *session_private);
 
 
@@ -427,9 +421,9 @@ struct rte_cryptodev_ops {
 	cryptodev_info_get_t dev_infos_get;	/**< Get device info. */
 
 	cryptodev_stats_get_t stats_get;
-	/**< Get generic device statistics. */
+	/**< Get device statistics. */
 	cryptodev_stats_reset_t stats_reset;
-	/**< Reset generic device statistics. */
+	/**< Reset device statistics. */
 
 	cryptodev_queue_pair_setup_t queue_pair_setup;
 	/**< Set up a device queue pair. */
@@ -442,13 +436,13 @@ struct rte_cryptodev_ops {
 	cryptodev_queue_pair_count_t queue_pair_count;
 	/**< Get count of the queue pairs. */
 
-	cryptodev_get_session_private_size_t session_get_size;
+	cryptodev_sym_get_session_private_size_t session_get_size;
 	/**< Return private session. */
-	cryptodev_initialize_session_t session_initialize;
+	cryptodev_sym_initialize_session_t session_initialize;
 	/**< Initialization function for private session data */
-	cryptodev_configure_session_t session_configure;
+	cryptodev_sym_configure_session_t session_configure;
 	/**< Configure a Crypto session. */
-	cryptodev_free_session_t session_clear;
+	cryptodev_sym_free_session_t session_clear;
 	/**< Clear a Crypto sessions private data. */
 };
 
lib/librte_cryptodev/rte_cryptodev_version.map +3 -3
index ff8e93d..a46af6f 100644
@@ -16,8 +16,8 @@ DPDK_2.2 {
 	rte_cryptodev_pmd_driver_register;
 	rte_cryptodev_pmd_release_device;
 	rte_cryptodev_pmd_virtual_dev_init;
-	rte_cryptodev_session_create;
-	rte_cryptodev_session_free;
+	rte_cryptodev_sym_session_create;
+	rte_cryptodev_sym_session_free;
 	rte_cryptodev_socket_id;
 	rte_cryptodev_start;
 	rte_cryptodev_stats_get;
@@ -29,4 +29,4 @@ DPDK_2.2 {
 	rte_cryptodev_queue_pair_stop;
 
 	local: *;
-};
\ No newline at end of file
+};
lib/librte_mbuf_offload/rte_mbuf_offload.h +11 -11
index 77993b6..5ce6058 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -67,7 +67,7 @@ extern "C" {
 enum rte_mbuf_ol_op_type {
 	RTE_PKTMBUF_OL_NOT_SPECIFIED = 0,
 	/**< Off-load not specified */
-	RTE_PKTMBUF_OL_CRYPTO
+	RTE_PKTMBUF_OL_CRYPTO_SYM
 	/**< Crypto offload operation */
 };
 
@@ -84,7 +84,7 @@ struct rte_mbuf_offload {
 
 	enum rte_mbuf_ol_op_type type;	/**< offload type */
 	union {
-		struct rte_crypto_op crypto;	/**< Crypto operation */
+		struct rte_crypto_sym_op crypto;	/**< Crypto operation */
 	} op;
 };
 
@@ -194,8 +194,8 @@ __rte_pktmbuf_offload_reset(struct rte_mbuf_offload *ol,
 	ol->type = type;
 
 	switch (type) {
-	case RTE_PKTMBUF_OL_CRYPTO:
-		__rte_crypto_op_reset(&ol->op.crypto); break;
+	case RTE_PKTMBUF_OL_CRYPTO_SYM:
+		__rte_crypto_sym_op_reset(&ol->op.crypto); break;
 	default:
 		break;
 	}
@@ -278,24 +278,24 @@ __rte_pktmbuf_offload_check_priv_data_size(struct rte_mbuf_offload *ol,
  * - On success returns pointer to first crypto xform in crypto operations chain
  * - On failure returns NULL
  */
-static inline struct rte_crypto_xform *
-rte_pktmbuf_offload_alloc_crypto_xforms(struct rte_mbuf_offload *ol,
+static inline struct rte_crypto_sym_xform *
+rte_pktmbuf_offload_alloc_crypto_sym_xforms(struct rte_mbuf_offload *ol,
 		unsigned nb_xforms)
 {
-	struct rte_crypto_xform *xform;
+	struct rte_crypto_sym_xform *xform;
 	void *priv_data;
 	uint16_t size;
 
-	size = sizeof(struct rte_crypto_xform) * nb_xforms;
+	size = sizeof(struct rte_crypto_sym_xform) * nb_xforms;
 	priv_data = __rte_pktmbuf_offload_check_priv_data_size(ol, size);
 
 	if (priv_data == NULL)
 		return NULL;
 
-	ol->op.crypto.xform = xform = (struct rte_crypto_xform *)priv_data;
+	ol->op.crypto.xform = xform = (struct rte_crypto_sym_xform *)priv_data;
 
 	do {
-		xform->type = RTE_CRYPTO_XFORM_NOT_SPECIFIED;
+		xform->type = RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED;
 		xform = xform->next = --nb_xforms > 0 ? xform + 1 : NULL;
 	} while (xform);
 
Signature · 1 line
2.1.0
#25 lore raw

PATCH v5 2/2 This patch modifies the crypto burst enqueue/dequeue APIs to operate on bursts rte_crypto_op's rather than the current implementation which operates on rte_mbuf bursts, this simplifies the burst processing in the crypto PMDs and the use of crypto operations in general.

In reply to Declan Doherty

The changes also continues the separatation of the symmetric operation parameters from the more general operation parameters, this will simplify the integration of asymmetric crypto operations in the future.

As well as the changes to the crypto APIs this patch adds functions for managing rte_crypto_op pools to the cryptodev API. It modifies the existing PMDs, unit tests and sample application to work with the modified APIs and finally removes the now unused rte_mbuf_offload library.

---
 MAINTAINERS                                        |   6 +-
 app/test/test_cryptodev.c                          | 804 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 253 +++----
 config/common_bsdapp                               |   8 -
 config/common_linuxapp                             |   8 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 171 +++--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  12 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   2 +-
 drivers/crypto/qat/qat_crypto.c                    | 123 ++--
 drivers/crypto/qat/qat_crypto.h                    |  12 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   4 +-
 examples/l2fwd-crypto/main.c                       | 283 ++++----
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/rte_crypto.h                  | 364 +++++++++-
 lib/librte_cryptodev/rte_crypto_sym.h              | 379 +++++-----
 lib/librte_cryptodev/rte_cryptodev.c               |  76 ++
 lib/librte_cryptodev/rte_cryptodev.h               | 113 ++-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   5 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 --------
 .../rte_mbuf_offload_version.map                   |   7 -
 25 files changed, 1576 insertions(+), 1533 deletions(-)
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
MAINTAINERS +1 -5
index 628bc05..ad6b45e 100644
@@ -222,16 +222,12 @@ F: lib/librte_mbuf/
 F: doc/guides/prog_guide/mbuf_lib.rst
 F: app/test/test_mbuf.c
 
-Packet buffer offload - EXPERIMENTAL
-M: Declan Doherty <[email protected]>
-F: lib/librte_mbuf_offload/
-
 Ethernet API
 M: Thomas Monjalon <[email protected]>
 F: lib/librte_ether/
 F: scripts/test-null.sh
 
-Crypto API - EXPERIMENTAL
+Crypto API
 M: Declan Doherty <[email protected]>
 F: lib/librte_cryptodev/
 F: app/test/test_cryptodev*
app/test/test_cryptodev.c +432 -372

1,131 lines not on this page · raw message

app/test/test_cryptodev.h +5 -4
index 034393e..c84ba42 100644
@@ -32,8 +32,6 @@
 #ifndef TEST_CRYPTODEV_H_
 #define TEST_CRYPTODEV_H_
 
-#define HEX_DUMP 0
-
 #define FALSE                           0
 #define TRUE                            1
 
@@ -47,8 +45,9 @@
 #define DEFAULT_NUM_XFORMS              (2)
 #define NUM_MBUFS                       (8191)
 #define MBUF_CACHE_SIZE                 (250)
-#define MBUF_SIZE   (2048 + DIGEST_BYTE_LENGTH_SHA512 + \
-				sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATAPAYLOAD_SIZE		(2048 + DIGEST_BYTE_LENGTH_SHA512)
+#define MBUF_SIZE			(sizeof(struct rte_mbuf) + \
+		RTE_PKTMBUF_HEADROOM + MBUF_DATAPAYLOAD_SIZE)
 
 #define BYTE_LENGTH(x)				(x/8)
 /* HASH DIGEST LENGTHS */
@@ -62,7 +61,9 @@
 #define AES_XCBC_MAC_KEY_SZ			(16)
 
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA1		(12)
+#define TRUNCATED_DIGEST_BYTE_LENGTH_SHA224		(14)
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA256		(16)
 #define TRUNCATED_DIGEST_BYTE_LENGTH_SHA512		(32)
+#define TRUNCATED_DIGEST_BYTE_LENGTH_AES_XCBC		(12)
 
 #endif /* TEST_CRYPTODEV_H_ */
app/test/test_cryptodev_perf.c +128 -125

427 lines not on this page · raw message

config/common_bsdapp +0 -8
index 7df5ac6..3ac2ebd 100644
@@ -301,7 +301,6 @@ CONFIG_RTE_PMD_PACKET_PREFETCH=y
 
 #
 # Compile generic crypto device library
-# EXPERIMENTAL: API may change without prior notice
 #
 CONFIG_RTE_LIBRTE_CRYPTODEV=y
 CONFIG_RTE_LIBRTE_CRYPTODEV_DEBUG=n
@@ -352,13 +351,6 @@ CONFIG_RTE_MBUF_REFCNT_ATOMIC=y
 CONFIG_RTE_PKTMBUF_HEADROOM=128
 
 #
-# Compile librte_mbuf_offload
-# EXPERIMENTAL: API may change without prior notice
-#
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD=y
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD_DEBUG=n
-
-#
 # Compile librte_timer
 #
 CONFIG_RTE_LIBRTE_TIMER=y
config/common_linuxapp +0 -8
index 26df137..3cb9ebe 100644
@@ -315,7 +315,6 @@ CONFIG_RTE_PMD_PACKET_PREFETCH=y
 
 #
 # Compile generic crypto device library
-# EXPERIMENTAL: API may change without prior notice
 #
 CONFIG_RTE_LIBRTE_CRYPTODEV=y
 CONFIG_RTE_LIBRTE_CRYPTODEV_DEBUG=n
@@ -368,13 +367,6 @@ CONFIG_RTE_MBUF_REFCNT_ATOMIC=y
 CONFIG_RTE_PKTMBUF_HEADROOM=128
 
 #
-# Compile librte_mbuf_offload
-# EXPERIMENTAL: API may change without prior notice
-#
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD=y
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD_DEBUG=n
-
-#
 # Compile librte_timer
 #
 CONFIG_RTE_LIBRTE_TIMER=y
doc/api/doxy-api-index.md +0 -1
index 7a91001..f626386 100644
@@ -104,7 +104,6 @@ There are many libraries, so their headers may be grouped by topics:
 
 - **containers**:
   [mbuf]               (@ref rte_mbuf.h),
-  [mbuf_offload]       (@ref rte_mbuf_offload.h),
   [ring]               (@ref rte_ring.h),
   [distributor]        (@ref rte_distributor.h),
   [reorder]            (@ref rte_reorder.h),
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +93 -78

320 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +6 -6
index 3cd9990..d56de12 100644
@@ -76,11 +76,11 @@ aesni_mb_pmd_stats_get(struct rte_cryptodev *dev,
 	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
 		struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];
 
-		stats->enqueued_count += qp->qp_stats.enqueued_count;
-		stats->dequeued_count += qp->qp_stats.dequeued_count;
+		stats->enqueued_count += qp->stats.enqueued_count;
+		stats->dequeued_count += qp->stats.dequeued_count;
 
-		stats->enqueue_err_count += qp->qp_stats.enqueue_err_count;
-		stats->dequeue_err_count += qp->qp_stats.dequeue_err_count;
+		stats->enqueue_err_count += qp->stats.enqueue_err_count;
+		stats->dequeue_err_count += qp->stats.dequeue_err_count;
 	}
 }
 
@@ -93,7 +93,7 @@ aesni_mb_pmd_stats_reset(struct rte_cryptodev *dev)
 	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
 		struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];
 
-		memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+		memset(&qp->stats, 0, sizeof(qp->stats));
 	}
 }
 
@@ -196,7 +196,7 @@ aesni_mb_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 
 	qp->sess_mp = dev->data->session_pool;
 
-	memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+	memset(&qp->stats, 0, sizeof(qp->stats));
 
 	/* Initialise multi-buffer manager */
 	(*qp->ops->job.init_mgr)(&qp->mb_mgr);
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +1 -1
index ab70c15..0aed177 100644
@@ -150,7 +150,7 @@ struct aesni_mb_qp {
 	/**< Ring for placing process packets */
 	struct rte_mempool *sess_mp;
 	/**< Session Mempool */
-	struct rte_cryptodev_stats qp_stats;
+	struct rte_cryptodev_stats stats;
 	/**< Queue pair statistics */
 } __rte_cache_aligned;
 
drivers/crypto/qat/qat_crypto.c +65 -58

244 lines not on this page · raw message

drivers/crypto/qat/qat_crypto.h +6 -6
index e9f71fe..9323383 100644
@@ -115,12 +115,12 @@ extern void
 qat_crypto_sym_clear_session(struct rte_cryptodev *dev, void *session);
 
 
-uint16_t
-qat_sym_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts,
-		uint16_t nb_pkts);
+extern uint16_t
+qat_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops,
+		uint16_t nb_ops);
 
-uint16_t
-qat_sym_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts,
-		uint16_t nb_pkts);
+extern uint16_t
+qat_pmd_dequeue_op_burst(void *qp, struct rte_crypto_op **ops,
+		uint16_t nb_ops);
 
 #endif /* _QAT_CRYPTO_H_ */
drivers/crypto/qat/rte_qat_cryptodev.c +2 -2
index 85700fc..5e51aca 100644
@@ -92,8 +92,8 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_
 	cryptodev->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	cryptodev->dev_ops = &crypto_qat_ops;
 
-	cryptodev->enqueue_burst = qat_sym_crypto_pkt_tx_burst;
-	cryptodev->dequeue_burst = qat_sym_crypto_pkt_rx_burst;
+	cryptodev->enqueue_burst = qat_pmd_enqueue_op_burst;
+	cryptodev->dequeue_burst = qat_pmd_dequeue_op_burst;
 
 
 	internals = cryptodev->data->dev_private;
examples/l2fwd-crypto/main.c +137 -146

563 lines not on this page · raw message

lib/Makefile +0 -1
index 6840f87..f254dba 100644
@@ -36,7 +36,6 @@ DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
 DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
 DIRS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += librte_mempool
 DIRS-$(CONFIG_RTE_LIBRTE_MBUF) += librte_mbuf
-DIRS-$(CONFIG_RTE_LIBRTE_MBUF_OFFLOAD) += librte_mbuf_offload
 DIRS-$(CONFIG_RTE_LIBRTE_TIMER) += librte_timer
 DIRS-$(CONFIG_RTE_LIBRTE_CFGFILE) += librte_cfgfile
 DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline
lib/librte_cryptodev/rte_crypto.h +363 -1

149 lines not on this page · raw message

lib/librte_cryptodev/rte_crypto_sym.h +204 -175

379 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.c +76 -0

76 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.h +54 -59

113 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev_version.map +3 -2
index a46af6f..b682184 100644

Lines of this file are not shown. View the raw message.

lib/librte_mbuf/rte_mbuf.h +0 -6
index e39ad28..52f96c3 100644

Lines of this file are not shown. View the raw message.

lib/librte_mbuf_offload/Makefile deleted +0 -52

52 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload.c deleted +0 -100

100 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload.h deleted +0 -310

310 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload_version.map deleted +0 -7
deleted file mode 100644
index 3d3b06a..0000000

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.1.0

Part of the diff is not shown here. View the raw message.

#26 lore raw

v6 cover cryptodev API changes

In reply to Declan Doherty

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

v6:
- restore EXPERIMENTAL label to cryptodev. Will handle removal in separate thread.
(email subject was incorrect in v5, so v5 hasn't arrived in patchwork, therefore v6 is in-reply-to v4 message id)

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

V4:
- Fixes for issues introduced in __rte_crypto_op_raw_bulk_alloc in V3 patcheset.
- Typo fix in cached attribute on rte_crypto_op structure.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (1):
cryptodev: change burst API to be crypto op oriented

Fiona Trahe (1):
cryptodev: API tidy and changes to support future extensions

 MAINTAINERS                                        |   4 -
 app/test/test_cryptodev.c                          | 894 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_bsdapp                               |   9 +-
 config/common_linuxapp                             |   9 +-
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 199 ++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  18 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   6 +-
 drivers/crypto/qat/qat_crypto.c                    | 150 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 300 ++++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 819 +++++++------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 191 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   7 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 -------
 .../rte_mbuf_offload_version.map                   |   7 -
 27 files changed, 2148 insertions(+), 2026 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
Signature · 1 line
2.1.0
#27 lore raw

v7 cover cryptodev API changes

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

v7:
- remove trailing spaces introduced in v6
- rebase against recent config file changes

v6:
- restore EXPERIMENTAL label to cryptodev. Will handle removal in separate thread.
(email subject was incorrect in v5, so v5 hasn't arrived in patchwork, therefore v6 is in-reply-to v4 message id)

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

V4:
- Fixes for issues introduced in __rte_crypto_op_raw_bulk_alloc in V3 patcheset.
- Typo fix in cached attribute on rte_crypto_op structure.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (1):
cryptodev: change burst API to be crypto op oriented

Fiona Trahe (2):
cryptodev: API tidy and changes to support future extensions
cryptodev: change burst API to be crypto op oriented

 MAINTAINERS                                        |   4 -
 app/test/test_cryptodev.c                          | 894 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_base                                 |   7 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 199 ++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  18 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   6 +-
 drivers/crypto/qat/qat_crypto.c                    | 150 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 300 ++++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 819 +++++++------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 189 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   7 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 -------
 .../rte_mbuf_offload_version.map                   |   7 -
 26 files changed, 2145 insertions(+), 2016 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
Signature · 1 line
2.1.0
#28 lore raw

Re: [PATCH v7 0/2] cryptodev API changes

Quoted 76 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Fiona Trahe
Sent: Monday, March 07, 2016 11:50 AM
To: [email protected]
Subject: [dpdk-dev] [PATCH v7 0/2] cryptodev API changes

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

v7:
- remove trailing spaces introduced in v6
- rebase against recent config file changes

v6:
- restore EXPERIMENTAL label to cryptodev. Will handle removal in separate thread.
(email subject was incorrect in v5, so v5 hasn't arrived in patchwork, therefore v6 is in-reply-to v4 message id)

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

V4:
- Fixes for issues introduced in __rte_crypto_op_raw_bulk_alloc in V3 patcheset.
- Typo fix in cached attribute on rte_crypto_op structure.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (1):
cryptodev: change burst API to be crypto op oriented

Fiona Trahe (2):
cryptodev: API tidy and changes to support future extensions
cryptodev: change burst API to be crypto op oriented

 MAINTAINERS                                        |   4 -
 app/test/test_cryptodev.c                          | 894 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_base                                 |   7 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 199 ++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  18 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   6 +-
 drivers/crypto/qat/qat_crypto.c                    | 150 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 300 ++++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 819 +++++++------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 189 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   7 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 -------
 .../rte_mbuf_offload_version.map                   |   7 -
 26 files changed, 2145 insertions(+), 2016 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644
Quoted 4 lines

lib/librte_mbuf_offload/rte_mbuf_offload_version.map

--
2.1.0

#29 lore raw

Re: [PATCH v7 0/2] cryptodev API changes

In reply to Fiona Trahe

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Fiona Trahe
Sent: Monday, March 7, 2016 11:50 AM
To: [email protected]
Subject: [dpdk-dev] [PATCH v7 0/2] cryptodev API changes

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

v7:
- remove trailing spaces introduced in v6
- rebase against recent config file changes

v6:
- restore EXPERIMENTAL label to cryptodev. Will handle removal in separate thread.
(email subject was incorrect in v5, so v5 hasn't arrived in patchwork, therefore v6 is in-reply-to v4 message id)

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

V4:
- Fixes for issues introduced in __rte_crypto_op_raw_bulk_alloc in V3 patcheset.
- Typo fix in cached attribute on rte_crypto_op structure.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (1):
cryptodev: change burst API to be crypto op oriented

Fiona Trahe (2):
cryptodev: API tidy and changes to support future extensions
cryptodev: change burst API to be crypto op oriented

 MAINTAINERS                                        |   4 -
 app/test/test_cryptodev.c                          | 894 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_base                                 |   7 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 199 ++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  18 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   6 +-
 drivers/crypto/qat/qat_crypto.c                    | 150 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 300 ++++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 819 +++++++------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 189 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   7 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 -------
 .../rte_mbuf_offload_version.map                   |   7 -
 26 files changed, 2145 insertions(+), 2016 deletions(-)  create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile  delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map

--
2.1.0

#30 lore raw

v8 cover cryptodev API changes

In reply to Fiona Trahe

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

v8:
- split patchset for easier review
- fix broken /examples/l2fwd-crypto build in intermediate patch
- split removal of rte_mbuf_offload into separate commit

v7:
- remove trailing spaces introduced in v6
- rebase against recent config file changes

v6:
- restore EXPERIMENTAL label to cryptodev. Will handle removal in separate thread.
(email subject was incorrect in v5, so v5 hasn't arrived in patchwork, therefore v6 is in-reply-to v4 message id)

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

V4:
- Fixes for issues introduced in __rte_crypto_op_raw_bulk_alloc in V3 patcheset.
- Typo fix in cached attribute on rte_crypto_op structure.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (2):
cryptodev: change burst API to be crypto op oriented
mbuf_offload: remove library

Fiona Trahe (3):
cryptodev: code cleanup
cryptodev: refactor to partition common from symmetric-specific code
cryptodev: remove unused phys_addr field from key

 MAINTAINERS                                        |   4 -
 app/test/test_cryptodev.c                          | 883 +++++++++++----------
 app/test/test_cryptodev.h                          |   5 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_base                                 |   7 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 190 +++--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  30 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |  10 +-
 drivers/crypto/qat/qat_crypto.c                    | 160 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 234 +++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 819 ++++++++-----------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 189 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   7 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 --------
 .../rte_mbuf_offload_version.map                   |   7 -
 26 files changed, 2130 insertions(+), 1967 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
Signature · 1 line
2.1.0
#31 lore raw

Re: [PATCH v8 0/5] cryptodev API changes

Quoted 82 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Fiona Trahe
Sent: Thursday, March 10, 2016 1:43 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH v8 0/5] cryptodev API changes

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

v8:
- split patchset for easier review
- fix broken /examples/l2fwd-crypto build in intermediate patch
- split removal of rte_mbuf_offload into separate commit

v7:
- remove trailing spaces introduced in v6
- rebase against recent config file changes

v6:
- restore EXPERIMENTAL label to cryptodev. Will handle removal in separate thread.
(email subject was incorrect in v5, so v5 hasn't arrived in patchwork, therefore v6 is in-reply-to v4 message id)

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

V4:
- Fixes for issues introduced in __rte_crypto_op_raw_bulk_alloc in V3 patcheset.
- Typo fix in cached attribute on rte_crypto_op structure.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (2):
cryptodev: change burst API to be crypto op oriented
mbuf_offload: remove library

Fiona Trahe (3):
cryptodev: code cleanup
cryptodev: refactor to partition common from symmetric-specific code
cryptodev: remove unused phys_addr field from key

 MAINTAINERS                                        |   4 -
 app/test/test_cryptodev.c                          | 883 +++++++++++----------
 app/test/test_cryptodev.h                          |   5 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_base                                 |   7 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 190 +++--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  30 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |  10 +-
 drivers/crypto/qat/qat_crypto.c                    | 160 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 234 +++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 819 ++++++++-----------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 189 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   7 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 --------
 .../rte_mbuf_offload_version.map                   |   7 -
 26 files changed, 2130 insertions(+), 1967 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644
Quoted 4 lines

lib/librte_mbuf_offload/rte_mbuf_offload_version.map

--
2.1.0

#32 lore raw

PATCH v9 1/5 cryptodev: code cleanup

In reply to Fiona Trahe

- Fixed >80char lines in test file
- Removed unused elements from stats struct
- Removed unused objects in rte_cryptodev_pmd.h
- Renamed variables
- Replaced leading spaces with tabs
- Improved performance results display in test

---
 app/test/test_cryptodev.c                          | 151 ++++++++++-----------
 app/test/test_cryptodev.h                          |   5 +-
 app/test/test_cryptodev_perf.c                     |  54 +++++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         |  28 ++--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  12 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   2 +-
 lib/librte_cryptodev/rte_cryptodev.h               |  35 +----
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  10 +-
 8 files changed, 139 insertions(+), 158 deletions(-)
app/test/test_cryptodev.c +75 -76
index 62f8fb0..1a0f204 100644
@@ -165,7 +165,8 @@ testsuite_setup(void)
 	ts_params->mbuf_ol_pool = rte_pktmbuf_offload_pool_create(
 			"MBUF_OFFLOAD_POOL",
 			NUM_MBUFS, MBUF_CACHE_SIZE,
-			DEFAULT_NUM_XFORMS * sizeof(struct rte_crypto_xform),
+			DEFAULT_NUM_XFORMS *
+			sizeof(struct rte_crypto_xform),
 			rte_socket_id());
 	if (ts_params->mbuf_ol_pool == NULL) {
 		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
@@ -679,76 +680,77 @@ static uint8_t aes_cbc_iv[] = {
 /* ***** AES-CBC / HMAC-SHA1 Hash Tests ***** */
 
 static const uint8_t catch_22_quote_2_512_bytes_AES_CBC_ciphertext[] = {
-	0x8B, 0X4D, 0XDA, 0X1B, 0XCF, 0X04, 0XA0, 0X31,
-	0XB4, 0XBF, 0XBD, 0X68, 0X43, 0X20, 0X7E, 0X76,
-	0XB1, 0X96, 0X8B, 0XA2, 0X7C, 0XA2, 0X83, 0X9E,
-	0X39, 0X5A, 0X2F, 0X7E, 0X92, 0XB4, 0X48, 0X1A,
-	0X3F, 0X6B, 0X5D, 0XDF, 0X52, 0X85, 0X5F, 0X8E,
-	0X42, 0X3C, 0XFB, 0XE9, 0X1A, 0X24, 0XD6, 0X08,
-	0XDD, 0XFD, 0X16, 0XFB, 0XE9, 0X55, 0XEF, 0XF0,
-	0XA0, 0X8D, 0X13, 0XAB, 0X81, 0XC6, 0X90, 0X01,
-	0XB5, 0X18, 0X84, 0XB3, 0XF6, 0XE6, 0X11, 0X57,
-	0XD6, 0X71, 0XC6, 0X3C, 0X3F, 0X2F, 0X33, 0XEE,
-	0X24, 0X42, 0X6E, 0XAC, 0X0B, 0XCA, 0XEC, 0XF9,
-	0X84, 0XF8, 0X22, 0XAA, 0X60, 0XF0, 0X32, 0XA9,
-	0X75, 0X75, 0X3B, 0XCB, 0X70, 0X21, 0X0A, 0X8D,
-	0X0F, 0XE0, 0XC4, 0X78, 0X2B, 0XF8, 0X97, 0XE3,
-	0XE4, 0X26, 0X4B, 0X29, 0XDA, 0X88, 0XCD, 0X46,
-	0XEC, 0XAA, 0XF9, 0X7F, 0XF1, 0X15, 0XEA, 0XC3,
-	0X87, 0XE6, 0X31, 0XF2, 0XCF, 0XDE, 0X4D, 0X80,
-	0X70, 0X91, 0X7E, 0X0C, 0XF7, 0X26, 0X3A, 0X92,
-	0X4F, 0X18, 0X83, 0XC0, 0X8F, 0X59, 0X01, 0XA5,
-	0X88, 0XD1, 0XDB, 0X26, 0X71, 0X27, 0X16, 0XF5,
-	0XEE, 0X10, 0X82, 0XAC, 0X68, 0X26, 0X9B, 0XE2,
-	0X6D, 0XD8, 0X9A, 0X80, 0XDF, 0X04, 0X31, 0XD5,
-	0XF1, 0X35, 0X5C, 0X3B, 0XDD, 0X9A, 0X65, 0XBA,
-	0X58, 0X34, 0X85, 0X61, 0X1C, 0X42, 0X10, 0X76,
-	0X73, 0X02, 0X42, 0XC9, 0X23, 0X18, 0X8E, 0XB4,
-	0X6F, 0XB4, 0XA3, 0X54, 0X6E, 0X88, 0X3B, 0X62,
-	0X7C, 0X02, 0X8D, 0X4C, 0X9F, 0XC8, 0X45, 0XF4,
-	0XC9, 0XDE, 0X4F, 0XEB, 0X22, 0X83, 0X1B, 0XE4,
-	0X49, 0X37, 0XE4, 0XAD, 0XE7, 0XCD, 0X21, 0X54,
-	0XBC, 0X1C, 0XC2, 0X04, 0X97, 0XB4, 0X10, 0X61,
-	0XF0, 0XE4, 0XEF, 0X27, 0X63, 0X3A, 0XDA, 0X91,
-	0X41, 0X25, 0X62, 0X1C, 0X5C, 0XB6, 0X38, 0X4A,
-	0X88, 0X71, 0X59, 0X5A, 0X8D, 0XA0, 0X09, 0XAF,
-	0X72, 0X94, 0XD7, 0X79, 0X5C, 0X60, 0X7C, 0X8F,
-	0X4C, 0XF5, 0XD9, 0XA1, 0X39, 0X6D, 0X81, 0X28,
-	0XEF, 0X13, 0X28, 0XDF, 0XF5, 0X3E, 0XF7, 0X8E,
-	0X09, 0X9C, 0X78, 0X18, 0X79, 0XB8, 0X68, 0XD7,
-	0XA8, 0X29, 0X62, 0XAD, 0XDE, 0XE1, 0X61, 0X76,
-	0X1B, 0X05, 0X16, 0XCD, 0XBF, 0X02, 0X8E, 0XA6,
-	0X43, 0X6E, 0X92, 0X55, 0X4F, 0X60, 0X9C, 0X03,
-	0XB8, 0X4F, 0XA3, 0X02, 0XAC, 0XA8, 0XA7, 0X0C,
-	0X1E, 0XB5, 0X6B, 0XF8, 0XC8, 0X4D, 0XDE, 0XD2,
-	0XB0, 0X29, 0X6E, 0X40, 0XE6, 0XD6, 0XC9, 0XE6,
-	0XB9, 0X0F, 0XB6, 0X63, 0XF5, 0XAA, 0X2B, 0X96,
-	0XA7, 0X16, 0XAC, 0X4E, 0X0A, 0X33, 0X1C, 0XA6,
-	0XE6, 0XBD, 0X8A, 0XCF, 0X40, 0XA9, 0XB2, 0XFA,
-	0X63, 0X27, 0XFD, 0X9B, 0XD9, 0XFC, 0XD5, 0X87,
-	0X8D, 0X4C, 0XB6, 0XA4, 0XCB, 0XE7, 0X74, 0X55,
-	0XF4, 0XFB, 0X41, 0X25, 0XB5, 0X4B, 0X0A, 0X1B,
-	0XB1, 0XD6, 0XB7, 0XD9, 0X47, 0X2A, 0XC3, 0X98,
-	0X6A, 0XC4, 0X03, 0X73, 0X1F, 0X93, 0X6E, 0X53,
-	0X19, 0X25, 0X64, 0X15, 0X83, 0XF9, 0X73, 0X2A,
-	0X74, 0XB4, 0X93, 0X69, 0XC4, 0X72, 0XFC, 0X26,
-	0XA2, 0X9F, 0X43, 0X45, 0XDD, 0XB9, 0XEF, 0X36,
-	0XC8, 0X3A, 0XCD, 0X99, 0X9B, 0X54, 0X1A, 0X36,
-	0XC1, 0X59, 0XF8, 0X98, 0XA8, 0XCC, 0X28, 0X0D,
-	0X73, 0X4C, 0XEE, 0X98, 0XCB, 0X7C, 0X58, 0X7E,
-	0X20, 0X75, 0X1E, 0XB7, 0XC9, 0XF8, 0XF2, 0X0E,
-	0X63, 0X9E, 0X05, 0X78, 0X1A, 0XB6, 0XA8, 0X7A,
-	0XF9, 0X98, 0X6A, 0XA6, 0X46, 0X84, 0X2E, 0XF6,
-	0X4B, 0XDC, 0X9B, 0X8F, 0X9B, 0X8F, 0XEE, 0XB4,
-	0XAA, 0X3F, 0XEE, 0XC0, 0X37, 0X27, 0X76, 0XC7,
-	0X95, 0XBB, 0X26, 0X74, 0X69, 0X12, 0X7F, 0XF1,
-	0XBB, 0XFF, 0XAE, 0XB5, 0X99, 0X6E, 0XCB, 0X0C
+	0x8B, 0x4D, 0xDA, 0x1B, 0xCF, 0x04, 0xA0, 0x31,
+	0xB4, 0xBF, 0xBD, 0x68, 0x43, 0x20, 0x7E, 0x76,
+	0xB1, 0x96, 0x8B, 0xA2, 0x7C, 0xA2, 0x83, 0x9E,
+	0x39, 0x5A, 0x2F, 0x7E, 0x92, 0xB4, 0x48, 0x1A,
+	0x3F, 0x6B, 0x5D, 0xDF, 0x52, 0x85, 0x5F, 0x8E,
+	0x42, 0x3C, 0xFB, 0xE9, 0x1A, 0x24, 0xD6, 0x08,
+	0xDD, 0xFD, 0x16, 0xFB, 0xE9, 0x55, 0xEF, 0xF0,
+	0xA0, 0x8D, 0x13, 0xAB, 0x81, 0xC6, 0x90, 0x01,
+	0xB5, 0x18, 0x84, 0xB3, 0xF6, 0xE6, 0x11, 0x57,
+	0xD6, 0x71, 0xC6, 0x3C, 0x3F, 0x2F, 0x33, 0xEE,
+	0x24, 0x42, 0x6E, 0xAC, 0x0B, 0xCA, 0xEC, 0xF9,
+	0x84, 0xF8, 0x22, 0xAA, 0x60, 0xF0, 0x32, 0xA9,
+	0x75, 0x75, 0x3B, 0xCB, 0x70, 0x21, 0x0A, 0x8D,
+	0x0F, 0xE0, 0xC4, 0x78, 0x2B, 0xF8, 0x97, 0xE3,
+	0xE4, 0x26, 0x4B, 0x29, 0xDA, 0x88, 0xCD, 0x46,
+	0xEC, 0xAA, 0xF9, 0x7F, 0xF1, 0x15, 0xEA, 0xC3,
+	0x87, 0xE6, 0x31, 0xF2, 0xCF, 0xDE, 0x4D, 0x80,
+	0x70, 0x91, 0x7E, 0x0C, 0xF7, 0x26, 0x3A, 0x92,
+	0x4F, 0x18, 0x83, 0xC0, 0x8F, 0x59, 0x01, 0xA5,
+	0x88, 0xD1, 0xDB, 0x26, 0x71, 0x27, 0x16, 0xF5,
+	0xEE, 0x10, 0x82, 0xAC, 0x68, 0x26, 0x9B, 0xE2,
+	0x6D, 0xD8, 0x9A, 0x80, 0xDF, 0x04, 0x31, 0xD5,
+	0xF1, 0x35, 0x5C, 0x3B, 0xDD, 0x9A, 0x65, 0xBA,
+	0x58, 0x34, 0x85, 0x61, 0x1C, 0x42, 0x10, 0x76,
+	0x73, 0x02, 0x42, 0xC9, 0x23, 0x18, 0x8E, 0xB4,
+	0x6F, 0xB4, 0xA3, 0x54, 0x6E, 0x88, 0x3B, 0x62,
+	0x7C, 0x02, 0x8D, 0x4C, 0x9F, 0xC8, 0x45, 0xF4,
+	0xC9, 0xDE, 0x4F, 0xEB, 0x22, 0x83, 0x1B, 0xE4,
+	0x49, 0x37, 0xE4, 0xAD, 0xE7, 0xCD, 0x21, 0x54,
+	0xBC, 0x1C, 0xC2, 0x04, 0x97, 0xB4, 0x10, 0x61,
+	0xF0, 0xE4, 0xEF, 0x27, 0x63, 0x3A, 0xDA, 0x91,
+	0x41, 0x25, 0x62, 0x1C, 0x5C, 0xB6, 0x38, 0x4A,
+	0x88, 0x71, 0x59, 0x5A, 0x8D, 0xA0, 0x09, 0xAF,
+	0x72, 0x94, 0xD7, 0x79, 0x5C, 0x60, 0x7C, 0x8F,
+	0x4C, 0xF5, 0xD9, 0xA1, 0x39, 0x6D, 0x81, 0x28,
+	0xEF, 0x13, 0x28, 0xDF, 0xF5, 0x3E, 0xF7, 0x8E,
+	0x09, 0x9C, 0x78, 0x18, 0x79, 0xB8, 0x68, 0xD7,
+	0xA8, 0x29, 0x62, 0xAD, 0xDE, 0xE1, 0x61, 0x76,
+	0x1B, 0x05, 0x16, 0xCD, 0xBF, 0x02, 0x8E, 0xA6,
+	0x43, 0x6E, 0x92, 0x55, 0x4F, 0x60, 0x9C, 0x03,
+	0xB8, 0x4F, 0xA3, 0x02, 0xAC, 0xA8, 0xA7, 0x0C,
+	0x1E, 0xB5, 0x6B, 0xF8, 0xC8, 0x4D, 0xDE, 0xD2,
+	0xB0, 0x29, 0x6E, 0x40, 0xE6, 0xD6, 0xC9, 0xE6,
+	0xB9, 0x0F, 0xB6, 0x63, 0xF5, 0xAA, 0x2B, 0x96,
+	0xA7, 0x16, 0xAC, 0x4E, 0x0A, 0x33, 0x1C, 0xA6,
+	0xE6, 0xBD, 0x8A, 0xCF, 0x40, 0xA9, 0xB2, 0xFA,
+	0x63, 0x27, 0xFD, 0x9B, 0xD9, 0xFC, 0xD5, 0x87,
+	0x8D, 0x4C, 0xB6, 0xA4, 0xCB, 0xE7, 0x74, 0x55,
+	0xF4, 0xFB, 0x41, 0x25, 0xB5, 0x4B, 0x0A, 0x1B,
+	0xB1, 0xD6, 0xB7, 0xD9, 0x47, 0x2A, 0xC3, 0x98,
+	0x6A, 0xC4, 0x03, 0x73, 0x1F, 0x93, 0x6E, 0x53,
+	0x19, 0x25, 0x64, 0x15, 0x83, 0xF9, 0x73, 0x2A,
+	0x74, 0xB4, 0x93, 0x69, 0xC4, 0x72, 0xFC, 0x26,
+	0xA2, 0x9F, 0x43, 0x45, 0xDD, 0xB9, 0xEF, 0x36,
+	0xC8, 0x3A, 0xCD, 0x99, 0x9B, 0x54, 0x1A, 0x36,
+	0xC1, 0x59, 0xF8, 0x98, 0xA8, 0xCC, 0x28, 0x0D,
+	0x73, 0x4C, 0xEE, 0x98, 0xCB, 0x7C, 0x58, 0x7E,
+	0x20, 0x75, 0x1E, 0xB7, 0xC9, 0xF8, 0xF2, 0x0E,
+	0x63, 0x9E, 0x05, 0x78, 0x1A, 0xB6, 0xA8, 0x7A,
+	0xF9, 0x98, 0x6A, 0xA6, 0x46, 0x84, 0x2E, 0xF6,
+	0x4B, 0xDC, 0x9B, 0x8F, 0x9B, 0x8F, 0xEE, 0xB4,
+	0xAA, 0x3F, 0xEE, 0xC0, 0x37, 0x27, 0x76, 0xC7,
+	0x95, 0xBB, 0x26, 0x74, 0x69, 0x12, 0x7F, 0xF1,
+	0xBB, 0xFF, 0xAE, 0xB5, 0x99, 0x6E, 0xCB, 0x0C
 };
 
 static const uint8_t catch_22_quote_2_512_bytes_AES_CBC_HMAC_SHA1_digest[] = {
-	0x9a, 0X4f, 0X88, 0X1b, 0Xb6, 0X8f, 0Xd8, 0X60,
-	0X42, 0X1a, 0X7d, 0X3d, 0Xf5, 0X82, 0X80, 0Xf1,
-	0X18, 0X8c, 0X1d, 0X32 };
+	0x9a, 0x4f, 0x88, 0x1b, 0xb6, 0x8f, 0xd8, 0x60,
+	0x42, 0x1a, 0x7d, 0x3d, 0xf5, 0x82, 0x80, 0xf1,
+	0x18, 0x8c, 0x1d, 0x32
+};
 
 
 static int
@@ -775,7 +777,6 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-
 	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
@@ -785,8 +786,9 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	ut_params->auth_xform.auth.key.data = hmac_sha1_key;
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;
 
-	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
+	/* Create crypto session*/
+	ut_params->sess = rte_cryptodev_session_create(
+			ts_params->valid_devs[0],
 			&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
@@ -832,7 +834,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 			CIPHER_IV_LENGTH_AES_CBC,
 			catch_22_quote_2_512_bytes_AES_CBC_ciphertext,
 			QUOTE_512_BYTES,
-			"Ciphertext data not as expected");
+			"ciphertext data not as expected");
 
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
 			rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
@@ -1239,7 +1241,6 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
 			"Digest verification failed");
 
-
 	return TEST_SUCCESS;
 }
 
@@ -1361,7 +1362,6 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 					DIGEST_BYTE_LENGTH_SHA512,
 			"Generated digest data not as expected");
 
-
 	return TEST_SUCCESS;
 }
 
@@ -1417,6 +1417,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 	ut_params->auth_xform.auth.key.data = hmac_sha512_key;
 	ut_params->auth_xform.auth.key.length = HMAC_KEY_LENGTH_SHA512;
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA512;
+
 	return TEST_SUCCESS;
 }
 
@@ -1490,8 +1491,6 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
 	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
 			"Digest verification failed");
 
-
-
 	return TEST_SUCCESS;
 }
 
app/test/test_cryptodev.h +3 -2
index 034393e..083266a 100644
@@ -47,8 +47,9 @@
 #define DEFAULT_NUM_XFORMS              (2)
 #define NUM_MBUFS                       (8191)
 #define MBUF_CACHE_SIZE                 (250)
-#define MBUF_SIZE   (2048 + DIGEST_BYTE_LENGTH_SHA512 + \
-				sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATAPAYLOAD_SIZE		(2048 + DIGEST_BYTE_LENGTH_SHA512)
+#define MBUF_SIZE			(sizeof(struct rte_mbuf) + \
+		RTE_PKTMBUF_HEADROOM + MBUF_DATAPAYLOAD_SIZE)
 
 #define BYTE_LENGTH(x)				(x/8)
 /* HASH DIGEST LENGTHS */
app/test/test_cryptodev_perf.c +35 -19

119 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +16 -12
index c7d884c..f2afdb6 100644
@@ -377,17 +377,21 @@ process_crypto_op(struct aesni_mb_qp *qp, struct rte_mbuf *m,
 		job->auth_tag_output = (uint8_t *)rte_pktmbuf_append(m,
 				get_digest_byte_length(job->hash_alg));
 
-		if (job->auth_tag_output)
-			memset(job->auth_tag_output, 0,
-				sizeof(get_digest_byte_length(job->hash_alg)));
-		else
+		if (job->auth_tag_output == NULL) {
+			MB_LOG_ERR("failed to allocate space in output mbuf "
+					"for temp digest");
 			return NULL;
+		}
+
+		memset(job->auth_tag_output, 0,
+				sizeof(get_digest_byte_length(job->hash_alg)));
+
 	} else {
 		job->auth_tag_output = c_op->digest.data;
 	}
 
 	/*
-	 * Multiple buffer library current only support returning a truncated
+	 * Multi-buffer library current only support returning a truncated
 	 * digest length as specified in the relevant IPsec RFCs
 	 */
 	job->auth_tag_output_len_in_bytes =
@@ -489,7 +493,7 @@ handle_completed_jobs(struct aesni_mb_qp *qp, JOB_AES_HMAC *job)
 		if (m)
 			rte_ring_enqueue(qp->processed_pkts, (void *)m);
 		else
-			qp->qp_stats.dequeue_err_count++;
+			qp->stats.dequeue_err_count++;
 
 		job = (*qp->ops->job.get_completed_job)(&qp->mb_mgr);
 	}
@@ -513,19 +517,19 @@ aesni_mb_pmd_enqueue_burst(void *queue_pair, struct rte_mbuf **bufs,
 	for (i = 0; i < nb_bufs; i++) {
 		ol = rte_pktmbuf_offload_get(bufs[i], RTE_PKTMBUF_OL_CRYPTO);
 		if (unlikely(ol == NULL)) {
-			qp->qp_stats.enqueue_err_count++;
+			qp->stats.enqueue_err_count++;
 			goto flush_jobs;
 		}
 
 		sess = get_session(qp, &ol->op.crypto);
 		if (unlikely(sess == NULL)) {
-			qp->qp_stats.enqueue_err_count++;
+			qp->stats.enqueue_err_count++;
 			goto flush_jobs;
 		}
 
 		job = process_crypto_op(qp, bufs[i], &ol->op.crypto, sess);
 		if (unlikely(job == NULL)) {
-			qp->qp_stats.enqueue_err_count++;
+			qp->stats.enqueue_err_count++;
 			goto flush_jobs;
 		}
 
@@ -543,7 +547,7 @@ aesni_mb_pmd_enqueue_burst(void *queue_pair, struct rte_mbuf **bufs,
 	if (processed_jobs == 0)
 		goto flush_jobs;
 	else
-		qp->qp_stats.enqueued_count += processed_jobs;
+		qp->stats.enqueued_count += processed_jobs;
 		return i;
 
 flush_jobs:
@@ -553,7 +557,7 @@ flush_jobs:
 	 */
 	job = (*qp->ops->job.flush_job)(&qp->mb_mgr);
 	if (job)
-		qp->qp_stats.enqueued_count += handle_completed_jobs(qp, job);
+		qp->stats.enqueued_count += handle_completed_jobs(qp, job);
 
 	return i;
 }
@@ -568,7 +572,7 @@ aesni_mb_pmd_dequeue_burst(void *queue_pair,
 
 	nb_dequeued = rte_ring_dequeue_burst(qp->processed_pkts,
 			(void **)bufs, nb_bufs);
-	qp->qp_stats.dequeued_count += nb_dequeued;
+	qp->stats.dequeued_count += nb_dequeued;
 
 	return nb_dequeued;
 }
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +6 -6
index e43b898..76a85ff 100644
@@ -76,11 +76,11 @@ aesni_mb_pmd_stats_get(struct rte_cryptodev *dev,
 	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
 		struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];
 
-		stats->enqueued_count += qp->qp_stats.enqueued_count;
-		stats->dequeued_count += qp->qp_stats.dequeued_count;
+		stats->enqueued_count += qp->stats.enqueued_count;
+		stats->dequeued_count += qp->stats.dequeued_count;
 
-		stats->enqueue_err_count += qp->qp_stats.enqueue_err_count;
-		stats->dequeue_err_count += qp->qp_stats.dequeue_err_count;
+		stats->enqueue_err_count += qp->stats.enqueue_err_count;
+		stats->dequeue_err_count += qp->stats.dequeue_err_count;
 	}
 }
 
@@ -93,7 +93,7 @@ aesni_mb_pmd_stats_reset(struct rte_cryptodev *dev)
 	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
 		struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];
 
-		memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+		memset(&qp->stats, 0, sizeof(qp->stats));
 	}
 }
 
@@ -196,7 +196,7 @@ aesni_mb_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 
 	qp->sess_mp = dev->data->session_pool;
 
-	memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+	memset(&qp->stats, 0, sizeof(qp->stats));
 
 	/* Initialise multi-buffer manager */
 	(*qp->ops->job.init_mgr)(&qp->mb_mgr);
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +1 -1
index 2f98609..304c85c 100644
@@ -150,7 +150,7 @@ struct aesni_mb_qp {
 	/**< Ring for placing process packets */
 	struct rte_mempool *sess_mp;
 	/**< Session Mempool */
-	struct rte_cryptodev_stats qp_stats;
+	struct rte_cryptodev_stats stats;
 	/**< Queue pair statistics */
 } __rte_cache_aligned;
 
lib/librte_cryptodev/rte_cryptodev.h +1 -34
index 892375d..0ccd1b8 100644
@@ -130,17 +130,6 @@ struct rte_cryptodev_qp_conf {
 typedef void (*rte_cryptodev_cb_fn)(uint8_t dev_id,
 		enum rte_cryptodev_event_type event, void *cb_arg);
 
-#ifdef RTE_CRYPTODEV_PERF
-/**
- * Crypto Device performance counter statistics structure. This structure is
- * used for RDTSC counters for measuring crypto operations.
- */
-struct rte_cryptodev_perf_stats {
-	uint64_t t_accumlated;	/**< Accumulated time processing operation */
-	uint64_t t_min;		/**< Max time */
-	uint64_t t_max;		/**< Min time */
-};
-#endif
 
 /** Crypto Device statistics */
 struct rte_cryptodev_stats {
@@ -153,29 +142,8 @@ struct rte_cryptodev_stats {
 	/**< Total error count on operations enqueued */
 	uint64_t dequeue_err_count;
 	/**< Total error count on operations dequeued */
+};
 
-#ifdef RTE_CRYPTODEV_DETAILED_STATS
-	struct {
-		uint64_t encrypt_ops;	/**< Count of encrypt operations */
-		uint64_t encrypt_bytes;	/**< Number of bytes encrypted */
-
-		uint64_t decrypt_ops;	/**< Count of decrypt operations */
-		uint64_t decrypt_bytes;	/**< Number of bytes decrypted */
-	} cipher; /**< Cipher operations stats */
-
-	struct {
-		uint64_t generate_ops;	/**< Count of generate operations */
-		uint64_t bytes_hashed;	/**< Number of bytes hashed */
-
-		uint64_t verify_ops;	/**< Count of verify operations */
-		uint64_t bytes_verified;/**< Number of bytes verified */
-	} hash;	 /**< Hash operations stats */
-#endif
-
-#ifdef RTE_CRYPTODEV_PERF
-	struct rte_cryptodev_perf_stats op_perf; /**< Operations stats */
-#endif
-} __rte_cache_aligned;
 
 /**
  * Create a virtual crypto device
@@ -632,7 +600,6 @@ extern struct rte_cryptodev_session *
 rte_cryptodev_session_create(uint8_t dev_id,
 		struct rte_crypto_xform *xform);
 
-
 /**
  * Free the memory associated with a previously allocated session.
  *
lib/librte_cryptodev/rte_cryptodev_pmd.h +2 -8
index 8270afa..a16d109 100644
@@ -56,11 +56,6 @@ extern "C" {
 #include "rte_crypto.h"
 #include "rte_cryptodev.h"
 
-struct rte_cryptodev_stats;
-struct rte_cryptodev_info;
-struct rte_cryptodev_qp_conf;
-
-enum rte_cryptodev_event_type;
 
 #ifdef RTE_LIBRTE_CRYPTODEV_DEBUG
 #define RTE_PMD_DEBUG_TRACE(...) \
@@ -80,7 +75,6 @@ struct rte_cryptodev_session {
 };
 
 struct rte_cryptodev_driver;
-struct rte_cryptodev;
 
 /**
  * Initialisation function of a crypto driver invoked for each matching
@@ -427,9 +421,9 @@ struct rte_cryptodev_ops {
 	cryptodev_info_get_t dev_infos_get;	/**< Get device info. */
 
 	cryptodev_stats_get_t stats_get;
-	/**< Get generic device statistics. */
+	/**< Get device statistics. */
 	cryptodev_stats_reset_t stats_reset;
-	/**< Reset generic device statistics. */
+	/**< Reset device statistics. */
 
 	cryptodev_queue_pair_setup_t queue_pair_setup;
 	/**< Set up a device queue pair. */
Signature · 1 line
2.5.0
#33 lore raw

PATCH v9 2/5 cryptodev: refactor to partition common from symmetric-specific code

In reply to Fiona Trahe

This patch splits symmetric specific definitions and
functions away from the common crypto APIs to facilitate the future extension and expansion of the cryptodev framework, in order to allow asymmetric crypto operations to be introduced at a later date, as well as to clean the logical structure of the public includes. The patch also introduces the _sym prefix to symmetric specific structure and functions to improve clarity in the API.

---
 app/test/test_cryptodev.c                          | 161 +++---
 app/test/test_cryptodev_perf.c                     |  42 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         |  44 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |   6 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   4 +-
 drivers/crypto/qat/qat_crypto.c                    |  51 +-
 drivers/crypto/qat/qat_crypto.h                    |  10 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       |  31 +-
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 547 +------------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 598 +++++++++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               |  39 +-
 lib/librte_cryptodev/rte_cryptodev.h               |  46 +-
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  22 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   6 +-
 lib/librte_mbuf_offload/rte_mbuf_offload.h         |  22 +-
 17 files changed, 867 insertions(+), 771 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
app/test/test_cryptodev.c +85 -76
index 1a0f204..5ced183 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -57,13 +57,13 @@ struct crypto_testsuite_params {
 };
 
 struct crypto_unittest_params {
-	struct rte_crypto_xform cipher_xform;
-	struct rte_crypto_xform auth_xform;
+	struct rte_crypto_sym_xform cipher_xform;
+	struct rte_crypto_sym_xform auth_xform;
 
-	struct rte_cryptodev_session *sess;
+	struct rte_cryptodev_sym_session *sess;
 
 	struct rte_mbuf_offload *ol;
-	struct rte_crypto_op *op;
+	struct rte_crypto_sym_op *op;
 
 	struct rte_mbuf *obuf, *ibuf;
 
@@ -78,7 +78,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 		struct crypto_unittest_params *ut_params);
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_param);
 
@@ -166,7 +166,7 @@ testsuite_setup(void)
 			"MBUF_OFFLOAD_POOL",
 			NUM_MBUFS, MBUF_CACHE_SIZE,
 			DEFAULT_NUM_XFORMS *
-			sizeof(struct rte_crypto_xform),
+			sizeof(struct rte_crypto_sym_xform),
 			rte_socket_id());
 	if (ts_params->mbuf_ol_pool == NULL) {
 		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
@@ -221,7 +221,7 @@ testsuite_setup(void)
 
 		ts_params->conf.nb_queue_pairs = info.max_nb_queue_pairs;
 		ts_params->conf.socket_id = SOCKET_ID_ANY;
-		ts_params->conf.session_mp.nb_objs = info.max_nb_sessions;
+		ts_params->conf.session_mp.nb_objs = info.sym.max_nb_sessions;
 
 		TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id,
 				&ts_params->conf),
@@ -276,7 +276,7 @@ ut_setup(void)
 	ts_params->conf.nb_queue_pairs = DEFAULT_NUM_QPS_PER_QAT_DEVICE;
 	ts_params->conf.socket_id = SOCKET_ID_ANY;
 	ts_params->conf.session_mp.nb_objs =
-			(gbl_cryptodev_type == RTE_CRYPTODEV_QAT_PMD) ?
+			(gbl_cryptodev_type == RTE_CRYPTODEV_QAT_SYM_PMD) ?
 					DEFAULT_NUM_OPS_INFLIGHT :
 					DEFAULT_NUM_OPS_INFLIGHT;
 
@@ -320,7 +320,7 @@ ut_teardown(void)
 
 	/* free crypto session structure */
 	if (ut_params->sess) {
-		rte_cryptodev_session_free(ts_params->valid_devs[0],
+		rte_cryptodev_sym_session_free(ts_params->valid_devs[0],
 				ut_params->sess);
 		ut_params->sess = NULL;
 	}
@@ -465,7 +465,7 @@ test_queue_pair_descriptor_setup(void)
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
-	ts_params->conf.session_mp.nb_objs = dev_info.max_nb_sessions;
+	ts_params->conf.session_mp.nb_objs = dev_info.sym.max_nb_sessions;
 
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
 			&ts_params->conf), "Failed to configure cryptodev %u",
@@ -768,7 +768,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -777,7 +777,8 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -787,21 +788,21 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;
 
 	/* Create crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(
+	ut_params->sess = rte_cryptodev_sym_session_create(
 			ts_params->valid_devs[0],
 			&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
 	ut_params->op = &ut_params->ol->op.crypto;
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -864,18 +865,18 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
 	ut_params->op = &ut_params->ol->op.crypto;
 
-	TEST_ASSERT_NOT_NULL(rte_pktmbuf_offload_alloc_crypto_xforms(
+	TEST_ASSERT_NOT_NULL(rte_pktmbuf_offload_alloc_crypto_sym_xforms(
 			ut_params->ol, 2),
 			"failed to allocate space for crypto transforms");
 
 	/* Set crypto operation data parameters */
-	ut_params->op->xform->type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->op->xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 
 	/* cipher parameters */
 	ut_params->op->xform->cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
@@ -884,7 +885,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)
 	ut_params->op->xform->cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* hash parameters */
-	ut_params->op->xform->next->type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->op->xform->next->type = RTE_CRYPTO_SYM_XFORM_AUTH;
 
 	ut_params->op->xform->next->auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
 	ut_params->op->xform->next->auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
@@ -960,7 +961,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_SHA1);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -969,7 +970,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -979,13 +980,14 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -993,7 +995,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1068,7 +1070,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1077,7 +1079,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1087,13 +1089,14 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1101,7 +1104,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1170,7 +1173,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_SHA256);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1179,7 +1182,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1189,13 +1192,14 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1203,7 +1207,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1283,7 +1287,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1292,7 +1296,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1302,15 +1306,16 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA512;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1318,7 +1323,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1371,7 +1376,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 		struct crypto_unittest_params *ut_params);
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_params);
 
@@ -1386,8 +1391,9 @@ test_AES_CBC_HMAC_SHA512_decrypt_digest_verify(void)
 			"Failed to create session params");
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	return test_AES_CBC_HMAC_SHA512_decrypt_perform(ut_params->sess,
@@ -1400,7 +1406,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 {
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1409,7 +1415,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1423,7 +1429,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_params)
 {
@@ -1443,7 +1449,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1451,7 +1457,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1521,7 +1527,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1530,7 +1536,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1540,13 +1546,14 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1554,7 +1561,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->iv.data = (uint8_t *)
 		rte_pktmbuf_prepend(ut_params->ibuf,
@@ -1614,7 +1621,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_AES_XCBC);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1623,7 +1630,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1633,13 +1640,14 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1647,7 +1655,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
@@ -1751,7 +1759,7 @@ test_multi_session(void)
 	struct crypto_unittest_params *ut_params = &unittest_params;
 
 	struct rte_cryptodev_info dev_info;
-	struct rte_cryptodev_session **sessions;
+	struct rte_cryptodev_sym_session **sessions;
 
 	uint16_t i;
 
@@ -1760,12 +1768,13 @@ test_multi_session(void)
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
-	sessions = rte_malloc(NULL, (sizeof(struct rte_cryptodev_session *) *
-			dev_info.max_nb_sessions) + 1, 0);
+	sessions = rte_malloc(NULL,
+			(sizeof(struct rte_cryptodev_sym_session *) *
+			dev_info.sym.max_nb_sessions) + 1, 0);
 
 	/* Create multiple crypto sessions*/
-	for (i = 0; i < dev_info.max_nb_sessions; i++) {
-		sessions[i] = rte_cryptodev_session_create(
+	for (i = 0; i < dev_info.sym.max_nb_sessions; i++) {
+		sessions[i] = rte_cryptodev_sym_session_create(
 				ts_params->valid_devs[0],
 			&ut_params->auth_xform);
 		TEST_ASSERT_NOT_NULL(sessions[i],
@@ -1780,13 +1789,13 @@ test_multi_session(void)
 	}
 
 	/* Next session create should fail */
-	sessions[i] = rte_cryptodev_session_create(ts_params->valid_devs[0],
+	sessions[i] = rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
 			&ut_params->auth_xform);
 	TEST_ASSERT_NULL(sessions[i],
 			"Session creation succeeded unexpectedly!");
 
-	for (i = 0; i < dev_info.max_nb_sessions; i++)
-		rte_cryptodev_session_free(ts_params->valid_devs[0],
+	for (i = 0; i < dev_info.sym.max_nb_sessions; i++)
+		rte_cryptodev_sym_session_free(ts_params->valid_devs[0],
 				sessions[i]);
 
 	rte_free(sessions);
@@ -1805,7 +1814,7 @@ test_not_in_place_crypto(void)
 
 	/* Create multiple crypto sessions*/
 
-	ut_params->sess = rte_cryptodev_session_create(
+	ut_params->sess = rte_cryptodev_sym_session_create(
 			ts_params->valid_devs[0], &ut_params->auth_xform);
 
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
@@ -1827,7 +1836,7 @@ test_not_in_place_crypto(void)
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1835,7 +1844,7 @@ test_not_in_place_crypto(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1961,7 +1970,7 @@ static struct unit_test_suite cryptodev_aesni_mb_testsuite  = {
 static int
 test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	gbl_cryptodev_type = RTE_CRYPTODEV_QAT_PMD;
+	gbl_cryptodev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	return unit_test_suite_runner(&cryptodev_qat_testsuite);
 }
 static struct test_command cryptodev_qat_cmd = {
app/test/test_cryptodev_perf.c +21 -21

134 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +23 -21

134 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +3 -3
index 76a85ff..d56de12 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -108,7 +108,7 @@ aesni_mb_pmd_info_get(struct rte_cryptodev *dev,
 	if (dev_info != NULL) {
 		dev_info->dev_type = dev->dev_type;
 		dev_info->max_nb_queue_pairs = internals->max_nb_queue_pairs;
-		dev_info->max_nb_sessions = internals->max_nb_sessions;
+		dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
 	}
 }
 
@@ -243,7 +243,7 @@ aesni_mb_pmd_session_get_size(struct rte_cryptodev *dev __rte_unused)
 /** Configure a aesni multi-buffer session from a crypto xform chain */
 static void *
 aesni_mb_pmd_session_configure(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform,	void *sess)
+		struct rte_crypto_sym_xform *xform,	void *sess)
 {
 	struct aesni_mb_private *internals = dev->data->dev_private;
 
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +2 -2
index 304c85c..0aed177 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -218,7 +218,7 @@ struct aesni_mb_session {
 extern int
 aesni_mb_set_session_parameters(const struct aesni_mb_ops *mb_ops,
 		struct aesni_mb_session *sess,
-		const struct rte_crypto_xform *xform);
+		const struct rte_crypto_sym_xform *xform);
 
 
 /** device specific operations function pointer structure */
drivers/crypto/qat/qat_crypto.c +27 -24

149 lines not on this page · raw message

drivers/crypto/qat/qat_crypto.h +6 -4
index d680364..e9f71fe 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -109,16 +109,18 @@ qat_crypto_sym_session_init(struct rte_mempool *mempool, void *priv_sess);
 
 extern void *
 qat_crypto_sym_configure_session(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform, void *session_private);
+		struct rte_crypto_sym_xform *xform, void *session_private);
 
 extern void
 qat_crypto_sym_clear_session(struct rte_cryptodev *dev, void *session);
 
 
 uint16_t
-qat_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
+qat_sym_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts);
 
 uint16_t
-qat_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
+qat_sym_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts,
+		uint16_t nb_pkts);
 
 #endif /* _QAT_CRYPTO_H_ */
drivers/crypto/qat/rte_qat_cryptodev.c +4 -4
index e500c1e..85700fc 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -89,11 +89,11 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_
 		cryptodev->pci_dev->addr.devid,
 		cryptodev->pci_dev->addr.function);
 
-	cryptodev->dev_type = RTE_CRYPTODEV_QAT_PMD;
+	cryptodev->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	cryptodev->dev_ops = &crypto_qat_ops;
 
-	cryptodev->enqueue_burst = qat_crypto_pkt_tx_burst;
-	cryptodev->dequeue_burst = qat_crypto_pkt_rx_burst;
+	cryptodev->enqueue_burst = qat_sym_crypto_pkt_tx_burst;
+	cryptodev->dequeue_burst = qat_sym_crypto_pkt_rx_burst;
 
 
 	internals = cryptodev->data->dev_private;
examples/l2fwd-crypto/main.c +14 -17
index a950b74..ee519e7 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -124,13 +124,13 @@ struct l2fwd_crypto_options {
 
 	enum l2fwd_crypto_xform_chain xform_chain;
 
-	struct rte_crypto_xform cipher_xform;
+	struct rte_crypto_sym_xform cipher_xform;
 	uint8_t ckey_data[32];
 
 	struct rte_crypto_key iv_key;
 	uint8_t ivkey_data[16];
 
-	struct rte_crypto_xform auth_xform;
+	struct rte_crypto_sym_xform auth_xform;
 	uint8_t akey_data[128];
 };
 
@@ -141,9 +141,8 @@ struct l2fwd_crypto_params {
 
 	unsigned digest_length;
 	unsigned block_size;
-
 	struct rte_crypto_key iv_key;
-	struct rte_cryptodev_session *session;
+	struct rte_cryptodev_sym_session *session;
 };
 
 /** lcore configuration */
@@ -372,7 +371,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,
 	}
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(&ol->op.crypto, cparams->session);
+	rte_crypto_sym_op_attach_session(&ol->op.crypto, cparams->session);
 
 	/* Append space for digest to end of packet */
 	ol->op.crypto.digest.data = (uint8_t *)rte_pktmbuf_append(m,
@@ -474,11 +473,11 @@ generate_random_key(uint8_t *key, unsigned length)
 		key[i] = rand() % 0xff;
 }
 
-static struct rte_cryptodev_session *
+static struct rte_cryptodev_sym_session *
 initialize_crypto_session(struct l2fwd_crypto_options *options,
 		uint8_t cdev_id)
 {
-	struct rte_crypto_xform *first_xform;
+	struct rte_crypto_sym_xform *first_xform;
 
 	if (options->xform_chain == L2FWD_CRYPTO_CIPHER_HASH) {
 		first_xform = &options->cipher_xform;
@@ -489,7 +488,7 @@ initialize_crypto_session(struct l2fwd_crypto_options *options,
 	}
 
 	/* Setup Cipher Parameters */
-	return rte_cryptodev_session_create(cdev_id, first_xform);
+	return rte_cryptodev_sym_session_create(cdev_id, first_xform);
 }
 
 static void
@@ -610,7 +609,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)
 				m = pkts_burst[j];
 				ol = rte_pktmbuf_offload_alloc(
 						l2fwd_mbuf_ol_pool,
-						RTE_PKTMBUF_OL_CRYPTO);
+						RTE_PKTMBUF_OL_CRYPTO_SYM);
 				/*
 				 * If we can't allocate a offload, then drop
 				 * the rest of the burst and dequeue and
@@ -689,7 +688,7 @@ parse_cryptodev_type(enum rte_cryptodev_type *type, char *optarg)
 		*type = RTE_CRYPTODEV_AESNI_MB_PMD;
 		return 0;
 	} else if (strcmp("QAT", optarg) == 0) {
-		*type = RTE_CRYPTODEV_QAT_PMD;
+		*type = RTE_CRYPTODEV_QAT_SYM_PMD;
 		return 0;
 	}
 
@@ -937,7 +936,7 @@ l2fwd_crypto_default_options(struct l2fwd_crypto_options *options)
 	options->xform_chain = L2FWD_CRYPTO_CIPHER_HASH;
 
 	/* Cipher Data */
-	options->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	options->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	options->cipher_xform.next = NULL;
 
 	options->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -946,12 +945,11 @@ l2fwd_crypto_default_options(struct l2fwd_crypto_options *options)
 	generate_random_key(options->ckey_data, sizeof(options->ckey_data));
 
 	options->cipher_xform.cipher.key.data = options->ckey_data;
-	options->cipher_xform.cipher.key.phys_addr = 0;
 	options->cipher_xform.cipher.key.length = 16;
 
 
 	/* Authentication Data */
-	options->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	options->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	options->auth_xform.next = NULL;
 
 	options->auth_xform.auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
@@ -963,7 +961,6 @@ l2fwd_crypto_default_options(struct l2fwd_crypto_options *options)
 	generate_random_key(options->akey_data, sizeof(options->akey_data));
 
 	options->auth_xform.auth.key.data = options->akey_data;
-	options->auth_xform.auth.key.phys_addr = 0;
 	options->auth_xform.auth.key.length = 20;
 }
 
@@ -982,7 +979,7 @@ l2fwd_crypto_options_print(struct l2fwd_crypto_options *options)
 	switch (options->cdev_type) {
 	case RTE_CRYPTODEV_AESNI_MB_PMD:
 		printf("cryptodev type: AES-NI MB PMD\n"); break;
-	case RTE_CRYPTODEV_QAT_PMD:
+	case RTE_CRYPTODEV_QAT_SYM_PMD:
 		printf("cryptodev type: QAT PMD\n"); break;
 	default:
 		break;
@@ -1179,7 +1176,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports)
 	unsigned i, cdev_id, cdev_count, enabled_cdev_count = 0;
 	int retval;
 
-	if (options->cdev_type == RTE_CRYPTODEV_QAT_PMD) {
+	if (options->cdev_type == RTE_CRYPTODEV_QAT_SYM_PMD) {
 		if (rte_cryptodev_count() < nb_ports)
 			return -1;
 	} else if (options->cdev_type == RTE_CRYPTODEV_AESNI_MB_PMD) {
lib/librte_cryptodev/Makefile +1 -0
index 81fa3fc..0d59229 100644
@@ -45,6 +45,7 @@ SRCS-y += rte_cryptodev.c
 
 # export include files
 SYMLINK-y-include += rte_crypto.h
+SYMLINK-y-include += rte_crypto_sym.h
 SYMLINK-y-include += rte_cryptodev.h
 SYMLINK-y-include += rte_cryptodev_pmd.h
 
lib/librte_cryptodev/rte_crypto.h +3 -544

572 lines not on this page · raw message

lib/librte_cryptodev/rte_crypto_sym.h new file +598 -0

598 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.c +22 -17
index 2838852..c7fef6a 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -572,8 +572,8 @@ rte_cryptodev_queue_pair_stop(uint8_t dev_id, uint16_t queue_pair_id)
 }
 
 static int
-rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
-		unsigned obj_cache_size, int socket_id);
+rte_cryptodev_sym_session_pool_create(struct rte_cryptodev *dev,
+		unsigned nb_objs, unsigned obj_cache_size, int socket_id);
 
 int
 rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
@@ -604,8 +604,10 @@ rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
 	}
 
 	/* Setup Session mempool for device */
-	return rte_crypto_session_pool_create(dev, config->session_mp.nb_objs,
-			config->session_mp.cache_size, config->socket_id);
+	return rte_cryptodev_sym_session_pool_create(dev,
+			config->session_mp.nb_objs,
+			config->session_mp.cache_size,
+			config->socket_id);
 }
 
 
@@ -911,12 +913,12 @@ rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
 
 
 static void
-rte_crypto_session_init(struct rte_mempool *mp,
+rte_cryptodev_sym_session_init(struct rte_mempool *mp,
 		void *opaque_arg,
 		void *_sess,
 		__rte_unused unsigned i)
 {
-	struct rte_cryptodev_session *sess = _sess;
+	struct rte_cryptodev_sym_session *sess = _sess;
 	struct rte_cryptodev *dev = opaque_arg;
 
 	memset(sess, 0, mp->elt_size);
@@ -930,8 +932,8 @@ rte_crypto_session_init(struct rte_mempool *mp,
 }
 
 static int
-rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
-		unsigned obj_cache_size, int socket_id)
+rte_cryptodev_sym_session_pool_create(struct rte_cryptodev *dev,
+		unsigned nb_objs, unsigned obj_cache_size, int socket_id)
 {
 	char mp_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	unsigned priv_sess_size;
@@ -951,7 +953,7 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 		return -ENOMEM;
 	}
 
-	unsigned elt_size = sizeof(struct rte_cryptodev_session) +
+	unsigned elt_size = sizeof(struct rte_cryptodev_sym_session) +
 			priv_sess_size;
 
 	dev->data->session_pool = rte_mempool_lookup(mp_name);
@@ -975,7 +977,8 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 				0, /* private data size */
 				NULL, /* obj initialization constructor */
 				NULL, /* obj initialization constructor arg */
-				rte_crypto_session_init, /* obj constructor */
+				rte_cryptodev_sym_session_init,
+				/**< obj constructor*/
 				dev, /* obj constructor arg */
 				socket_id, /* socket id */
 				0); /* flags */
@@ -990,11 +993,12 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 	return 0;
 }
 
-struct rte_cryptodev_session *
-rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
+struct rte_cryptodev_sym_session *
+rte_cryptodev_sym_session_create(uint8_t dev_id,
+		struct rte_crypto_sym_xform *xform)
 {
 	struct rte_cryptodev *dev;
-	struct rte_cryptodev_session *sess;
+	struct rte_cryptodev_sym_session *sess;
 	void *_sess;
 
 	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
@@ -1010,7 +1014,7 @@ rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
 		return NULL;
 	}
 
-	sess = (struct rte_cryptodev_session *)_sess;
+	sess = (struct rte_cryptodev_sym_session *)_sess;
 
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->session_configure, NULL);
 	if (dev->dev_ops->session_configure(dev, xform, sess->_private) ==
@@ -1026,8 +1030,9 @@ rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
 	return sess;
 }
 
-struct rte_cryptodev_session *
-rte_cryptodev_session_free(uint8_t dev_id, struct rte_cryptodev_session *sess)
+struct rte_cryptodev_sym_session *
+rte_cryptodev_sym_session_free(uint8_t dev_id,
+		struct rte_cryptodev_sym_session *sess)
 {
 	struct rte_cryptodev *dev;
 
lib/librte_cryptodev/rte_cryptodev.h +33 -13

91 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev_pmd.h +11 -11
index a16d109..7d049ea 100644
@@ -1,6 +1,6 @@
 /*-
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -358,7 +358,7 @@ typedef uint32_t (*cryptodev_queue_pair_count_t)(struct rte_cryptodev *dev);
  * - On success returns a pointer to a rte_mempool
  * - On failure returns a NULL pointer
  */
-typedef int (*cryptodev_create_session_pool_t)(
+typedef int (*cryptodev_sym_create_session_pool_t)(
 		struct rte_cryptodev *dev, unsigned nb_objs,
 		unsigned obj_cache_size, int socket_id);
 
@@ -372,7 +372,7 @@ typedef int (*cryptodev_create_session_pool_t)(
  *  - On success returns the size of the session structure for device
  *  - On failure returns 0
  */
-typedef unsigned (*cryptodev_get_session_private_size_t)(
+typedef unsigned (*cryptodev_sym_get_session_private_size_t)(
 		struct rte_cryptodev *dev);
 
 /**
@@ -386,7 +386,7 @@ typedef unsigned (*cryptodev_get_session_private_size_t)(
  *  - Returns private session structure on success.
  *  - Returns NULL on failure.
  */
-typedef void (*cryptodev_initialize_session_t)(struct rte_mempool *mempool,
+typedef void (*cryptodev_sym_initialize_session_t)(struct rte_mempool *mempool,
 		void *session_private);
 
 /**
@@ -400,14 +400,14 @@ typedef void (*cryptodev_initialize_session_t)(struct rte_mempool *mempool,
  *  - Returns private session structure on success.
  *  - Returns NULL on failure.
  */
-typedef void * (*cryptodev_configure_session_t)(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform, void *session_private);
+typedef void * (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev,
+		struct rte_crypto_sym_xform *xform, void *session_private);
 
 /**
  * Free Crypto session.
  * @param	session		Cryptodev session structure to free
  */
-typedef void (*cryptodev_free_session_t)(struct rte_cryptodev *dev,
+typedef void (*cryptodev_sym_free_session_t)(struct rte_cryptodev *dev,
 		void *session_private);
 
 
@@ -436,13 +436,13 @@ struct rte_cryptodev_ops {
 	cryptodev_queue_pair_count_t queue_pair_count;
 	/**< Get count of the queue pairs. */
 
-	cryptodev_get_session_private_size_t session_get_size;
+	cryptodev_sym_get_session_private_size_t session_get_size;
 	/**< Return private session. */
-	cryptodev_initialize_session_t session_initialize;
+	cryptodev_sym_initialize_session_t session_initialize;
 	/**< Initialization function for private session data */
-	cryptodev_configure_session_t session_configure;
+	cryptodev_sym_configure_session_t session_configure;
 	/**< Configure a Crypto session. */
-	cryptodev_free_session_t session_clear;
+	cryptodev_sym_free_session_t session_clear;
 	/**< Clear a Crypto sessions private data. */
 };
 
lib/librte_cryptodev/rte_cryptodev_version.map +3 -3
index ff8e93d..a46af6f 100644
@@ -16,8 +16,8 @@ DPDK_2.2 {
 	rte_cryptodev_pmd_driver_register;
 	rte_cryptodev_pmd_release_device;
 	rte_cryptodev_pmd_virtual_dev_init;
-	rte_cryptodev_session_create;
-	rte_cryptodev_session_free;
+	rte_cryptodev_sym_session_create;
+	rte_cryptodev_sym_session_free;
 	rte_cryptodev_socket_id;
 	rte_cryptodev_start;
 	rte_cryptodev_stats_get;
@@ -29,4 +29,4 @@ DPDK_2.2 {
 	rte_cryptodev_queue_pair_stop;
 
 	local: *;
-};
\ No newline at end of file
+};
lib/librte_mbuf_offload/rte_mbuf_offload.h +11 -11
index 77993b6..5ce6058 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -67,7 +67,7 @@ extern "C" {
 enum rte_mbuf_ol_op_type {
 	RTE_PKTMBUF_OL_NOT_SPECIFIED = 0,
 	/**< Off-load not specified */
-	RTE_PKTMBUF_OL_CRYPTO
+	RTE_PKTMBUF_OL_CRYPTO_SYM
 	/**< Crypto offload operation */
 };
 
@@ -84,7 +84,7 @@ struct rte_mbuf_offload {
 
 	enum rte_mbuf_ol_op_type type;	/**< offload type */
 	union {
-		struct rte_crypto_op crypto;	/**< Crypto operation */
+		struct rte_crypto_sym_op crypto;	/**< Crypto operation */
 	} op;
 };
 
@@ -194,8 +194,8 @@ __rte_pktmbuf_offload_reset(struct rte_mbuf_offload *ol,
 	ol->type = type;
 
 	switch (type) {
-	case RTE_PKTMBUF_OL_CRYPTO:
-		__rte_crypto_op_reset(&ol->op.crypto); break;
+	case RTE_PKTMBUF_OL_CRYPTO_SYM:
+		__rte_crypto_sym_op_reset(&ol->op.crypto); break;
 	default:
 		break;
 	}
@@ -278,24 +278,24 @@ __rte_pktmbuf_offload_check_priv_data_size(struct rte_mbuf_offload *ol,
  * - On success returns pointer to first crypto xform in crypto operations chain
  * - On failure returns NULL
  */
-static inline struct rte_crypto_xform *
-rte_pktmbuf_offload_alloc_crypto_xforms(struct rte_mbuf_offload *ol,
+static inline struct rte_crypto_sym_xform *
+rte_pktmbuf_offload_alloc_crypto_sym_xforms(struct rte_mbuf_offload *ol,
 		unsigned nb_xforms)
 {
-	struct rte_crypto_xform *xform;
+	struct rte_crypto_sym_xform *xform;
 	void *priv_data;
 	uint16_t size;
 
-	size = sizeof(struct rte_crypto_xform) * nb_xforms;
+	size = sizeof(struct rte_crypto_sym_xform) * nb_xforms;
 	priv_data = __rte_pktmbuf_offload_check_priv_data_size(ol, size);
 
 	if (priv_data == NULL)
 		return NULL;
 
-	ol->op.crypto.xform = xform = (struct rte_crypto_xform *)priv_data;
+	ol->op.crypto.xform = xform = (struct rte_crypto_sym_xform *)priv_data;
 
 	do {
-		xform->type = RTE_CRYPTO_XFORM_NOT_SPECIFIED;
+		xform->type = RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED;
 		xform = xform->next = --nb_xforms > 0 ? xform + 1 : NULL;
 	} while (xform);
 
Signature · 1 line
2.5.0
#34 lore raw

PATCH v9 3/5 cryptodev: remove unused phys_addr field from key

In reply to Fiona Trahe

Remove unused phys_addr field from key in crypto_xform, simplifiy struct and fix knock-on impacts in l2fwd-crypto app

---
 examples/l2fwd-crypto/main.c          | 42 ++++++++++++++++++++++++++---------
 lib/librte_cryptodev/rte_crypto_sym.h | 16 ++++++-------
 2 files changed, 39 insertions(+), 19 deletions(-)
examples/l2fwd-crypto/main.c +31 -11
index ee519e7..9b6b7ef 100644
@@ -112,6 +112,12 @@ enum l2fwd_crypto_xform_chain {
 	L2FWD_CRYPTO_HASH_CIPHER
 };
 
+struct l2fwd_key {
+	uint8_t *data;
+	uint32_t length;
+	phys_addr_t phys_addr;
+};
+
 /** l2fwd crypto application command line options */
 struct l2fwd_crypto_options {
 	unsigned portmask;
@@ -127,7 +133,7 @@ struct l2fwd_crypto_options {
 	struct rte_crypto_sym_xform cipher_xform;
 	uint8_t ckey_data[32];
 
-	struct rte_crypto_key iv_key;
+	struct l2fwd_key iv_key;
 	uint8_t ivkey_data[16];
 
 	struct rte_crypto_sym_xform auth_xform;
@@ -141,7 +147,7 @@ struct l2fwd_crypto_params {
 
 	unsigned digest_length;
 	unsigned block_size;
-	struct rte_crypto_key iv_key;
+	struct l2fwd_key iv_key;
 	struct rte_cryptodev_sym_session *session;
 };
 
@@ -744,7 +750,7 @@ parse_cipher_op(enum rte_crypto_cipher_operation *op, char *optarg)
 
 /** Parse crypto key command line argument */
 static int
-parse_key(struct rte_crypto_key *key __rte_unused,
+parse_key(struct l2fwd_key *key __rte_unused,
 		unsigned length __rte_unused, char *arg __rte_unused)
 {
 	printf("Currently an unsupported argument!\n");
@@ -820,11 +826,18 @@ l2fwd_crypto_parse_args_long_options(struct l2fwd_crypto_options *options,
 		return parse_cipher_op(&options->cipher_xform.cipher.op,
 				optarg);
 
-	else if (strcmp(lgopts[option_index].name, "cipher_key") == 0)
-		return parse_key(&options->cipher_xform.cipher.key,
-				sizeof(options->ckey_data), optarg);
+	else if (strcmp(lgopts[option_index].name, "cipher_key") == 0) {
+		struct l2fwd_key key = { 0 };
+		int retval = 0;
+
+		retval = parse_key(&key, sizeof(options->ckey_data), optarg);
+
+		options->cipher_xform.cipher.key.data = key.data;
+		options->cipher_xform.cipher.key.length = key.length;
 
-	else if (strcmp(lgopts[option_index].name, "iv") == 0)
+		return retval;
+
+	} else if (strcmp(lgopts[option_index].name, "iv") == 0)
 		return parse_key(&options->iv_key, sizeof(options->ivkey_data),
 				optarg);
 
@@ -837,11 +850,18 @@ l2fwd_crypto_parse_args_long_options(struct l2fwd_crypto_options *options,
 		return parse_auth_op(&options->auth_xform.auth.op,
 				optarg);
 
-	else if (strcmp(lgopts[option_index].name, "auth_key") == 0)
-		return parse_key(&options->auth_xform.auth.key,
-				sizeof(options->akey_data), optarg);
+	else if (strcmp(lgopts[option_index].name, "auth_key") == 0) {
+		struct l2fwd_key key = { 0 };
+		int retval = 0;
+
+		retval = parse_key(&key, sizeof(options->akey_data), optarg);
+
+		options->auth_xform.auth.key.data = key.data;
+		options->auth_xform.auth.key.length = key.length;
+
+		return retval;
 
-	else if (strcmp(lgopts[option_index].name, "sessionless") == 0) {
+	} else if (strcmp(lgopts[option_index].name, "sessionless") == 0) {
 		options->sessionless = 1;
 		return 0;
 	}
lib/librte_cryptodev/rte_crypto_sym.h +8 -8
index de6c701..270510e 100644
@@ -111,12 +111,6 @@ enum rte_crypto_cipher_operation {
 	/**< Decrypt cipher operation */
 };
 
-/** Crypto key structure */
-struct rte_crypto_key {
-	uint8_t *data;  /**< pointer to key data */
-	phys_addr_t phys_addr;
-	size_t length;  /**< key length in bytes */
-};
 
 /**
  * Symmetric Cipher Setup Data.
@@ -133,7 +127,10 @@ struct rte_crypto_cipher_xform {
 	enum rte_crypto_cipher_algorithm algo;
 	/**< Cipher algorithm */
 
-	struct rte_crypto_key key;
+	struct {
+		uint8_t *data;  /**< pointer to key data */
+		size_t length;  /**< key length in bytes */
+	} key;
 	/**< Cipher key
 	 *
 	 * For the RTE_CRYPTO_CIPHER_AES_F8 mode of operation, key.data will
@@ -257,7 +254,10 @@ struct rte_crypto_auth_xform {
 	enum rte_crypto_auth_algorithm algo;
 	/**< Authentication algorithm selection */
 
-	struct rte_crypto_key key;
+	struct {
+		uint8_t *data;  /**< pointer to key data */
+		size_t length;  /**< key length in bytes */
+	} key;
 	/**< Authentication key data.
 	 * The authentication key length MUST be less than or equal to the
 	 * block size of the algorithm. It is the callers responsibility to
Signature · 1 line
2.5.0
#35 lore raw

PATCH v9 4/5 cryptodev: change burst API to be crypto op oriented

In reply to Fiona Trahe

From: Declan Doherty <[email protected]>

This patch modifies the crypto burst enqueue/dequeue APIs to operate on bursts rte_crypto_op's rather than the current implementation which operates on rte_mbuf bursts, this simplifies the burst processing in the crypto PMDs and the use of crypto operations in general, including new functions for managing rte_crypto_op pools.

These changes continues the separation of the symmetric operation parameters from the more general operation parameters, which will simplify the integration of asymmetric crypto operations in the future.

PMDs, unit tests and sample applications are also modified to work with the modified and new API.

---
 app/test/test_cryptodev.c                          | 640 +++++++++++----------
 app/test/test_cryptodev_perf.c                     | 221 ++++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 133 +++--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  12 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   4 +-
 drivers/crypto/qat/qat_crypto.c                    | 132 +++--
 drivers/crypto/qat/qat_crypto.h                    |  12 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   4 +-
 examples/l2fwd-crypto/main.c                       | 164 +++---
 lib/librte_cryptodev/rte_crypto.h                  | 352 +++++++++++-
 lib/librte_cryptodev/rte_crypto_sym.h              | 374 ++++++------
 lib/librte_cryptodev/rte_cryptodev.c               |  76 +++
 lib/librte_cryptodev/rte_cryptodev.h               | 108 ++--
 lib/librte_cryptodev/rte_cryptodev_version.map     |   3 +-
 14 files changed, 1397 insertions(+), 838 deletions(-)
app/test/test_cryptodev.c +351 -289
index 5ced183..55367df 100644
@@ -48,7 +48,7 @@ static enum rte_cryptodev_type gbl_cryptodev_type;
 
 struct crypto_testsuite_params {
 	struct rte_mempool *mbuf_pool;
-	struct rte_mempool *mbuf_ol_pool;
+	struct rte_mempool *op_mpool;
 	struct rte_cryptodev_config conf;
 	struct rte_cryptodev_qp_conf qp_conf;
 
@@ -62,8 +62,7 @@ struct crypto_unittest_params {
 
 	struct rte_cryptodev_sym_session *sess;
 
-	struct rte_mbuf_offload *ol;
-	struct rte_crypto_sym_op *op;
+	struct rte_crypto_op *op;
 
 	struct rte_mbuf *obuf, *ibuf;
 
@@ -112,19 +111,21 @@ hexdump_mbuf_data(FILE *f, const char *title, struct rte_mbuf *m)
 }
 #endif
 
-static struct rte_mbuf *
-process_crypto_request(uint8_t dev_id, struct rte_mbuf *ibuf)
+static struct rte_crypto_op *
+process_crypto_request(uint8_t dev_id, struct rte_crypto_op *op)
 {
-	struct rte_mbuf *obuf = NULL;
 #if HEX_DUMP
 	hexdump_mbuf_data(stdout, "Enqueued Packet", ibuf);
 #endif
 
-	if (rte_cryptodev_enqueue_burst(dev_id, 0, &ibuf, 1) != 1) {
+	if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) != 1) {
 		printf("Error sending packet for encryption");
 		return NULL;
 	}
-	while (rte_cryptodev_dequeue_burst(dev_id, 0, &obuf, 1) == 0)
+
+	op = NULL;
+
+	while (rte_cryptodev_dequeue_burst(dev_id, 0, &op, 1) == 0)
 		rte_pause();
 
 #if HEX_DUMP
@@ -132,7 +133,7 @@ process_crypto_request(uint8_t dev_id, struct rte_mbuf *ibuf)
 		hexdump_mbuf_data(stdout, "Dequeued Packet", obuf);
 #endif
 
-	return obuf;
+	return op;
 }
 
 static struct crypto_testsuite_params testsuite_params = { NULL };
@@ -162,13 +163,14 @@ testsuite_setup(void)
 		}
 	}
 
-	ts_params->mbuf_ol_pool = rte_pktmbuf_offload_pool_create(
-			"MBUF_OFFLOAD_POOL",
+	ts_params->op_mpool = rte_crypto_op_pool_create(
+			"MBUF_CRYPTO_SYM_OP_POOL",
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC,
 			NUM_MBUFS, MBUF_CACHE_SIZE,
 			DEFAULT_NUM_XFORMS *
 			sizeof(struct rte_crypto_sym_xform),
 			rte_socket_id());
-	if (ts_params->mbuf_ol_pool == NULL) {
+	if (ts_params->op_mpool == NULL) {
 		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
 		return TEST_FAILED;
 	}
@@ -253,10 +255,9 @@ testsuite_teardown(void)
 		rte_mempool_count(ts_params->mbuf_pool));
 	}
 
-
-	if (ts_params->mbuf_ol_pool != NULL) {
+	if (ts_params->op_mpool != NULL) {
 		RTE_LOG(DEBUG, USER1, "CRYPTO_OP_POOL count %u\n",
-		rte_mempool_count(ts_params->mbuf_ol_pool));
+		rte_mempool_count(ts_params->op_mpool));
 	}
 
 }
@@ -326,8 +327,8 @@ ut_teardown(void)
 	}
 
 	/* free crypto operation structure */
-	if (ut_params->ol)
-		rte_pktmbuf_offload_free(ut_params->ol);
+	if (ut_params->op)
+		rte_crypto_op_free(ut_params->op);
 
 	/*
 	 * free mbuf - both obuf and ibuf are usually the same,
@@ -793,53 +794,59 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 			&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
-	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	/* Generate crypto op data structure */
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
 
-	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
+
+	/* Set crypto operation authentication parameters */
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA1;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA1;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
-			CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	/* Set crypto operation cipher parameters */
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
+			CIPHER_IV_LENGTH_AES_CBC);
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
 
 	/* Validate obuf */
-	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
-			CIPHER_IV_LENGTH_AES_CBC,
+	uint8_t *ciphertext = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_src,
+			uint8_t *, CIPHER_IV_LENGTH_AES_CBC);
+
+	TEST_ASSERT_BUFFERS_ARE_EQUAL(ciphertext,
 			catch_22_quote_2_512_bytes_AES_CBC_ciphertext,
 			QUOTE_512_BYTES,
 			"ciphertext data not as expected");
 
-	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
-			CIPHER_IV_LENGTH_AES_CBC + QUOTE_512_BYTES,
+	uint8_t *digest = ciphertext + QUOTE_512_BYTES;
+
+	TEST_ASSERT_BUFFERS_ARE_EQUAL(digest,
 			catch_22_quote_2_512_bytes_AES_CBC_HMAC_SHA1_digest,
 			gbl_cryptodev_type == RTE_CRYPTODEV_AESNI_MB_PMD ?
 					TRUNCATED_DIGEST_BYTE_LENGTH_SHA1 :
@@ -864,60 +871,66 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
-
-	TEST_ASSERT_NOT_NULL(rte_pktmbuf_offload_alloc_crypto_sym_xforms(
-			ut_params->ol, 2),
+	TEST_ASSERT_NOT_NULL(rte_crypto_op_sym_xforms_alloc(ut_params->op, 2),
 			"failed to allocate space for crypto transforms");
 
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
+
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
+
 	/* Set crypto operation data parameters */
-	ut_params->op->xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+	sym_op->xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 
 	/* cipher parameters */
-	ut_params->op->xform->cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
-	ut_params->op->xform->cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
-	ut_params->op->xform->cipher.key.data = aes_cbc_key;
-	ut_params->op->xform->cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
+	sym_op->xform->cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
+	sym_op->xform->cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
+	sym_op->xform->cipher.key.data = aes_cbc_key;
+	sym_op->xform->cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* hash parameters */
-	ut_params->op->xform->next->type = RTE_CRYPTO_SYM_XFORM_AUTH;
+	sym_op->xform->next->type = RTE_CRYPTO_SYM_XFORM_AUTH;
 
-	ut_params->op->xform->next->auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
-	ut_params->op->xform->next->auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
-	ut_params->op->xform->next->auth.key.length = HMAC_KEY_LENGTH_SHA1;
-	ut_params->op->xform->next->auth.key.data = hmac_sha1_key;
-	ut_params->op->xform->next->auth.digest_length =
+	sym_op->xform->next->auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
+	sym_op->xform->next->auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
+	sym_op->xform->next->auth.key.length = HMAC_KEY_LENGTH_SHA1;
+	sym_op->xform->next->auth.key.data = hmac_sha1_key;
+	sym_op->xform->next->auth.digest_length =
 			DIGEST_BYTE_LENGTH_SHA1;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA1;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA1;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
-			CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
+
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
+			CIPHER_IV_LENGTH_AES_CBC);
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
+
+	ut_params->obuf = ut_params->op->sym->m_src;
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
@@ -986,42 +999,48 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
+	/* attach symmetric crypto session to crypto operations */
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
 
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA1;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA1;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
-			CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
+			CIPHER_IV_LENGTH_AES_CBC);
 
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
+
+	ut_params->obuf = ut_params->op->sym->m_src;
+
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
@@ -1089,47 +1108,51 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
 
 	/* Create Crypto session*/
-	ut_params->sess =
-		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
-						&ut_params->cipher_xform);
+	ut_params->sess = rte_cryptodev_sym_session_create(
+			ts_params->valid_devs[0],
+			&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
 
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA256;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA256;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
-			CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
+			CIPHER_IV_LENGTH_AES_CBC);
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
+
+	ut_params->obuf = ut_params->op->sym->m_src;
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
@@ -1198,42 +1221,47 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
-
-	ut_params->op = &ut_params->ol->op.crypto;
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
+
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
+
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA256;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA256;
+
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(
 			ut_params->ibuf, CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
 			CIPHER_IV_LENGTH_AES_CBC);
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	/* Process crypto operation */
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
 
-	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	ut_params->obuf = ut_params->op->sym->m_src;
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
@@ -1312,43 +1340,46 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
-
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
 
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA512;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA512;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
-			CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
+			CIPHER_IV_LENGTH_AES_CBC);
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
+
+	ut_params->obuf = ut_params->op->sym->m_src;
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
@@ -1448,43 +1479,46 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 			DIGEST_BYTE_LENGTH_SHA512);
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
+	rte_crypto_op_attach_sym_session(ut_params->op, sess);
 
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, sess);
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA512;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA512;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
+
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(
 			ut_params->ibuf, CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, 0);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
 			CIPHER_IV_LENGTH_AES_CBC);
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	/* Process crypto operation */
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
 
-	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	ut_params->obuf = ut_params->op->sym->m_src;
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
@@ -1522,10 +1556,6 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
 			catch_22_quote, QUOTE_512_BYTES, 0);
 
-	ut_params->digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,
-			DIGEST_BYTE_LENGTH_AES_XCBC);
-	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
-
 	/* Setup Cipher Parameters */
 	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
@@ -1546,54 +1576,71 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
 
 	/* Create Crypto session*/
-	ut_params->sess =
-		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
-						&ut_params->cipher_xform);
+	ut_params->sess = rte_cryptodev_sym_session_create(
+			ts_params->valid_devs[0],
+			&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
 
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
 
-	ut_params->op->iv.data = (uint8_t *)
-		rte_pktmbuf_prepend(ut_params->ibuf,
-				CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	/* Set operation cipher parameters */
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(
+			sym_op->m_src, CIPHER_IV_LENGTH_AES_CBC);
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(sym_op->m_src);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
 			CIPHER_IV_LENGTH_AES_CBC);
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
+
+	/* Set operation authentication parameters */
+	sym_op->auth.digest.data = (uint8_t *)rte_pktmbuf_append(
+			sym_op->m_src, DIGEST_BYTE_LENGTH_AES_XCBC);
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+			sym_op->m_src,
+			CIPHER_IV_LENGTH_AES_CBC + QUOTE_512_BYTES);
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_AES_XCBC;
+
+	memset(sym_op->auth.digest.data, 0, DIGEST_BYTE_LENGTH_AES_XCBC);
+
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	ut_params->op = process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op);
+	TEST_ASSERT_NOT_NULL(ut_params->op, "failed to process sym crypto op");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
-			CIPHER_IV_LENGTH_AES_CBC,
+			rte_pktmbuf_mtod_offset(ut_params->op->sym->m_src,
+					uint8_t *, CIPHER_IV_LENGTH_AES_CBC),
 			catch_22_quote_2_512_bytes_AES_CBC_ciphertext,
 			QUOTE_512_BYTES,
 			"Ciphertext data not as expected");
+
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
-			CIPHER_IV_LENGTH_AES_CBC + QUOTE_512_BYTES,
+			rte_pktmbuf_mtod_offset(
+					ut_params->op->sym->m_src, uint8_t *,
+					CIPHER_IV_LENGTH_AES_CBC +
+					QUOTE_512_BYTES),
 			catch_22_quote_2_512_bytes_HMAC_AES_XCBC_digest,
 			DIGEST_BYTE_LENGTH_AES_XCBC,
 			"Generated digest data not as expected");
@@ -1612,14 +1659,6 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 		(const char *)catch_22_quote_2_512_bytes_AES_CBC_ciphertext,
 		QUOTE_512_BYTES, 0);
 
-	ut_params->digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,
-			DIGEST_BYTE_LENGTH_AES_XCBC);
-	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
-
-	rte_memcpy(ut_params->digest,
-			catch_22_quote_2_512_bytes_HMAC_AES_XCBC_digest,
-			DIGEST_BYTE_LENGTH_AES_XCBC);
-
 	/* Setup Cipher Parameters */
 	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
@@ -1646,35 +1685,55 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
+	/* Set crypto operation data parameters */
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
 
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
-			CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	sym_op->auth.digest.data = (uint8_t *)rte_pktmbuf_append(
+				ut_params->ibuf, DIGEST_BYTE_LENGTH_AES_XCBC);
+	TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
+			"no room to append digest");
+
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+			ut_params->ibuf, QUOTE_512_BYTES);
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_AES_XCBC;
+
+	rte_memcpy(sym_op->auth.digest.data,
+			catch_22_quote_2_512_bytes_HMAC_AES_XCBC_digest,
+			DIGEST_BYTE_LENGTH_AES_XCBC);
+
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
+
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(
+			ut_params->ibuf, CIPHER_IV_LENGTH_AES_CBC);
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
+
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
 			CIPHER_IV_LENGTH_AES_CBC);
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
+
+	ut_params->obuf = ut_params->op->sym->m_src;
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
@@ -1835,50 +1894,53 @@ test_not_in_place_crypto(void)
 			DIGEST_BYTE_LENGTH_SHA512);
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
-
-	ut_params->op = &ut_params->ol->op.crypto;
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
+
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
+
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
+	sym_op->m_dst = dst_m;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA512;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA512;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
+
+
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(
 			ut_params->ibuf, CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, 0);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
 			CIPHER_IV_LENGTH_AES_CBC);
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
-
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
-
-	ut_params->op->dst.m = dst_m;
-	ut_params->op->dst.offset = 0;
-
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	ut_params->op = process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op);
+	TEST_ASSERT_NOT_NULL(ut_params->op, "no crypto operation returned");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto operation processing failed");
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			rte_pktmbuf_mtod(ut_params->op->dst.m, char *),
+			rte_pktmbuf_mtod(ut_params->op->sym->m_dst, char *),
 			catch_22_quote,
 			QUOTE_512_BYTES,
 			"Plaintext data not as expected");
app/test/test_cryptodev_perf.c +110 -111

372 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +72 -61

257 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +6 -6
index d56de12..b1dd103 100644
@@ -138,9 +138,9 @@ aesni_mb_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 	return 0;
 }
 
-/** Create a ring to place process packets on */
+/** Create a ring to place processed operations on */
 static struct rte_ring *
-aesni_mb_pmd_qp_create_processed_pkts_ring(struct aesni_mb_qp *qp,
+aesni_mb_pmd_qp_create_processed_ops_ring(struct aesni_mb_qp *qp,
 		unsigned ring_size, int socket_id)
 {
 	struct rte_ring *r;
@@ -148,12 +148,12 @@ aesni_mb_pmd_qp_create_processed_pkts_ring(struct aesni_mb_qp *qp,
 	r = rte_ring_lookup(qp->name);
 	if (r) {
 		if (r->prod.size >= ring_size) {
-			MB_LOG_INFO("Reusing existing ring %s for processed packets",
+			MB_LOG_INFO("Reusing existing ring %s for processed ops",
 					 qp->name);
 			return r;
 		}
 
-		MB_LOG_ERR("Unable to reuse existing ring %s for processed packets",
+		MB_LOG_ERR("Unable to reuse existing ring %s for processed ops",
 				 qp->name);
 		return NULL;
 	}
@@ -189,9 +189,9 @@ aesni_mb_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 
 	qp->ops = &job_ops[internals->vector_mode];
 
-	qp->processed_pkts = aesni_mb_pmd_qp_create_processed_pkts_ring(qp,
+	qp->processed_ops = aesni_mb_pmd_qp_create_processed_ops_ring(qp,
 			qp_conf->nb_descriptors, socket_id);
-	if (qp->processed_pkts == NULL)
+	if (qp->processed_ops == NULL)
 		goto qp_setup_cleanup;
 
 	qp->sess_mp = dev->data->session_pool;
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +2 -2
index 0aed177..949d9a6 100644
@@ -146,8 +146,8 @@ struct aesni_mb_qp {
 	/**< Vector mode dependent pointer table of the multi-buffer APIs */
 	MB_MGR mb_mgr;
 	/**< Multi-buffer instance */
-	struct rte_ring *processed_pkts;
-	/**< Ring for placing process packets */
+	struct rte_ring *processed_ops;
+	/**< Ring for placing process operations */
 	struct rte_mempool *sess_mp;
 	/**< Session Mempool */
 	struct rte_cryptodev_stats stats;
drivers/crypto/qat/qat_crypto.c +70 -62

249 lines not on this page · raw message

drivers/crypto/qat/qat_crypto.h +6 -6
index e9f71fe..9323383 100644
@@ -115,12 +115,12 @@ extern void
 qat_crypto_sym_clear_session(struct rte_cryptodev *dev, void *session);
 
 
-uint16_t
-qat_sym_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts,
-		uint16_t nb_pkts);
+extern uint16_t
+qat_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops,
+		uint16_t nb_ops);
 
-uint16_t
-qat_sym_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts,
-		uint16_t nb_pkts);
+extern uint16_t
+qat_pmd_dequeue_op_burst(void *qp, struct rte_crypto_op **ops,
+		uint16_t nb_ops);
 
 #endif /* _QAT_CRYPTO_H_ */
drivers/crypto/qat/rte_qat_cryptodev.c +2 -2
index 85700fc..5e51aca 100644
@@ -92,8 +92,8 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_
 	cryptodev->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	cryptodev->dev_ops = &crypto_qat_ops;
 
-	cryptodev->enqueue_burst = qat_sym_crypto_pkt_tx_burst;
-	cryptodev->dequeue_burst = qat_sym_crypto_pkt_rx_burst;
+	cryptodev->enqueue_burst = qat_pmd_enqueue_op_burst;
+	cryptodev->dequeue_burst = qat_pmd_dequeue_op_burst;
 
 
 	internals = cryptodev->data->dev_private;
examples/l2fwd-crypto/main.c +89 -75

303 lines not on this page · raw message

lib/librte_cryptodev/rte_crypto.h +349 -3

372 lines not on this page · raw message

lib/librte_cryptodev/rte_crypto_sym.h +209 -165

457 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.c +76 -0

76 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.h +53 -55

108 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev_version.map +2 -1
index a46af6f..6de6c7d 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.5.0

Part of the diff is not shown here. View the raw message.

#36 lore raw

Re: [PATCH v9 4/5] cryptodev: change burst API to be crypto op oriented

2016-03-10 15:41, Fiona Trahe:

Quoted 1 line

lib/librte_cryptodev/rte_crypto_sym.h | 374 ++++++------

Sorry there is another issue:

rte_crypto_sym.h:622: warning: argument 'op' of command @param is not found in the argument list of __rte_crypto_sym_op_attach_sym_session(struct rte_crypto_sym_op *sym_op, struct rte_cryptodev_sym_session *sess) rte_crypto_sym.h:628: warning: The following parameters of __rte_crypto_sym_op_attach_sym_session(struct rte_crypto_sym_op *sym_op, struct rte_cryptodev_sym_session *sess) are not documented:
parameter 'sym_op'
rte_crypto_sym.h:592: warning: unable to resolve reference to `rte_cryptodev_session_create' for \ref command

I've fixed it with the following changes:

* The length of the data pointed to by this field is
* set up for the session in the @ref
* rte_crypto_auth_xform structure as part of the @ref

-                        * rte_cryptodev_session_create function call.  This
-                        * length must not exceed 240 bytes.
+                        * rte_cryptodev_sym_session_create function call.
+                        * This length must not exceed 240 bytes.

/**
* Attach a session to a symmetric crypto operation *

- * @param      op      crypto operation
+ * @param      sym_op  crypto operation
  * @param      sess    cryptodev session

*/

#37 lore raw

Re: [PATCH v9 4/5] cryptodev: change burst API to be crypto op oriented

HI Thomas,

Quoted 30 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, March 10, 2016 4:03 PM
To: Trahe, Fiona
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v9 4/5] cryptodev: change burst API to be crypto op oriented

2016-03-10 15:41, Fiona Trahe:

Quoted 1 line

lib/librte_cryptodev/rte_crypto_sym.h | 374 ++++++------

Sorry there is another issue:

rte_crypto_sym.h:622: warning: argument 'op' of command @param is not found in the argument list of __rte_crypto_sym_op_attach_sym_session(struct rte_crypto_sym_op *sym_op, struct rte_cryptodev_sym_session *sess) rte_crypto_sym.h:628: warning: The following parameters of __rte_crypto_sym_op_attach_sym_session(struct rte_crypto_sym_op *sym_op, struct rte_cryptodev_sym_session *sess) are not documented:
parameter 'sym_op'
rte_crypto_sym.h:592: warning: unable to resolve reference to `rte_cryptodev_session_create' for \ref command

I've fixed it with the following changes:

* The length of the data pointed to by this field is
* set up for the session in the @ref
* rte_crypto_auth_xform structure as part of the @ref

(quoted diff) +0 -2
-                        * rte_cryptodev_session_create function call.  This
-                        * length must not exceed 240 bytes.

Review

Quoted 10 lines
(quoted diff) +3 -1
+                        * rte_cryptodev_sym_session_create function call.
+                        * This length must not exceed 240 bytes.
 
 /**
  * Attach a session to a symmetric crypto operation
  *
- * @param      op      crypto operation
+ * @param      sym_op  crypto operation
  * @param      sess    cryptodev session
  */

This is great fun :)
Do you need me to respin a v10 with that fix?
Or have you applied with the fix?

#38 lore raw

v9 cover cryptodev API changes

In reply to Fiona Trahe

From: Pablo de Lara <[email protected]>

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

v9:
- include missing casting that was making C++ complain

v8:
- split patchset for easier review
- fix broken /examples/l2fwd-crypto build in intermediate patch
- split removal of rte_mbuf_offload into separate commit

v7:
- remove trailing spaces introduced in v6
- rebase against recent config file changes

v6:
- restore EXPERIMENTAL label to cryptodev. Will handle removal in separate thread.
(email subject was incorrect in v5, so v5 hasn't arrived in patchwork, therefore v6 is in-reply-to v4 message id)

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

V4:
- Fixes for issues introduced in __rte_crypto_op_raw_bulk_alloc in V3 patcheset.
- Typo fix in cached attribute on rte_crypto_op structure.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (2):
cryptodev: change burst API to be crypto op oriented
mbuf_offload: remove library

Fiona Trahe (3):
cryptodev: code cleanup
cryptodev: refactor to partition common from symmetric-specific code
cryptodev: remove unused phys_addr field from key

 MAINTAINERS                                        |   4 -
 app/test/test_cryptodev.c                          | 883 +++++++++++----------
 app/test/test_cryptodev.h                          |   5 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_base                                 |   7 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 190 +++--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  30 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |  10 +-
 drivers/crypto/qat/qat_crypto.c                    | 160 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 234 +++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 819 ++++++++-----------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 189 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   9 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 --------
 .../rte_mbuf_offload_version.map                   |   7 -
 26 files changed, 2131 insertions(+), 1968 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
Signature · 1 line
2.5.0
#39 lore raw

Re: [PATCH v9 0/5] cryptodev API changes

Quoted 8 lines

Declan Doherty (2):
cryptodev: change burst API to be crypto op oriented
mbuf_offload: remove library

Fiona Trahe (3):
cryptodev: code cleanup
cryptodev: refactor to partition common from symmetric-specific code
cryptodev: remove unused phys_addr field from key

Applied, thanks for the big work

#40 lore raw

PATCH v9 5/5 mbuf_offload: remove library

In reply to Fiona Trahe

From: Declan Doherty <[email protected]>

As cryptodev library does not depend on mbuf_offload library any longer, this patch removes it.

---
 MAINTAINERS                                        |   4 -
 app/test/test_cryptodev.c                          |   1 -
 app/test/test_cryptodev_perf.c                     |   1 -
 config/common_base                                 |   7 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         |   1 -
 drivers/crypto/qat/qat_crypto.c                    |   1 -
 examples/l2fwd-crypto/main.c                       |   1 -
 lib/Makefile                                       |   1 -
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 ----
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 -------
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 ---------------------
 .../rte_mbuf_offload_version.map                   |   7 -
 14 files changed, 493 deletions(-)
 delete mode 100644 lib/librte_mbuf_offload/Makefile
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map
MAINTAINERS +0 -4
index e253bf7..421c317 100644
@@ -223,10 +223,6 @@ F: lib/librte_mbuf/
 F: doc/guides/prog_guide/mbuf_lib.rst
 F: app/test/test_mbuf.c
 
-Packet buffer offload - EXPERIMENTAL
-M: Declan Doherty <[email protected]>
-F: lib/librte_mbuf_offload/
-
 Ethernet API
 M: Thomas Monjalon <[email protected]>
 F: lib/librte_ether/
app/test/test_cryptodev.c +0 -1
index 55367df..3240ecd 100644
@@ -35,7 +35,6 @@
 #include <rte_mbuf.h>
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
-#include <rte_mbuf_offload.h>
 
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
app/test/test_cryptodev_perf.c +0 -1
index b43f9aa..b3f4fd9 100644
@@ -32,7 +32,6 @@
 
 #include <rte_common.h>
 #include <rte_mbuf.h>
-#include <rte_mbuf_offload.h>
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
 
config/common_base +0 -7
index c73f71a..0a02924 100644
@@ -361,13 +361,6 @@ CONFIG_RTE_MBUF_REFCNT_ATOMIC=y
 CONFIG_RTE_PKTMBUF_HEADROOM=128
 
 #
-# Compile librte_mbuf_offload
-# EXPERIMENTAL: API may change without prior notice
-#
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD=y
-CONFIG_RTE_LIBRTE_MBUF_OFFLOAD_DEBUG=n
-
-#
 # Compile librte_timer
 #
 CONFIG_RTE_LIBRTE_TIMER=y
doc/api/doxy-api-index.md +0 -1
index 7a91001..f626386 100644
@@ -104,7 +104,6 @@ There are many libraries, so their headers may be grouped by topics:
 
 - **containers**:
   [mbuf]               (@ref rte_mbuf.h),
-  [mbuf_offload]       (@ref rte_mbuf_offload.h),
   [ring]               (@ref rte_ring.h),
   [distributor]        (@ref rte_distributor.h),
   [reorder]            (@ref rte_reorder.h),
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +0 -1
index f28b29f..9599cc4 100644
@@ -37,7 +37,6 @@
 #include <rte_dev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
-#include <rte_mbuf_offload.h>
 
 #include "rte_aesni_mb_pmd_private.h"
 
drivers/crypto/qat/qat_crypto.c +0 -1
index 11f7fb2..3533f37 100644
@@ -59,7 +59,6 @@
 #include <rte_mbuf.h>
 #include <rte_string_fns.h>
 #include <rte_spinlock.h>
-#include <rte_mbuf_offload.h>
 #include <rte_hexdump.h>
 
 #include "qat_logs.h"
examples/l2fwd-crypto/main.c +0 -1
index 6aaa7c0..65e90b5 100644
@@ -62,7 +62,6 @@
 #include <rte_log.h>
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_mbuf_offload.h>
 #include <rte_memcpy.h>
 #include <rte_memory.h>
 #include <rte_mempool.h>
lib/Makefile +0 -1
index 6840f87..f254dba 100644
@@ -36,7 +36,6 @@ DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
 DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
 DIRS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += librte_mempool
 DIRS-$(CONFIG_RTE_LIBRTE_MBUF) += librte_mbuf
-DIRS-$(CONFIG_RTE_LIBRTE_MBUF_OFFLOAD) += librte_mbuf_offload
 DIRS-$(CONFIG_RTE_LIBRTE_TIMER) += librte_timer
 DIRS-$(CONFIG_RTE_LIBRTE_CFGFILE) += librte_cfgfile
 DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline
lib/librte_mbuf/rte_mbuf.h +0 -6
index e39ad28..52f96c3 100644
@@ -728,9 +728,6 @@ typedef uint8_t  MARKER8[0];  /**< generic marker with 1B alignment */
 typedef uint64_t MARKER64[0]; /**< marker that allows us to overwrite 8 bytes
                                * with a single assignment */
 
-/** Opaque rte_mbuf_offload  structure declarations */
-struct rte_mbuf_offload;
-
 /**
  * The generic rte_mbuf, containing a packet mbuf.
  */
@@ -847,9 +844,6 @@ struct rte_mbuf {
 
 	/** Timesync flags for use with IEEE1588. */
 	uint16_t timesync;
-
-	/* Chain of off-load operations to perform on mbuf */
-	struct rte_mbuf_offload *offload_ops;
 } __rte_cache_aligned;
 
 static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp);
lib/librte_mbuf_offload/Makefile deleted +0 -52

52 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload.c deleted +0 -100

100 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload.h deleted +0 -310

310 lines not on this page · raw message

lib/librte_mbuf_offload/rte_mbuf_offload_version.map deleted +0 -7
deleted file mode 100644
index 3d3b06a..0000000
@@ -1,7 +0,0 @@
-DPDK_2.2 {
-	global:
-
-	rte_pktmbuf_offload_pool_create;
-
-	local: *;
-};
Signature · 1 line
2.5.0
Tested-by on the v8 series
#41 lore raw

Re: [PATCH v8 0/5] cryptodev API changes

In reply to Fiona Trahe

- Tested Commit: 4c387fcdf7776d3bb9f47789580a57bd18d4dbf3
- OS: Fedora20 3.11.10-301.fc20.x86_64
- GCC: gcc (GCC) 4.8.3
- CPU: Intel(R) Xeon(R) CPU E5-2658 v3 @ 2.20GHz
- NIC: Niantic
- Default x86_64-native-linuxapp-gcc configuration
- Prerequisites:
- Total 23 cases, 23 passed, 0 failed

- test case 1: QAT Unit test
Total 13 cases, 13 passed, 0 failed

- test case 2: AES_NI Unit test
Total 10 cases, 10 passed, 0 failed

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Fiona Trahe
Sent: Thursday, March 10, 2016 9:43 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH v8 0/5] cryptodev API changes

This patch set separates the symmetric crypto operations from generic operations and then modifies the cryptodev burst API to accept bursts of rte_crypto_op rather than rte_mbufs.

v8:
- split patchset for easier review
- fix broken /examples/l2fwd-crypto build in intermediate patch
- split removal of rte_mbuf_offload into separate commit

v7:
- remove trailing spaces introduced in v6
- rebase against recent config file changes

v6:
- restore EXPERIMENTAL label to cryptodev. Will handle removal in separate thread.
(email subject was incorrect in v5, so v5 hasn't arrived in patchwork, therefore v6 is in-reply-to v4 message id)

V5:
- updates .map file
- removes EXPERIMENTAL label from rte_cryptodev.h

V4:
- Fixes for issues introduced in __rte_crypto_op_raw_bulk_alloc in V3 patcheset.
- Typo fix in cached attribute on rte_crypto_op structure.

V3:
- Addresses V2 comments
- Rebased for head

Declan Doherty (2):
cryptodev: change burst API to be crypto op oriented
mbuf_offload: remove library

Fiona Trahe (3):
cryptodev: code cleanup
cryptodev: refactor to partition common from symmetric-specific code
cryptodev: remove unused phys_addr field from key

 MAINTAINERS                                        |   4 -
 app/test/test_cryptodev.c                          | 883 +++++++++++----------
 app/test/test_cryptodev.h                          |   5 +-
 app/test/test_cryptodev_perf.c                     | 270 ++++---
 config/common_base                                 |   7 -
 doc/api/doxy-api-index.md                          |   1 -
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 190 +++--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  30 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |  10 +-
 drivers/crypto/qat/qat_crypto.c                    | 160 ++--
 drivers/crypto/qat/qat_crypto.h                    |  14 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       | 234 +++---
 lib/Makefile                                       |   1 -
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 819 ++++++++-----------
 lib/librte_cryptodev/rte_crypto_sym.h              | 642 +++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               | 115 ++-
 lib/librte_cryptodev/rte_cryptodev.h               | 189 ++---
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  32 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   7 +-
 lib/librte_mbuf/rte_mbuf.h                         |   6 -
 lib/librte_mbuf_offload/Makefile                   |  52 --
 lib/librte_mbuf_offload/rte_mbuf_offload.c         | 100 ---
 lib/librte_mbuf_offload/rte_mbuf_offload.h         | 310 --------
 .../rte_mbuf_offload_version.map                   |   7 -
 26 files changed, 2130 insertions(+), 1967 deletions(-)  create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
 delete mode 100644 lib/librte_mbuf_offload/Makefile  delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.c
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload.h
 delete mode 100644 lib/librte_mbuf_offload/rte_mbuf_offload_version.map

--
2.1.0

#42 lore raw

PATCH v8 1/5 cryptodev: code cleanup

In reply to Fiona Trahe

- Fixed >80char lines in test file
- Removed unused elements from stats struct
- Removed unused objects in rte_cryptodev_pmd.h
- Renamed variables
- Replaced leading spaces with tabs
- Improved performance results display in test

---
 app/test/test_cryptodev.c                          | 151 ++++++++++-----------
 app/test/test_cryptodev.h                          |   5 +-
 app/test/test_cryptodev_perf.c                     |  54 +++++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         |  28 ++--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  12 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   2 +-
 lib/librte_cryptodev/rte_cryptodev.h               |  35 +----
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  10 +-
 8 files changed, 139 insertions(+), 158 deletions(-)
app/test/test_cryptodev.c +75 -76
index 62f8fb0..1a0f204 100644
@@ -165,7 +165,8 @@ testsuite_setup(void)
 	ts_params->mbuf_ol_pool = rte_pktmbuf_offload_pool_create(
 			"MBUF_OFFLOAD_POOL",
 			NUM_MBUFS, MBUF_CACHE_SIZE,
-			DEFAULT_NUM_XFORMS * sizeof(struct rte_crypto_xform),
+			DEFAULT_NUM_XFORMS *
+			sizeof(struct rte_crypto_xform),
 			rte_socket_id());
 	if (ts_params->mbuf_ol_pool == NULL) {
 		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
@@ -679,76 +680,77 @@ static uint8_t aes_cbc_iv[] = {
 /* ***** AES-CBC / HMAC-SHA1 Hash Tests ***** */
 
 static const uint8_t catch_22_quote_2_512_bytes_AES_CBC_ciphertext[] = {
-	0x8B, 0X4D, 0XDA, 0X1B, 0XCF, 0X04, 0XA0, 0X31,
-	0XB4, 0XBF, 0XBD, 0X68, 0X43, 0X20, 0X7E, 0X76,
-	0XB1, 0X96, 0X8B, 0XA2, 0X7C, 0XA2, 0X83, 0X9E,
-	0X39, 0X5A, 0X2F, 0X7E, 0X92, 0XB4, 0X48, 0X1A,
-	0X3F, 0X6B, 0X5D, 0XDF, 0X52, 0X85, 0X5F, 0X8E,
-	0X42, 0X3C, 0XFB, 0XE9, 0X1A, 0X24, 0XD6, 0X08,
-	0XDD, 0XFD, 0X16, 0XFB, 0XE9, 0X55, 0XEF, 0XF0,
-	0XA0, 0X8D, 0X13, 0XAB, 0X81, 0XC6, 0X90, 0X01,
-	0XB5, 0X18, 0X84, 0XB3, 0XF6, 0XE6, 0X11, 0X57,
-	0XD6, 0X71, 0XC6, 0X3C, 0X3F, 0X2F, 0X33, 0XEE,
-	0X24, 0X42, 0X6E, 0XAC, 0X0B, 0XCA, 0XEC, 0XF9,
-	0X84, 0XF8, 0X22, 0XAA, 0X60, 0XF0, 0X32, 0XA9,
-	0X75, 0X75, 0X3B, 0XCB, 0X70, 0X21, 0X0A, 0X8D,
-	0X0F, 0XE0, 0XC4, 0X78, 0X2B, 0XF8, 0X97, 0XE3,
-	0XE4, 0X26, 0X4B, 0X29, 0XDA, 0X88, 0XCD, 0X46,
-	0XEC, 0XAA, 0XF9, 0X7F, 0XF1, 0X15, 0XEA, 0XC3,
-	0X87, 0XE6, 0X31, 0XF2, 0XCF, 0XDE, 0X4D, 0X80,
-	0X70, 0X91, 0X7E, 0X0C, 0XF7, 0X26, 0X3A, 0X92,
-	0X4F, 0X18, 0X83, 0XC0, 0X8F, 0X59, 0X01, 0XA5,
-	0X88, 0XD1, 0XDB, 0X26, 0X71, 0X27, 0X16, 0XF5,
-	0XEE, 0X10, 0X82, 0XAC, 0X68, 0X26, 0X9B, 0XE2,
-	0X6D, 0XD8, 0X9A, 0X80, 0XDF, 0X04, 0X31, 0XD5,
-	0XF1, 0X35, 0X5C, 0X3B, 0XDD, 0X9A, 0X65, 0XBA,
-	0X58, 0X34, 0X85, 0X61, 0X1C, 0X42, 0X10, 0X76,
-	0X73, 0X02, 0X42, 0XC9, 0X23, 0X18, 0X8E, 0XB4,
-	0X6F, 0XB4, 0XA3, 0X54, 0X6E, 0X88, 0X3B, 0X62,
-	0X7C, 0X02, 0X8D, 0X4C, 0X9F, 0XC8, 0X45, 0XF4,
-	0XC9, 0XDE, 0X4F, 0XEB, 0X22, 0X83, 0X1B, 0XE4,
-	0X49, 0X37, 0XE4, 0XAD, 0XE7, 0XCD, 0X21, 0X54,
-	0XBC, 0X1C, 0XC2, 0X04, 0X97, 0XB4, 0X10, 0X61,
-	0XF0, 0XE4, 0XEF, 0X27, 0X63, 0X3A, 0XDA, 0X91,
-	0X41, 0X25, 0X62, 0X1C, 0X5C, 0XB6, 0X38, 0X4A,
-	0X88, 0X71, 0X59, 0X5A, 0X8D, 0XA0, 0X09, 0XAF,
-	0X72, 0X94, 0XD7, 0X79, 0X5C, 0X60, 0X7C, 0X8F,
-	0X4C, 0XF5, 0XD9, 0XA1, 0X39, 0X6D, 0X81, 0X28,
-	0XEF, 0X13, 0X28, 0XDF, 0XF5, 0X3E, 0XF7, 0X8E,
-	0X09, 0X9C, 0X78, 0X18, 0X79, 0XB8, 0X68, 0XD7,
-	0XA8, 0X29, 0X62, 0XAD, 0XDE, 0XE1, 0X61, 0X76,
-	0X1B, 0X05, 0X16, 0XCD, 0XBF, 0X02, 0X8E, 0XA6,
-	0X43, 0X6E, 0X92, 0X55, 0X4F, 0X60, 0X9C, 0X03,
-	0XB8, 0X4F, 0XA3, 0X02, 0XAC, 0XA8, 0XA7, 0X0C,
-	0X1E, 0XB5, 0X6B, 0XF8, 0XC8, 0X4D, 0XDE, 0XD2,
-	0XB0, 0X29, 0X6E, 0X40, 0XE6, 0XD6, 0XC9, 0XE6,
-	0XB9, 0X0F, 0XB6, 0X63, 0XF5, 0XAA, 0X2B, 0X96,
-	0XA7, 0X16, 0XAC, 0X4E, 0X0A, 0X33, 0X1C, 0XA6,
-	0XE6, 0XBD, 0X8A, 0XCF, 0X40, 0XA9, 0XB2, 0XFA,
-	0X63, 0X27, 0XFD, 0X9B, 0XD9, 0XFC, 0XD5, 0X87,
-	0X8D, 0X4C, 0XB6, 0XA4, 0XCB, 0XE7, 0X74, 0X55,
-	0XF4, 0XFB, 0X41, 0X25, 0XB5, 0X4B, 0X0A, 0X1B,
-	0XB1, 0XD6, 0XB7, 0XD9, 0X47, 0X2A, 0XC3, 0X98,
-	0X6A, 0XC4, 0X03, 0X73, 0X1F, 0X93, 0X6E, 0X53,
-	0X19, 0X25, 0X64, 0X15, 0X83, 0XF9, 0X73, 0X2A,
-	0X74, 0XB4, 0X93, 0X69, 0XC4, 0X72, 0XFC, 0X26,
-	0XA2, 0X9F, 0X43, 0X45, 0XDD, 0XB9, 0XEF, 0X36,
-	0XC8, 0X3A, 0XCD, 0X99, 0X9B, 0X54, 0X1A, 0X36,
-	0XC1, 0X59, 0XF8, 0X98, 0XA8, 0XCC, 0X28, 0X0D,
-	0X73, 0X4C, 0XEE, 0X98, 0XCB, 0X7C, 0X58, 0X7E,
-	0X20, 0X75, 0X1E, 0XB7, 0XC9, 0XF8, 0XF2, 0X0E,
-	0X63, 0X9E, 0X05, 0X78, 0X1A, 0XB6, 0XA8, 0X7A,
-	0XF9, 0X98, 0X6A, 0XA6, 0X46, 0X84, 0X2E, 0XF6,
-	0X4B, 0XDC, 0X9B, 0X8F, 0X9B, 0X8F, 0XEE, 0XB4,
-	0XAA, 0X3F, 0XEE, 0XC0, 0X37, 0X27, 0X76, 0XC7,
-	0X95, 0XBB, 0X26, 0X74, 0X69, 0X12, 0X7F, 0XF1,
-	0XBB, 0XFF, 0XAE, 0XB5, 0X99, 0X6E, 0XCB, 0X0C
+	0x8B, 0x4D, 0xDA, 0x1B, 0xCF, 0x04, 0xA0, 0x31,
+	0xB4, 0xBF, 0xBD, 0x68, 0x43, 0x20, 0x7E, 0x76,
+	0xB1, 0x96, 0x8B, 0xA2, 0x7C, 0xA2, 0x83, 0x9E,
+	0x39, 0x5A, 0x2F, 0x7E, 0x92, 0xB4, 0x48, 0x1A,
+	0x3F, 0x6B, 0x5D, 0xDF, 0x52, 0x85, 0x5F, 0x8E,
+	0x42, 0x3C, 0xFB, 0xE9, 0x1A, 0x24, 0xD6, 0x08,
+	0xDD, 0xFD, 0x16, 0xFB, 0xE9, 0x55, 0xEF, 0xF0,
+	0xA0, 0x8D, 0x13, 0xAB, 0x81, 0xC6, 0x90, 0x01,
+	0xB5, 0x18, 0x84, 0xB3, 0xF6, 0xE6, 0x11, 0x57,
+	0xD6, 0x71, 0xC6, 0x3C, 0x3F, 0x2F, 0x33, 0xEE,
+	0x24, 0x42, 0x6E, 0xAC, 0x0B, 0xCA, 0xEC, 0xF9,
+	0x84, 0xF8, 0x22, 0xAA, 0x60, 0xF0, 0x32, 0xA9,
+	0x75, 0x75, 0x3B, 0xCB, 0x70, 0x21, 0x0A, 0x8D,
+	0x0F, 0xE0, 0xC4, 0x78, 0x2B, 0xF8, 0x97, 0xE3,
+	0xE4, 0x26, 0x4B, 0x29, 0xDA, 0x88, 0xCD, 0x46,
+	0xEC, 0xAA, 0xF9, 0x7F, 0xF1, 0x15, 0xEA, 0xC3,
+	0x87, 0xE6, 0x31, 0xF2, 0xCF, 0xDE, 0x4D, 0x80,
+	0x70, 0x91, 0x7E, 0x0C, 0xF7, 0x26, 0x3A, 0x92,
+	0x4F, 0x18, 0x83, 0xC0, 0x8F, 0x59, 0x01, 0xA5,
+	0x88, 0xD1, 0xDB, 0x26, 0x71, 0x27, 0x16, 0xF5,
+	0xEE, 0x10, 0x82, 0xAC, 0x68, 0x26, 0x9B, 0xE2,
+	0x6D, 0xD8, 0x9A, 0x80, 0xDF, 0x04, 0x31, 0xD5,
+	0xF1, 0x35, 0x5C, 0x3B, 0xDD, 0x9A, 0x65, 0xBA,
+	0x58, 0x34, 0x85, 0x61, 0x1C, 0x42, 0x10, 0x76,
+	0x73, 0x02, 0x42, 0xC9, 0x23, 0x18, 0x8E, 0xB4,
+	0x6F, 0xB4, 0xA3, 0x54, 0x6E, 0x88, 0x3B, 0x62,
+	0x7C, 0x02, 0x8D, 0x4C, 0x9F, 0xC8, 0x45, 0xF4,
+	0xC9, 0xDE, 0x4F, 0xEB, 0x22, 0x83, 0x1B, 0xE4,
+	0x49, 0x37, 0xE4, 0xAD, 0xE7, 0xCD, 0x21, 0x54,
+	0xBC, 0x1C, 0xC2, 0x04, 0x97, 0xB4, 0x10, 0x61,
+	0xF0, 0xE4, 0xEF, 0x27, 0x63, 0x3A, 0xDA, 0x91,
+	0x41, 0x25, 0x62, 0x1C, 0x5C, 0xB6, 0x38, 0x4A,
+	0x88, 0x71, 0x59, 0x5A, 0x8D, 0xA0, 0x09, 0xAF,
+	0x72, 0x94, 0xD7, 0x79, 0x5C, 0x60, 0x7C, 0x8F,
+	0x4C, 0xF5, 0xD9, 0xA1, 0x39, 0x6D, 0x81, 0x28,
+	0xEF, 0x13, 0x28, 0xDF, 0xF5, 0x3E, 0xF7, 0x8E,
+	0x09, 0x9C, 0x78, 0x18, 0x79, 0xB8, 0x68, 0xD7,
+	0xA8, 0x29, 0x62, 0xAD, 0xDE, 0xE1, 0x61, 0x76,
+	0x1B, 0x05, 0x16, 0xCD, 0xBF, 0x02, 0x8E, 0xA6,
+	0x43, 0x6E, 0x92, 0x55, 0x4F, 0x60, 0x9C, 0x03,
+	0xB8, 0x4F, 0xA3, 0x02, 0xAC, 0xA8, 0xA7, 0x0C,
+	0x1E, 0xB5, 0x6B, 0xF8, 0xC8, 0x4D, 0xDE, 0xD2,
+	0xB0, 0x29, 0x6E, 0x40, 0xE6, 0xD6, 0xC9, 0xE6,
+	0xB9, 0x0F, 0xB6, 0x63, 0xF5, 0xAA, 0x2B, 0x96,
+	0xA7, 0x16, 0xAC, 0x4E, 0x0A, 0x33, 0x1C, 0xA6,
+	0xE6, 0xBD, 0x8A, 0xCF, 0x40, 0xA9, 0xB2, 0xFA,
+	0x63, 0x27, 0xFD, 0x9B, 0xD9, 0xFC, 0xD5, 0x87,
+	0x8D, 0x4C, 0xB6, 0xA4, 0xCB, 0xE7, 0x74, 0x55,
+	0xF4, 0xFB, 0x41, 0x25, 0xB5, 0x4B, 0x0A, 0x1B,
+	0xB1, 0xD6, 0xB7, 0xD9, 0x47, 0x2A, 0xC3, 0x98,
+	0x6A, 0xC4, 0x03, 0x73, 0x1F, 0x93, 0x6E, 0x53,
+	0x19, 0x25, 0x64, 0x15, 0x83, 0xF9, 0x73, 0x2A,
+	0x74, 0xB4, 0x93, 0x69, 0xC4, 0x72, 0xFC, 0x26,
+	0xA2, 0x9F, 0x43, 0x45, 0xDD, 0xB9, 0xEF, 0x36,
+	0xC8, 0x3A, 0xCD, 0x99, 0x9B, 0x54, 0x1A, 0x36,
+	0xC1, 0x59, 0xF8, 0x98, 0xA8, 0xCC, 0x28, 0x0D,
+	0x73, 0x4C, 0xEE, 0x98, 0xCB, 0x7C, 0x58, 0x7E,
+	0x20, 0x75, 0x1E, 0xB7, 0xC9, 0xF8, 0xF2, 0x0E,
+	0x63, 0x9E, 0x05, 0x78, 0x1A, 0xB6, 0xA8, 0x7A,
+	0xF9, 0x98, 0x6A, 0xA6, 0x46, 0x84, 0x2E, 0xF6,
+	0x4B, 0xDC, 0x9B, 0x8F, 0x9B, 0x8F, 0xEE, 0xB4,
+	0xAA, 0x3F, 0xEE, 0xC0, 0x37, 0x27, 0x76, 0xC7,
+	0x95, 0xBB, 0x26, 0x74, 0x69, 0x12, 0x7F, 0xF1,
+	0xBB, 0xFF, 0xAE, 0xB5, 0x99, 0x6E, 0xCB, 0x0C
 };
 
 static const uint8_t catch_22_quote_2_512_bytes_AES_CBC_HMAC_SHA1_digest[] = {
-	0x9a, 0X4f, 0X88, 0X1b, 0Xb6, 0X8f, 0Xd8, 0X60,
-	0X42, 0X1a, 0X7d, 0X3d, 0Xf5, 0X82, 0X80, 0Xf1,
-	0X18, 0X8c, 0X1d, 0X32 };
+	0x9a, 0x4f, 0x88, 0x1b, 0xb6, 0x8f, 0xd8, 0x60,
+	0x42, 0x1a, 0x7d, 0x3d, 0xf5, 0x82, 0x80, 0xf1,
+	0x18, 0x8c, 0x1d, 0x32
+};
 
 
 static int
@@ -775,7 +777,6 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-
 	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
@@ -785,8 +786,9 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	ut_params->auth_xform.auth.key.data = hmac_sha1_key;
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;
 
-	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
+	/* Create crypto session*/
+	ut_params->sess = rte_cryptodev_session_create(
+			ts_params->valid_devs[0],
 			&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
@@ -832,7 +834,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 			CIPHER_IV_LENGTH_AES_CBC,
 			catch_22_quote_2_512_bytes_AES_CBC_ciphertext,
 			QUOTE_512_BYTES,
-			"Ciphertext data not as expected");
+			"ciphertext data not as expected");
 
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
 			rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
@@ -1239,7 +1241,6 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
 			"Digest verification failed");
 
-
 	return TEST_SUCCESS;
 }
 
@@ -1361,7 +1362,6 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 					DIGEST_BYTE_LENGTH_SHA512,
 			"Generated digest data not as expected");
 
-
 	return TEST_SUCCESS;
 }
 
@@ -1417,6 +1417,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 	ut_params->auth_xform.auth.key.data = hmac_sha512_key;
 	ut_params->auth_xform.auth.key.length = HMAC_KEY_LENGTH_SHA512;
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA512;
+
 	return TEST_SUCCESS;
 }
 
@@ -1490,8 +1491,6 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
 	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
 			"Digest verification failed");
 
-
-
 	return TEST_SUCCESS;
 }
 
app/test/test_cryptodev.h +3 -2
index 034393e..083266a 100644
@@ -47,8 +47,9 @@
 #define DEFAULT_NUM_XFORMS              (2)
 #define NUM_MBUFS                       (8191)
 #define MBUF_CACHE_SIZE                 (250)
-#define MBUF_SIZE   (2048 + DIGEST_BYTE_LENGTH_SHA512 + \
-				sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
+#define MBUF_DATAPAYLOAD_SIZE		(2048 + DIGEST_BYTE_LENGTH_SHA512)
+#define MBUF_SIZE			(sizeof(struct rte_mbuf) + \
+		RTE_PKTMBUF_HEADROOM + MBUF_DATAPAYLOAD_SIZE)
 
 #define BYTE_LENGTH(x)				(x/8)
 /* HASH DIGEST LENGTHS */
app/test/test_cryptodev_perf.c +35 -19

119 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +16 -12
index c7d884c..f2afdb6 100644
@@ -377,17 +377,21 @@ process_crypto_op(struct aesni_mb_qp *qp, struct rte_mbuf *m,
 		job->auth_tag_output = (uint8_t *)rte_pktmbuf_append(m,
 				get_digest_byte_length(job->hash_alg));
 
-		if (job->auth_tag_output)
-			memset(job->auth_tag_output, 0,
-				sizeof(get_digest_byte_length(job->hash_alg)));
-		else
+		if (job->auth_tag_output == NULL) {
+			MB_LOG_ERR("failed to allocate space in output mbuf "
+					"for temp digest");
 			return NULL;
+		}
+
+		memset(job->auth_tag_output, 0,
+				sizeof(get_digest_byte_length(job->hash_alg)));
+
 	} else {
 		job->auth_tag_output = c_op->digest.data;
 	}
 
 	/*
-	 * Multiple buffer library current only support returning a truncated
+	 * Multi-buffer library current only support returning a truncated
 	 * digest length as specified in the relevant IPsec RFCs
 	 */
 	job->auth_tag_output_len_in_bytes =
@@ -489,7 +493,7 @@ handle_completed_jobs(struct aesni_mb_qp *qp, JOB_AES_HMAC *job)
 		if (m)
 			rte_ring_enqueue(qp->processed_pkts, (void *)m);
 		else
-			qp->qp_stats.dequeue_err_count++;
+			qp->stats.dequeue_err_count++;
 
 		job = (*qp->ops->job.get_completed_job)(&qp->mb_mgr);
 	}
@@ -513,19 +517,19 @@ aesni_mb_pmd_enqueue_burst(void *queue_pair, struct rte_mbuf **bufs,
 	for (i = 0; i < nb_bufs; i++) {
 		ol = rte_pktmbuf_offload_get(bufs[i], RTE_PKTMBUF_OL_CRYPTO);
 		if (unlikely(ol == NULL)) {
-			qp->qp_stats.enqueue_err_count++;
+			qp->stats.enqueue_err_count++;
 			goto flush_jobs;
 		}
 
 		sess = get_session(qp, &ol->op.crypto);
 		if (unlikely(sess == NULL)) {
-			qp->qp_stats.enqueue_err_count++;
+			qp->stats.enqueue_err_count++;
 			goto flush_jobs;
 		}
 
 		job = process_crypto_op(qp, bufs[i], &ol->op.crypto, sess);
 		if (unlikely(job == NULL)) {
-			qp->qp_stats.enqueue_err_count++;
+			qp->stats.enqueue_err_count++;
 			goto flush_jobs;
 		}
 
@@ -543,7 +547,7 @@ aesni_mb_pmd_enqueue_burst(void *queue_pair, struct rte_mbuf **bufs,
 	if (processed_jobs == 0)
 		goto flush_jobs;
 	else
-		qp->qp_stats.enqueued_count += processed_jobs;
+		qp->stats.enqueued_count += processed_jobs;
 		return i;
 
 flush_jobs:
@@ -553,7 +557,7 @@ flush_jobs:
 	 */
 	job = (*qp->ops->job.flush_job)(&qp->mb_mgr);
 	if (job)
-		qp->qp_stats.enqueued_count += handle_completed_jobs(qp, job);
+		qp->stats.enqueued_count += handle_completed_jobs(qp, job);
 
 	return i;
 }
@@ -568,7 +572,7 @@ aesni_mb_pmd_dequeue_burst(void *queue_pair,
 
 	nb_dequeued = rte_ring_dequeue_burst(qp->processed_pkts,
 			(void **)bufs, nb_bufs);
-	qp->qp_stats.dequeued_count += nb_dequeued;
+	qp->stats.dequeued_count += nb_dequeued;
 
 	return nb_dequeued;
 }
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +6 -6
index e43b898..76a85ff 100644
@@ -76,11 +76,11 @@ aesni_mb_pmd_stats_get(struct rte_cryptodev *dev,
 	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
 		struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];
 
-		stats->enqueued_count += qp->qp_stats.enqueued_count;
-		stats->dequeued_count += qp->qp_stats.dequeued_count;
+		stats->enqueued_count += qp->stats.enqueued_count;
+		stats->dequeued_count += qp->stats.dequeued_count;
 
-		stats->enqueue_err_count += qp->qp_stats.enqueue_err_count;
-		stats->dequeue_err_count += qp->qp_stats.dequeue_err_count;
+		stats->enqueue_err_count += qp->stats.enqueue_err_count;
+		stats->dequeue_err_count += qp->stats.dequeue_err_count;
 	}
 }
 
@@ -93,7 +93,7 @@ aesni_mb_pmd_stats_reset(struct rte_cryptodev *dev)
 	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
 		struct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];
 
-		memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+		memset(&qp->stats, 0, sizeof(qp->stats));
 	}
 }
 
@@ -196,7 +196,7 @@ aesni_mb_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 
 	qp->sess_mp = dev->data->session_pool;
 
-	memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+	memset(&qp->stats, 0, sizeof(qp->stats));
 
 	/* Initialise multi-buffer manager */
 	(*qp->ops->job.init_mgr)(&qp->mb_mgr);
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +1 -1
index 2f98609..304c85c 100644
@@ -150,7 +150,7 @@ struct aesni_mb_qp {
 	/**< Ring for placing process packets */
 	struct rte_mempool *sess_mp;
 	/**< Session Mempool */
-	struct rte_cryptodev_stats qp_stats;
+	struct rte_cryptodev_stats stats;
 	/**< Queue pair statistics */
 } __rte_cache_aligned;
 
lib/librte_cryptodev/rte_cryptodev.h +1 -34
index 892375d..0ccd1b8 100644
@@ -130,17 +130,6 @@ struct rte_cryptodev_qp_conf {
 typedef void (*rte_cryptodev_cb_fn)(uint8_t dev_id,
 		enum rte_cryptodev_event_type event, void *cb_arg);
 
-#ifdef RTE_CRYPTODEV_PERF
-/**
- * Crypto Device performance counter statistics structure. This structure is
- * used for RDTSC counters for measuring crypto operations.
- */
-struct rte_cryptodev_perf_stats {
-	uint64_t t_accumlated;	/**< Accumulated time processing operation */
-	uint64_t t_min;		/**< Max time */
-	uint64_t t_max;		/**< Min time */
-};
-#endif
 
 /** Crypto Device statistics */
 struct rte_cryptodev_stats {
@@ -153,29 +142,8 @@ struct rte_cryptodev_stats {
 	/**< Total error count on operations enqueued */
 	uint64_t dequeue_err_count;
 	/**< Total error count on operations dequeued */
+};
 
-#ifdef RTE_CRYPTODEV_DETAILED_STATS
-	struct {
-		uint64_t encrypt_ops;	/**< Count of encrypt operations */
-		uint64_t encrypt_bytes;	/**< Number of bytes encrypted */
-
-		uint64_t decrypt_ops;	/**< Count of decrypt operations */
-		uint64_t decrypt_bytes;	/**< Number of bytes decrypted */
-	} cipher; /**< Cipher operations stats */
-
-	struct {
-		uint64_t generate_ops;	/**< Count of generate operations */
-		uint64_t bytes_hashed;	/**< Number of bytes hashed */
-
-		uint64_t verify_ops;	/**< Count of verify operations */
-		uint64_t bytes_verified;/**< Number of bytes verified */
-	} hash;	 /**< Hash operations stats */
-#endif
-
-#ifdef RTE_CRYPTODEV_PERF
-	struct rte_cryptodev_perf_stats op_perf; /**< Operations stats */
-#endif
-} __rte_cache_aligned;
 
 /**
  * Create a virtual crypto device
@@ -632,7 +600,6 @@ extern struct rte_cryptodev_session *
 rte_cryptodev_session_create(uint8_t dev_id,
 		struct rte_crypto_xform *xform);
 
-
 /**
  * Free the memory associated with a previously allocated session.
  *
lib/librte_cryptodev/rte_cryptodev_pmd.h +2 -8
index 8270afa..a16d109 100644
@@ -56,11 +56,6 @@ extern "C" {
 #include "rte_crypto.h"
 #include "rte_cryptodev.h"
 
-struct rte_cryptodev_stats;
-struct rte_cryptodev_info;
-struct rte_cryptodev_qp_conf;
-
-enum rte_cryptodev_event_type;
 
 #ifdef RTE_LIBRTE_CRYPTODEV_DEBUG
 #define RTE_PMD_DEBUG_TRACE(...) \
@@ -80,7 +75,6 @@ struct rte_cryptodev_session {
 };
 
 struct rte_cryptodev_driver;
-struct rte_cryptodev;
 
 /**
  * Initialisation function of a crypto driver invoked for each matching
@@ -427,9 +421,9 @@ struct rte_cryptodev_ops {
 	cryptodev_info_get_t dev_infos_get;	/**< Get device info. */
 
 	cryptodev_stats_get_t stats_get;
-	/**< Get generic device statistics. */
+	/**< Get device statistics. */
 	cryptodev_stats_reset_t stats_reset;
-	/**< Reset generic device statistics. */
+	/**< Reset device statistics. */
 
 	cryptodev_queue_pair_setup_t queue_pair_setup;
 	/**< Set up a device queue pair. */
Signature · 1 line
2.1.0
#43 lore raw

PATCH v8 2/5 cryptodev: refactor to partition common from symmetric-specific code

In reply to Fiona Trahe

This patch splits symmetric specific definitions and
functions away from the common crypto APIs to facilitate the future extension and expansion of the cryptodev framework, in order to allow asymmetric crypto operations to be introduced at a later date, as well as to clean the logical structure of the public includes. The patch also introduces the _sym prefix to symmetric specific structure and functions to improve clarity in the API.

---
 app/test/test_cryptodev.c                          | 161 +++---
 app/test/test_cryptodev_perf.c                     |  42 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         |  44 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |   6 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   4 +-
 drivers/crypto/qat/qat_crypto.c                    |  51 +-
 drivers/crypto/qat/qat_crypto.h                    |  10 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   8 +-
 examples/l2fwd-crypto/main.c                       |  31 +-
 lib/librte_cryptodev/Makefile                      |   1 +
 lib/librte_cryptodev/rte_crypto.h                  | 547 +------------------
 lib/librte_cryptodev/rte_crypto_sym.h              | 598 +++++++++++++++++++++
 lib/librte_cryptodev/rte_cryptodev.c               |  39 +-
 lib/librte_cryptodev/rte_cryptodev.h               |  46 +-
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  22 +-
 lib/librte_cryptodev/rte_cryptodev_version.map     |   6 +-
 lib/librte_mbuf_offload/rte_mbuf_offload.h         |  22 +-
 17 files changed, 867 insertions(+), 771 deletions(-)
 create mode 100644 lib/librte_cryptodev/rte_crypto_sym.h
app/test/test_cryptodev.c +85 -76
index 1a0f204..5ced183 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -57,13 +57,13 @@ struct crypto_testsuite_params {
 };
 
 struct crypto_unittest_params {
-	struct rte_crypto_xform cipher_xform;
-	struct rte_crypto_xform auth_xform;
+	struct rte_crypto_sym_xform cipher_xform;
+	struct rte_crypto_sym_xform auth_xform;
 
-	struct rte_cryptodev_session *sess;
+	struct rte_cryptodev_sym_session *sess;
 
 	struct rte_mbuf_offload *ol;
-	struct rte_crypto_op *op;
+	struct rte_crypto_sym_op *op;
 
 	struct rte_mbuf *obuf, *ibuf;
 
@@ -78,7 +78,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 		struct crypto_unittest_params *ut_params);
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_param);
 
@@ -166,7 +166,7 @@ testsuite_setup(void)
 			"MBUF_OFFLOAD_POOL",
 			NUM_MBUFS, MBUF_CACHE_SIZE,
 			DEFAULT_NUM_XFORMS *
-			sizeof(struct rte_crypto_xform),
+			sizeof(struct rte_crypto_sym_xform),
 			rte_socket_id());
 	if (ts_params->mbuf_ol_pool == NULL) {
 		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
@@ -221,7 +221,7 @@ testsuite_setup(void)
 
 		ts_params->conf.nb_queue_pairs = info.max_nb_queue_pairs;
 		ts_params->conf.socket_id = SOCKET_ID_ANY;
-		ts_params->conf.session_mp.nb_objs = info.max_nb_sessions;
+		ts_params->conf.session_mp.nb_objs = info.sym.max_nb_sessions;
 
 		TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id,
 				&ts_params->conf),
@@ -276,7 +276,7 @@ ut_setup(void)
 	ts_params->conf.nb_queue_pairs = DEFAULT_NUM_QPS_PER_QAT_DEVICE;
 	ts_params->conf.socket_id = SOCKET_ID_ANY;
 	ts_params->conf.session_mp.nb_objs =
-			(gbl_cryptodev_type == RTE_CRYPTODEV_QAT_PMD) ?
+			(gbl_cryptodev_type == RTE_CRYPTODEV_QAT_SYM_PMD) ?
 					DEFAULT_NUM_OPS_INFLIGHT :
 					DEFAULT_NUM_OPS_INFLIGHT;
 
@@ -320,7 +320,7 @@ ut_teardown(void)
 
 	/* free crypto session structure */
 	if (ut_params->sess) {
-		rte_cryptodev_session_free(ts_params->valid_devs[0],
+		rte_cryptodev_sym_session_free(ts_params->valid_devs[0],
 				ut_params->sess);
 		ut_params->sess = NULL;
 	}
@@ -465,7 +465,7 @@ test_queue_pair_descriptor_setup(void)
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
-	ts_params->conf.session_mp.nb_objs = dev_info.max_nb_sessions;
+	ts_params->conf.session_mp.nb_objs = dev_info.sym.max_nb_sessions;
 
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
 			&ts_params->conf), "Failed to configure cryptodev %u",
@@ -768,7 +768,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -777,7 +777,8 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
+
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -787,21 +788,21 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;
 
 	/* Create crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(
+	ut_params->sess = rte_cryptodev_sym_session_create(
 			ts_params->valid_devs[0],
 			&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
 	ut_params->op = &ut_params->ol->op.crypto;
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -864,18 +865,18 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
 	ut_params->op = &ut_params->ol->op.crypto;
 
-	TEST_ASSERT_NOT_NULL(rte_pktmbuf_offload_alloc_crypto_xforms(
+	TEST_ASSERT_NOT_NULL(rte_pktmbuf_offload_alloc_crypto_sym_xforms(
 			ut_params->ol, 2),
 			"failed to allocate space for crypto transforms");
 
 	/* Set crypto operation data parameters */
-	ut_params->op->xform->type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->op->xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 
 	/* cipher parameters */
 	ut_params->op->xform->cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
@@ -884,7 +885,7 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)
 	ut_params->op->xform->cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* hash parameters */
-	ut_params->op->xform->next->type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->op->xform->next->type = RTE_CRYPTO_SYM_XFORM_AUTH;
 
 	ut_params->op->xform->next->auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
 	ut_params->op->xform->next->auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
@@ -960,7 +961,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_SHA1);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -969,7 +970,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -979,13 +980,14 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA1;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -993,7 +995,7 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1068,7 +1070,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1077,7 +1079,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1087,13 +1089,14 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1101,7 +1104,7 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1170,7 +1173,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_SHA256);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1179,7 +1182,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1189,13 +1192,14 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1203,7 +1207,7 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1283,7 +1287,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1292,7 +1296,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1302,15 +1306,16 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA512;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1318,7 +1323,7 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1371,7 +1376,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 		struct crypto_unittest_params *ut_params);
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_params);
 
@@ -1386,8 +1391,9 @@ test_AES_CBC_HMAC_SHA512_decrypt_digest_verify(void)
 			"Failed to create session params");
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	return test_AES_CBC_HMAC_SHA512_decrypt_perform(ut_params->sess,
@@ -1400,7 +1406,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 {
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1409,7 +1415,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1423,7 +1429,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
 
 
 static int
-test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
+test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 		struct crypto_unittest_params *ut_params,
 		struct crypto_testsuite_params *ts_params)
 {
@@ -1443,7 +1449,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1451,7 +1457,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_session *sess,
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1521,7 +1527,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1530,7 +1536,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = NULL;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
@@ -1540,13 +1546,14 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->cipher_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1554,7 +1561,7 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->iv.data = (uint8_t *)
 		rte_pktmbuf_prepend(ut_params->ibuf,
@@ -1614,7 +1621,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 			DIGEST_BYTE_LENGTH_AES_XCBC);
 
 	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
 
 	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -1623,7 +1630,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 	ut_params->cipher_xform.cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	ut_params->auth_xform.next = &ut_params->cipher_xform;
 
 	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
@@ -1633,13 +1640,14 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
 
 	/* Create Crypto session*/
-	ut_params->sess = rte_cryptodev_session_create(ts_params->valid_devs[0],
-			&ut_params->auth_xform);
+	ut_params->sess =
+		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
+						&ut_params->auth_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1647,7 +1655,7 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
@@ -1751,7 +1759,7 @@ test_multi_session(void)
 	struct crypto_unittest_params *ut_params = &unittest_params;
 
 	struct rte_cryptodev_info dev_info;
-	struct rte_cryptodev_session **sessions;
+	struct rte_cryptodev_sym_session **sessions;
 
 	uint16_t i;
 
@@ -1760,12 +1768,13 @@ test_multi_session(void)
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
-	sessions = rte_malloc(NULL, (sizeof(struct rte_cryptodev_session *) *
-			dev_info.max_nb_sessions) + 1, 0);
+	sessions = rte_malloc(NULL,
+			(sizeof(struct rte_cryptodev_sym_session *) *
+			dev_info.sym.max_nb_sessions) + 1, 0);
 
 	/* Create multiple crypto sessions*/
-	for (i = 0; i < dev_info.max_nb_sessions; i++) {
-		sessions[i] = rte_cryptodev_session_create(
+	for (i = 0; i < dev_info.sym.max_nb_sessions; i++) {
+		sessions[i] = rte_cryptodev_sym_session_create(
 				ts_params->valid_devs[0],
 			&ut_params->auth_xform);
 		TEST_ASSERT_NOT_NULL(sessions[i],
@@ -1780,13 +1789,13 @@ test_multi_session(void)
 	}
 
 	/* Next session create should fail */
-	sessions[i] = rte_cryptodev_session_create(ts_params->valid_devs[0],
+	sessions[i] = rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
 			&ut_params->auth_xform);
 	TEST_ASSERT_NULL(sessions[i],
 			"Session creation succeeded unexpectedly!");
 
-	for (i = 0; i < dev_info.max_nb_sessions; i++)
-		rte_cryptodev_session_free(ts_params->valid_devs[0],
+	for (i = 0; i < dev_info.sym.max_nb_sessions; i++)
+		rte_cryptodev_sym_session_free(ts_params->valid_devs[0],
 				sessions[i]);
 
 	rte_free(sessions);
@@ -1805,7 +1814,7 @@ test_not_in_place_crypto(void)
 
 	/* Create multiple crypto sessions*/
 
-	ut_params->sess = rte_cryptodev_session_create(
+	ut_params->sess = rte_cryptodev_sym_session_create(
 			ts_params->valid_devs[0], &ut_params->auth_xform);
 
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
@@ -1827,7 +1836,7 @@ test_not_in_place_crypto(void)
 
 	/* Generate Crypto op data structure */
 	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO);
+				RTE_PKTMBUF_OL_CRYPTO_SYM);
 	TEST_ASSERT_NOT_NULL(ut_params->ol,
 			"Failed to allocate pktmbuf offload");
 
@@ -1835,7 +1844,7 @@ test_not_in_place_crypto(void)
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
 
 	ut_params->op->digest.data = ut_params->digest;
 	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
@@ -1961,7 +1970,7 @@ static struct unit_test_suite cryptodev_aesni_mb_testsuite  = {
 static int
 test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	gbl_cryptodev_type = RTE_CRYPTODEV_QAT_PMD;
+	gbl_cryptodev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	return unit_test_suite_runner(&cryptodev_qat_testsuite);
 }
 static struct test_command cryptodev_qat_cmd = {
app/test/test_cryptodev_perf.c +21 -21

134 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +23 -21

134 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +3 -3
index 76a85ff..d56de12 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -108,7 +108,7 @@ aesni_mb_pmd_info_get(struct rte_cryptodev *dev,
 	if (dev_info != NULL) {
 		dev_info->dev_type = dev->dev_type;
 		dev_info->max_nb_queue_pairs = internals->max_nb_queue_pairs;
-		dev_info->max_nb_sessions = internals->max_nb_sessions;
+		dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
 	}
 }
 
@@ -243,7 +243,7 @@ aesni_mb_pmd_session_get_size(struct rte_cryptodev *dev __rte_unused)
 /** Configure a aesni multi-buffer session from a crypto xform chain */
 static void *
 aesni_mb_pmd_session_configure(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform,	void *sess)
+		struct rte_crypto_sym_xform *xform,	void *sess)
 {
 	struct aesni_mb_private *internals = dev->data->dev_private;
 
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +2 -2
index 304c85c..0aed177 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -218,7 +218,7 @@ struct aesni_mb_session {
 extern int
 aesni_mb_set_session_parameters(const struct aesni_mb_ops *mb_ops,
 		struct aesni_mb_session *sess,
-		const struct rte_crypto_xform *xform);
+		const struct rte_crypto_sym_xform *xform);
 
 
 /** device specific operations function pointer structure */
drivers/crypto/qat/qat_crypto.c +27 -24

149 lines not on this page · raw message

drivers/crypto/qat/qat_crypto.h +6 -4
index d680364..e9f71fe 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -109,16 +109,18 @@ qat_crypto_sym_session_init(struct rte_mempool *mempool, void *priv_sess);
 
 extern void *
 qat_crypto_sym_configure_session(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform, void *session_private);
+		struct rte_crypto_sym_xform *xform, void *session_private);
 
 extern void
 qat_crypto_sym_clear_session(struct rte_cryptodev *dev, void *session);
 
 
 uint16_t
-qat_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
+qat_sym_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts);
 
 uint16_t
-qat_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
+qat_sym_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts,
+		uint16_t nb_pkts);
 
 #endif /* _QAT_CRYPTO_H_ */
drivers/crypto/qat/rte_qat_cryptodev.c +4 -4
index e500c1e..85700fc 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -89,11 +89,11 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_
 		cryptodev->pci_dev->addr.devid,
 		cryptodev->pci_dev->addr.function);
 
-	cryptodev->dev_type = RTE_CRYPTODEV_QAT_PMD;
+	cryptodev->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	cryptodev->dev_ops = &crypto_qat_ops;
 
-	cryptodev->enqueue_burst = qat_crypto_pkt_tx_burst;
-	cryptodev->dequeue_burst = qat_crypto_pkt_rx_burst;
+	cryptodev->enqueue_burst = qat_sym_crypto_pkt_tx_burst;
+	cryptodev->dequeue_burst = qat_sym_crypto_pkt_rx_burst;
 
 
 	internals = cryptodev->data->dev_private;
examples/l2fwd-crypto/main.c +14 -17
index a950b74..ee519e7 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -124,13 +124,13 @@ struct l2fwd_crypto_options {
 
 	enum l2fwd_crypto_xform_chain xform_chain;
 
-	struct rte_crypto_xform cipher_xform;
+	struct rte_crypto_sym_xform cipher_xform;
 	uint8_t ckey_data[32];
 
 	struct rte_crypto_key iv_key;
 	uint8_t ivkey_data[16];
 
-	struct rte_crypto_xform auth_xform;
+	struct rte_crypto_sym_xform auth_xform;
 	uint8_t akey_data[128];
 };
 
@@ -141,9 +141,8 @@ struct l2fwd_crypto_params {
 
 	unsigned digest_length;
 	unsigned block_size;
-
 	struct rte_crypto_key iv_key;
-	struct rte_cryptodev_session *session;
+	struct rte_cryptodev_sym_session *session;
 };
 
 /** lcore configuration */
@@ -372,7 +371,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,
 	}
 
 	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_session(&ol->op.crypto, cparams->session);
+	rte_crypto_sym_op_attach_session(&ol->op.crypto, cparams->session);
 
 	/* Append space for digest to end of packet */
 	ol->op.crypto.digest.data = (uint8_t *)rte_pktmbuf_append(m,
@@ -474,11 +473,11 @@ generate_random_key(uint8_t *key, unsigned length)
 		key[i] = rand() % 0xff;
 }
 
-static struct rte_cryptodev_session *
+static struct rte_cryptodev_sym_session *
 initialize_crypto_session(struct l2fwd_crypto_options *options,
 		uint8_t cdev_id)
 {
-	struct rte_crypto_xform *first_xform;
+	struct rte_crypto_sym_xform *first_xform;
 
 	if (options->xform_chain == L2FWD_CRYPTO_CIPHER_HASH) {
 		first_xform = &options->cipher_xform;
@@ -489,7 +488,7 @@ initialize_crypto_session(struct l2fwd_crypto_options *options,
 	}
 
 	/* Setup Cipher Parameters */
-	return rte_cryptodev_session_create(cdev_id, first_xform);
+	return rte_cryptodev_sym_session_create(cdev_id, first_xform);
 }
 
 static void
@@ -610,7 +609,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)
 				m = pkts_burst[j];
 				ol = rte_pktmbuf_offload_alloc(
 						l2fwd_mbuf_ol_pool,
-						RTE_PKTMBUF_OL_CRYPTO);
+						RTE_PKTMBUF_OL_CRYPTO_SYM);
 				/*
 				 * If we can't allocate a offload, then drop
 				 * the rest of the burst and dequeue and
@@ -689,7 +688,7 @@ parse_cryptodev_type(enum rte_cryptodev_type *type, char *optarg)
 		*type = RTE_CRYPTODEV_AESNI_MB_PMD;
 		return 0;
 	} else if (strcmp("QAT", optarg) == 0) {
-		*type = RTE_CRYPTODEV_QAT_PMD;
+		*type = RTE_CRYPTODEV_QAT_SYM_PMD;
 		return 0;
 	}
 
@@ -937,7 +936,7 @@ l2fwd_crypto_default_options(struct l2fwd_crypto_options *options)
 	options->xform_chain = L2FWD_CRYPTO_CIPHER_HASH;
 
 	/* Cipher Data */
-	options->cipher_xform.type = RTE_CRYPTO_XFORM_CIPHER;
+	options->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	options->cipher_xform.next = NULL;
 
 	options->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
@@ -946,12 +945,11 @@ l2fwd_crypto_default_options(struct l2fwd_crypto_options *options)
 	generate_random_key(options->ckey_data, sizeof(options->ckey_data));
 
 	options->cipher_xform.cipher.key.data = options->ckey_data;
-	options->cipher_xform.cipher.key.phys_addr = 0;
 	options->cipher_xform.cipher.key.length = 16;
 
 
 	/* Authentication Data */
-	options->auth_xform.type = RTE_CRYPTO_XFORM_AUTH;
+	options->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
 	options->auth_xform.next = NULL;
 
 	options->auth_xform.auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
@@ -963,7 +961,6 @@ l2fwd_crypto_default_options(struct l2fwd_crypto_options *options)
 	generate_random_key(options->akey_data, sizeof(options->akey_data));
 
 	options->auth_xform.auth.key.data = options->akey_data;
-	options->auth_xform.auth.key.phys_addr = 0;
 	options->auth_xform.auth.key.length = 20;
 }
 
@@ -982,7 +979,7 @@ l2fwd_crypto_options_print(struct l2fwd_crypto_options *options)
 	switch (options->cdev_type) {
 	case RTE_CRYPTODEV_AESNI_MB_PMD:
 		printf("cryptodev type: AES-NI MB PMD\n"); break;
-	case RTE_CRYPTODEV_QAT_PMD:
+	case RTE_CRYPTODEV_QAT_SYM_PMD:
 		printf("cryptodev type: QAT PMD\n"); break;
 	default:
 		break;
@@ -1179,7 +1176,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports)
 	unsigned i, cdev_id, cdev_count, enabled_cdev_count = 0;
 	int retval;
 
-	if (options->cdev_type == RTE_CRYPTODEV_QAT_PMD) {
+	if (options->cdev_type == RTE_CRYPTODEV_QAT_SYM_PMD) {
 		if (rte_cryptodev_count() < nb_ports)
 			return -1;
 	} else if (options->cdev_type == RTE_CRYPTODEV_AESNI_MB_PMD) {
lib/librte_cryptodev/Makefile +1 -0
index 81fa3fc..0d59229 100644
@@ -45,6 +45,7 @@ SRCS-y += rte_cryptodev.c
 
 # export include files
 SYMLINK-y-include += rte_crypto.h
+SYMLINK-y-include += rte_crypto_sym.h
 SYMLINK-y-include += rte_cryptodev.h
 SYMLINK-y-include += rte_cryptodev_pmd.h
 
lib/librte_cryptodev/rte_crypto.h +3 -544

572 lines not on this page · raw message

lib/librte_cryptodev/rte_crypto_sym.h new file +598 -0

598 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.c +22 -17
index 2838852..c7fef6a 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -572,8 +572,8 @@ rte_cryptodev_queue_pair_stop(uint8_t dev_id, uint16_t queue_pair_id)
 }
 
 static int
-rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
-		unsigned obj_cache_size, int socket_id);
+rte_cryptodev_sym_session_pool_create(struct rte_cryptodev *dev,
+		unsigned nb_objs, unsigned obj_cache_size, int socket_id);
 
 int
 rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
@@ -604,8 +604,10 @@ rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config)
 	}
 
 	/* Setup Session mempool for device */
-	return rte_crypto_session_pool_create(dev, config->session_mp.nb_objs,
-			config->session_mp.cache_size, config->socket_id);
+	return rte_cryptodev_sym_session_pool_create(dev,
+			config->session_mp.nb_objs,
+			config->session_mp.cache_size,
+			config->socket_id);
 }
 
 
@@ -911,12 +913,12 @@ rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
 
 
 static void
-rte_crypto_session_init(struct rte_mempool *mp,
+rte_cryptodev_sym_session_init(struct rte_mempool *mp,
 		void *opaque_arg,
 		void *_sess,
 		__rte_unused unsigned i)
 {
-	struct rte_cryptodev_session *sess = _sess;
+	struct rte_cryptodev_sym_session *sess = _sess;
 	struct rte_cryptodev *dev = opaque_arg;
 
 	memset(sess, 0, mp->elt_size);
@@ -930,8 +932,8 @@ rte_crypto_session_init(struct rte_mempool *mp,
 }
 
 static int
-rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
-		unsigned obj_cache_size, int socket_id)
+rte_cryptodev_sym_session_pool_create(struct rte_cryptodev *dev,
+		unsigned nb_objs, unsigned obj_cache_size, int socket_id)
 {
 	char mp_name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	unsigned priv_sess_size;
@@ -951,7 +953,7 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 		return -ENOMEM;
 	}
 
-	unsigned elt_size = sizeof(struct rte_cryptodev_session) +
+	unsigned elt_size = sizeof(struct rte_cryptodev_sym_session) +
 			priv_sess_size;
 
 	dev->data->session_pool = rte_mempool_lookup(mp_name);
@@ -975,7 +977,8 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 				0, /* private data size */
 				NULL, /* obj initialization constructor */
 				NULL, /* obj initialization constructor arg */
-				rte_crypto_session_init, /* obj constructor */
+				rte_cryptodev_sym_session_init,
+				/**< obj constructor*/
 				dev, /* obj constructor arg */
 				socket_id, /* socket id */
 				0); /* flags */
@@ -990,11 +993,12 @@ rte_crypto_session_pool_create(struct rte_cryptodev *dev, unsigned nb_objs,
 	return 0;
 }
 
-struct rte_cryptodev_session *
-rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
+struct rte_cryptodev_sym_session *
+rte_cryptodev_sym_session_create(uint8_t dev_id,
+		struct rte_crypto_sym_xform *xform)
 {
 	struct rte_cryptodev *dev;
-	struct rte_cryptodev_session *sess;
+	struct rte_cryptodev_sym_session *sess;
 	void *_sess;
 
 	if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) {
@@ -1010,7 +1014,7 @@ rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
 		return NULL;
 	}
 
-	sess = (struct rte_cryptodev_session *)_sess;
+	sess = (struct rte_cryptodev_sym_session *)_sess;
 
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->session_configure, NULL);
 	if (dev->dev_ops->session_configure(dev, xform, sess->_private) ==
@@ -1026,8 +1030,9 @@ rte_cryptodev_session_create(uint8_t dev_id, struct rte_crypto_xform *xform)
 	return sess;
 }
 
-struct rte_cryptodev_session *
-rte_cryptodev_session_free(uint8_t dev_id, struct rte_cryptodev_session *sess)
+struct rte_cryptodev_sym_session *
+rte_cryptodev_sym_session_free(uint8_t dev_id,
+		struct rte_cryptodev_sym_session *sess)
 {
 	struct rte_cryptodev *dev;
 
lib/librte_cryptodev/rte_cryptodev.h +33 -13

91 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev_pmd.h +11 -11
index a16d109..7d049ea 100644
@@ -1,6 +1,6 @@
 /*-
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -358,7 +358,7 @@ typedef uint32_t (*cryptodev_queue_pair_count_t)(struct rte_cryptodev *dev);
  * - On success returns a pointer to a rte_mempool
  * - On failure returns a NULL pointer
  */
-typedef int (*cryptodev_create_session_pool_t)(
+typedef int (*cryptodev_sym_create_session_pool_t)(
 		struct rte_cryptodev *dev, unsigned nb_objs,
 		unsigned obj_cache_size, int socket_id);
 
@@ -372,7 +372,7 @@ typedef int (*cryptodev_create_session_pool_t)(
  *  - On success returns the size of the session structure for device
  *  - On failure returns 0
  */
-typedef unsigned (*cryptodev_get_session_private_size_t)(
+typedef unsigned (*cryptodev_sym_get_session_private_size_t)(
 		struct rte_cryptodev *dev);
 
 /**
@@ -386,7 +386,7 @@ typedef unsigned (*cryptodev_get_session_private_size_t)(
  *  - Returns private session structure on success.
  *  - Returns NULL on failure.
  */
-typedef void (*cryptodev_initialize_session_t)(struct rte_mempool *mempool,
+typedef void (*cryptodev_sym_initialize_session_t)(struct rte_mempool *mempool,
 		void *session_private);
 
 /**
@@ -400,14 +400,14 @@ typedef void (*cryptodev_initialize_session_t)(struct rte_mempool *mempool,
  *  - Returns private session structure on success.
  *  - Returns NULL on failure.
  */
-typedef void * (*cryptodev_configure_session_t)(struct rte_cryptodev *dev,
-		struct rte_crypto_xform *xform, void *session_private);
+typedef void * (*cryptodev_sym_configure_session_t)(struct rte_cryptodev *dev,
+		struct rte_crypto_sym_xform *xform, void *session_private);
 
 /**
  * Free Crypto session.
  * @param	session		Cryptodev session structure to free
  */
-typedef void (*cryptodev_free_session_t)(struct rte_cryptodev *dev,
+typedef void (*cryptodev_sym_free_session_t)(struct rte_cryptodev *dev,
 		void *session_private);
 
 
@@ -436,13 +436,13 @@ struct rte_cryptodev_ops {
 	cryptodev_queue_pair_count_t queue_pair_count;
 	/**< Get count of the queue pairs. */
 
-	cryptodev_get_session_private_size_t session_get_size;
+	cryptodev_sym_get_session_private_size_t session_get_size;
 	/**< Return private session. */
-	cryptodev_initialize_session_t session_initialize;
+	cryptodev_sym_initialize_session_t session_initialize;
 	/**< Initialization function for private session data */
-	cryptodev_configure_session_t session_configure;
+	cryptodev_sym_configure_session_t session_configure;
 	/**< Configure a Crypto session. */
-	cryptodev_free_session_t session_clear;
+	cryptodev_sym_free_session_t session_clear;
 	/**< Clear a Crypto sessions private data. */
 };
 
lib/librte_cryptodev/rte_cryptodev_version.map +3 -3
index ff8e93d..a46af6f 100644
@@ -16,8 +16,8 @@ DPDK_2.2 {
 	rte_cryptodev_pmd_driver_register;
 	rte_cryptodev_pmd_release_device;
 	rte_cryptodev_pmd_virtual_dev_init;
-	rte_cryptodev_session_create;
-	rte_cryptodev_session_free;
+	rte_cryptodev_sym_session_create;
+	rte_cryptodev_sym_session_free;
 	rte_cryptodev_socket_id;
 	rte_cryptodev_start;
 	rte_cryptodev_stats_get;
@@ -29,4 +29,4 @@ DPDK_2.2 {
 	rte_cryptodev_queue_pair_stop;
 
 	local: *;
-};
\ No newline at end of file
+};
lib/librte_mbuf_offload/rte_mbuf_offload.h +11 -11
index 77993b6..5ce6058 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -67,7 +67,7 @@ extern "C" {
 enum rte_mbuf_ol_op_type {
 	RTE_PKTMBUF_OL_NOT_SPECIFIED = 0,
 	/**< Off-load not specified */
-	RTE_PKTMBUF_OL_CRYPTO
+	RTE_PKTMBUF_OL_CRYPTO_SYM
 	/**< Crypto offload operation */
 };
 
@@ -84,7 +84,7 @@ struct rte_mbuf_offload {
 
 	enum rte_mbuf_ol_op_type type;	/**< offload type */
 	union {
-		struct rte_crypto_op crypto;	/**< Crypto operation */
+		struct rte_crypto_sym_op crypto;	/**< Crypto operation */
 	} op;
 };
 
@@ -194,8 +194,8 @@ __rte_pktmbuf_offload_reset(struct rte_mbuf_offload *ol,
 	ol->type = type;
 
 	switch (type) {
-	case RTE_PKTMBUF_OL_CRYPTO:
-		__rte_crypto_op_reset(&ol->op.crypto); break;
+	case RTE_PKTMBUF_OL_CRYPTO_SYM:
+		__rte_crypto_sym_op_reset(&ol->op.crypto); break;
 	default:
 		break;
 	}
@@ -278,24 +278,24 @@ __rte_pktmbuf_offload_check_priv_data_size(struct rte_mbuf_offload *ol,
  * - On success returns pointer to first crypto xform in crypto operations chain
  * - On failure returns NULL
  */
-static inline struct rte_crypto_xform *
-rte_pktmbuf_offload_alloc_crypto_xforms(struct rte_mbuf_offload *ol,
+static inline struct rte_crypto_sym_xform *
+rte_pktmbuf_offload_alloc_crypto_sym_xforms(struct rte_mbuf_offload *ol,
 		unsigned nb_xforms)
 {
-	struct rte_crypto_xform *xform;
+	struct rte_crypto_sym_xform *xform;
 	void *priv_data;
 	uint16_t size;
 
-	size = sizeof(struct rte_crypto_xform) * nb_xforms;
+	size = sizeof(struct rte_crypto_sym_xform) * nb_xforms;
 	priv_data = __rte_pktmbuf_offload_check_priv_data_size(ol, size);
 
 	if (priv_data == NULL)
 		return NULL;
 
-	ol->op.crypto.xform = xform = (struct rte_crypto_xform *)priv_data;
+	ol->op.crypto.xform = xform = (struct rte_crypto_sym_xform *)priv_data;
 
 	do {
-		xform->type = RTE_CRYPTO_XFORM_NOT_SPECIFIED;
+		xform->type = RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED;
 		xform = xform->next = --nb_xforms > 0 ? xform + 1 : NULL;
 	} while (xform);
 
Signature · 1 line
2.1.0
#44 lore raw

PATCH v8 3/5 cryptodev: remove unused phys_addr field from key

In reply to Fiona Trahe

Remove unused phys_addr field from key in crypto_xform, simplifiy struct and fix knock-on impacts in l2fwd-crypto app

---
 examples/l2fwd-crypto/main.c          | 42 ++++++++++++++++++++++++++---------
 lib/librte_cryptodev/rte_crypto_sym.h | 16 ++++++-------
 2 files changed, 39 insertions(+), 19 deletions(-)
examples/l2fwd-crypto/main.c +31 -11
index ee519e7..9b6b7ef 100644
@@ -112,6 +112,12 @@ enum l2fwd_crypto_xform_chain {
 	L2FWD_CRYPTO_HASH_CIPHER
 };
 
+struct l2fwd_key {
+	uint8_t *data;
+	uint32_t length;
+	phys_addr_t phys_addr;
+};
+
 /** l2fwd crypto application command line options */
 struct l2fwd_crypto_options {
 	unsigned portmask;
@@ -127,7 +133,7 @@ struct l2fwd_crypto_options {
 	struct rte_crypto_sym_xform cipher_xform;
 	uint8_t ckey_data[32];
 
-	struct rte_crypto_key iv_key;
+	struct l2fwd_key iv_key;
 	uint8_t ivkey_data[16];
 
 	struct rte_crypto_sym_xform auth_xform;
@@ -141,7 +147,7 @@ struct l2fwd_crypto_params {
 
 	unsigned digest_length;
 	unsigned block_size;
-	struct rte_crypto_key iv_key;
+	struct l2fwd_key iv_key;
 	struct rte_cryptodev_sym_session *session;
 };
 
@@ -744,7 +750,7 @@ parse_cipher_op(enum rte_crypto_cipher_operation *op, char *optarg)
 
 /** Parse crypto key command line argument */
 static int
-parse_key(struct rte_crypto_key *key __rte_unused,
+parse_key(struct l2fwd_key *key __rte_unused,
 		unsigned length __rte_unused, char *arg __rte_unused)
 {
 	printf("Currently an unsupported argument!\n");
@@ -820,11 +826,18 @@ l2fwd_crypto_parse_args_long_options(struct l2fwd_crypto_options *options,
 		return parse_cipher_op(&options->cipher_xform.cipher.op,
 				optarg);
 
-	else if (strcmp(lgopts[option_index].name, "cipher_key") == 0)
-		return parse_key(&options->cipher_xform.cipher.key,
-				sizeof(options->ckey_data), optarg);
+	else if (strcmp(lgopts[option_index].name, "cipher_key") == 0) {
+		struct l2fwd_key key = { 0 };
+		int retval = 0;
+
+		retval = parse_key(&key, sizeof(options->ckey_data), optarg);
+
+		options->cipher_xform.cipher.key.data = key.data;
+		options->cipher_xform.cipher.key.length = key.length;
 
-	else if (strcmp(lgopts[option_index].name, "iv") == 0)
+		return retval;
+
+	} else if (strcmp(lgopts[option_index].name, "iv") == 0)
 		return parse_key(&options->iv_key, sizeof(options->ivkey_data),
 				optarg);
 
@@ -837,11 +850,18 @@ l2fwd_crypto_parse_args_long_options(struct l2fwd_crypto_options *options,
 		return parse_auth_op(&options->auth_xform.auth.op,
 				optarg);
 
-	else if (strcmp(lgopts[option_index].name, "auth_key") == 0)
-		return parse_key(&options->auth_xform.auth.key,
-				sizeof(options->akey_data), optarg);
+	else if (strcmp(lgopts[option_index].name, "auth_key") == 0) {
+		struct l2fwd_key key = { 0 };
+		int retval = 0;
+
+		retval = parse_key(&key, sizeof(options->akey_data), optarg);
+
+		options->auth_xform.auth.key.data = key.data;
+		options->auth_xform.auth.key.length = key.length;
+
+		return retval;
 
-	else if (strcmp(lgopts[option_index].name, "sessionless") == 0) {
+	} else if (strcmp(lgopts[option_index].name, "sessionless") == 0) {
 		options->sessionless = 1;
 		return 0;
 	}
lib/librte_cryptodev/rte_crypto_sym.h +8 -8
index de6c701..270510e 100644
@@ -111,12 +111,6 @@ enum rte_crypto_cipher_operation {
 	/**< Decrypt cipher operation */
 };
 
-/** Crypto key structure */
-struct rte_crypto_key {
-	uint8_t *data;  /**< pointer to key data */
-	phys_addr_t phys_addr;
-	size_t length;  /**< key length in bytes */
-};
 
 /**
  * Symmetric Cipher Setup Data.
@@ -133,7 +127,10 @@ struct rte_crypto_cipher_xform {
 	enum rte_crypto_cipher_algorithm algo;
 	/**< Cipher algorithm */
 
-	struct rte_crypto_key key;
+	struct {
+		uint8_t *data;  /**< pointer to key data */
+		size_t length;  /**< key length in bytes */
+	} key;
 	/**< Cipher key
 	 *
 	 * For the RTE_CRYPTO_CIPHER_AES_F8 mode of operation, key.data will
@@ -257,7 +254,10 @@ struct rte_crypto_auth_xform {
 	enum rte_crypto_auth_algorithm algo;
 	/**< Authentication algorithm selection */
 
-	struct rte_crypto_key key;
+	struct {
+		uint8_t *data;  /**< pointer to key data */
+		size_t length;  /**< key length in bytes */
+	} key;
 	/**< Authentication key data.
 	 * The authentication key length MUST be less than or equal to the
 	 * block size of the algorithm. It is the callers responsibility to
Signature · 1 line
2.1.0
#45 lore raw

PATCH v8 4/5 cryptodev: change burst API to be crypto op oriented

In reply to Fiona Trahe

From: Declan Doherty <[email protected]>

This patch modifies the crypto burst enqueue/dequeue APIs to operate on bursts rte_crypto_op's rather than the current implementation which operates on rte_mbuf bursts, this simplifies the burst processing in the crypto PMDs and the use of crypto operations in general, including new functions for managing rte_crypto_op pools.

These changes continues the separation of the symmetric operation parameters from the more general operation parameters, which will simplify the integration of asymmetric crypto operations in the future.

PMDs, unit tests and sample applications are also modified to work with the modified and new API.

---
 app/test/test_cryptodev.c                          | 640 +++++++++++----------
 app/test/test_cryptodev_perf.c                     | 221 ++++---
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         | 133 +++--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  12 +-
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |   4 +-
 drivers/crypto/qat/qat_crypto.c                    | 132 +++--
 drivers/crypto/qat/qat_crypto.h                    |  12 +-
 drivers/crypto/qat/rte_qat_cryptodev.c             |   4 +-
 examples/l2fwd-crypto/main.c                       | 164 +++---
 lib/librte_cryptodev/rte_crypto.h                  | 352 +++++++++++-
 lib/librte_cryptodev/rte_crypto_sym.h              | 374 ++++++------
 lib/librte_cryptodev/rte_cryptodev.c               |  76 +++
 lib/librte_cryptodev/rte_cryptodev.h               | 108 ++--
 lib/librte_cryptodev/rte_cryptodev_version.map     |   5 +-
 14 files changed, 1398 insertions(+), 839 deletions(-)
app/test/test_cryptodev.c +351 -289
index 5ced183..55367df 100644
@@ -48,7 +48,7 @@ static enum rte_cryptodev_type gbl_cryptodev_type;
 
 struct crypto_testsuite_params {
 	struct rte_mempool *mbuf_pool;
-	struct rte_mempool *mbuf_ol_pool;
+	struct rte_mempool *op_mpool;
 	struct rte_cryptodev_config conf;
 	struct rte_cryptodev_qp_conf qp_conf;
 
@@ -62,8 +62,7 @@ struct crypto_unittest_params {
 
 	struct rte_cryptodev_sym_session *sess;
 
-	struct rte_mbuf_offload *ol;
-	struct rte_crypto_sym_op *op;
+	struct rte_crypto_op *op;
 
 	struct rte_mbuf *obuf, *ibuf;
 
@@ -112,19 +111,21 @@ hexdump_mbuf_data(FILE *f, const char *title, struct rte_mbuf *m)
 }
 #endif
 
-static struct rte_mbuf *
-process_crypto_request(uint8_t dev_id, struct rte_mbuf *ibuf)
+static struct rte_crypto_op *
+process_crypto_request(uint8_t dev_id, struct rte_crypto_op *op)
 {
-	struct rte_mbuf *obuf = NULL;
 #if HEX_DUMP
 	hexdump_mbuf_data(stdout, "Enqueued Packet", ibuf);
 #endif
 
-	if (rte_cryptodev_enqueue_burst(dev_id, 0, &ibuf, 1) != 1) {
+	if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) != 1) {
 		printf("Error sending packet for encryption");
 		return NULL;
 	}
-	while (rte_cryptodev_dequeue_burst(dev_id, 0, &obuf, 1) == 0)
+
+	op = NULL;
+
+	while (rte_cryptodev_dequeue_burst(dev_id, 0, &op, 1) == 0)
 		rte_pause();
 
 #if HEX_DUMP
@@ -132,7 +133,7 @@ process_crypto_request(uint8_t dev_id, struct rte_mbuf *ibuf)
 		hexdump_mbuf_data(stdout, "Dequeued Packet", obuf);
 #endif
 
-	return obuf;
+	return op;
 }
 
 static struct crypto_testsuite_params testsuite_params = { NULL };
@@ -162,13 +163,14 @@ testsuite_setup(void)
 		}
 	}
 
-	ts_params->mbuf_ol_pool = rte_pktmbuf_offload_pool_create(
-			"MBUF_OFFLOAD_POOL",
+	ts_params->op_mpool = rte_crypto_op_pool_create(
+			"MBUF_CRYPTO_SYM_OP_POOL",
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC,
 			NUM_MBUFS, MBUF_CACHE_SIZE,
 			DEFAULT_NUM_XFORMS *
 			sizeof(struct rte_crypto_sym_xform),
 			rte_socket_id());
-	if (ts_params->mbuf_ol_pool == NULL) {
+	if (ts_params->op_mpool == NULL) {
 		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
 		return TEST_FAILED;
 	}
@@ -253,10 +255,9 @@ testsuite_teardown(void)
 		rte_mempool_count(ts_params->mbuf_pool));
 	}
 
-
-	if (ts_params->mbuf_ol_pool != NULL) {
+	if (ts_params->op_mpool != NULL) {
 		RTE_LOG(DEBUG, USER1, "CRYPTO_OP_POOL count %u\n",
-		rte_mempool_count(ts_params->mbuf_ol_pool));
+		rte_mempool_count(ts_params->op_mpool));
 	}
 
 }
@@ -326,8 +327,8 @@ ut_teardown(void)
 	}
 
 	/* free crypto operation structure */
-	if (ut_params->ol)
-		rte_pktmbuf_offload_free(ut_params->ol);
+	if (ut_params->op)
+		rte_crypto_op_free(ut_params->op);
 
 	/*
 	 * free mbuf - both obuf and ibuf are usually the same,
@@ -793,53 +794,59 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
 			&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
-	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	/* Generate crypto op data structure */
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
 
-	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
+
+	/* Set crypto operation authentication parameters */
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA1;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA1;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
-			CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	/* Set crypto operation cipher parameters */
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
+			CIPHER_IV_LENGTH_AES_CBC);
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
 
 	/* Validate obuf */
-	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
-			CIPHER_IV_LENGTH_AES_CBC,
+	uint8_t *ciphertext = rte_pktmbuf_mtod_offset(ut_params->op->sym->m_src,
+			uint8_t *, CIPHER_IV_LENGTH_AES_CBC);
+
+	TEST_ASSERT_BUFFERS_ARE_EQUAL(ciphertext,
 			catch_22_quote_2_512_bytes_AES_CBC_ciphertext,
 			QUOTE_512_BYTES,
 			"ciphertext data not as expected");
 
-	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
-			CIPHER_IV_LENGTH_AES_CBC + QUOTE_512_BYTES,
+	uint8_t *digest = ciphertext + QUOTE_512_BYTES;
+
+	TEST_ASSERT_BUFFERS_ARE_EQUAL(digest,
 			catch_22_quote_2_512_bytes_AES_CBC_HMAC_SHA1_digest,
 			gbl_cryptodev_type == RTE_CRYPTODEV_AESNI_MB_PMD ?
 					TRUNCATED_DIGEST_BYTE_LENGTH_SHA1 :
@@ -864,60 +871,66 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest_sessionless(void)
 	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
-
-	TEST_ASSERT_NOT_NULL(rte_pktmbuf_offload_alloc_crypto_sym_xforms(
-			ut_params->ol, 2),
+	TEST_ASSERT_NOT_NULL(rte_crypto_op_sym_xforms_alloc(ut_params->op, 2),
 			"failed to allocate space for crypto transforms");
 
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
+
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
+
 	/* Set crypto operation data parameters */
-	ut_params->op->xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+	sym_op->xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 
 	/* cipher parameters */
-	ut_params->op->xform->cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
-	ut_params->op->xform->cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
-	ut_params->op->xform->cipher.key.data = aes_cbc_key;
-	ut_params->op->xform->cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
+	sym_op->xform->cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
+	sym_op->xform->cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
+	sym_op->xform->cipher.key.data = aes_cbc_key;
+	sym_op->xform->cipher.key.length = CIPHER_KEY_LENGTH_AES_CBC;
 
 	/* hash parameters */
-	ut_params->op->xform->next->type = RTE_CRYPTO_SYM_XFORM_AUTH;
+	sym_op->xform->next->type = RTE_CRYPTO_SYM_XFORM_AUTH;
 
-	ut_params->op->xform->next->auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
-	ut_params->op->xform->next->auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
-	ut_params->op->xform->next->auth.key.length = HMAC_KEY_LENGTH_SHA1;
-	ut_params->op->xform->next->auth.key.data = hmac_sha1_key;
-	ut_params->op->xform->next->auth.digest_length =
+	sym_op->xform->next->auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
+	sym_op->xform->next->auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
+	sym_op->xform->next->auth.key.length = HMAC_KEY_LENGTH_SHA1;
+	sym_op->xform->next->auth.key.data = hmac_sha1_key;
+	sym_op->xform->next->auth.digest_length =
 			DIGEST_BYTE_LENGTH_SHA1;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA1;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA1;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
-			CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
+
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
+			CIPHER_IV_LENGTH_AES_CBC);
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
+
+	ut_params->obuf = ut_params->op->sym->m_src;
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
@@ -986,42 +999,48 @@ test_AES_CBC_HMAC_SHA1_decrypt_digest_verify(void)
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
+	/* attach symmetric crypto session to crypto operations */
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
 
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA1;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA1;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
-			CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
+			CIPHER_IV_LENGTH_AES_CBC);
 
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
+
+	ut_params->obuf = ut_params->op->sym->m_src;
+
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
@@ -1089,47 +1108,51 @@ test_AES_CBC_HMAC_SHA256_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_SHA256;
 
 	/* Create Crypto session*/
-	ut_params->sess =
-		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
-						&ut_params->cipher_xform);
+	ut_params->sess = rte_cryptodev_sym_session_create(
+			ts_params->valid_devs[0],
+			&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
 
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA256;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA256;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
-			CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
+			CIPHER_IV_LENGTH_AES_CBC);
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
+
+	ut_params->obuf = ut_params->op->sym->m_src;
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
@@ -1198,42 +1221,47 @@ test_AES_CBC_HMAC_SHA256_decrypt_digest_verify(void)
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
-
-	ut_params->op = &ut_params->ol->op.crypto;
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
+
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
+
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA256;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA256;
+
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(
 			ut_params->ibuf, CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
 			CIPHER_IV_LENGTH_AES_CBC);
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	/* Process crypto operation */
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
 
-	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	ut_params->obuf = ut_params->op->sym->m_src;
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
@@ -1312,43 +1340,46 @@ test_AES_CBC_HMAC_SHA512_encrypt_digest(void)
 
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
-
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
 
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA512;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA512;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
-			CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
 			CIPHER_IV_LENGTH_AES_CBC);
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
+			CIPHER_IV_LENGTH_AES_CBC);
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
+
+	ut_params->obuf = ut_params->op->sym->m_src;
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
@@ -1448,43 +1479,46 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 			DIGEST_BYTE_LENGTH_SHA512);
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
+	rte_crypto_op_attach_sym_session(ut_params->op, sess);
 
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, sess);
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA512;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA512;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
+
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(
 			ut_params->ibuf, CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, 0);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
 			CIPHER_IV_LENGTH_AES_CBC);
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	/* Process crypto operation */
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
 
-	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	ut_params->obuf = ut_params->op->sym->m_src;
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
@@ -1522,10 +1556,6 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
 			catch_22_quote, QUOTE_512_BYTES, 0);
 
-	ut_params->digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,
-			DIGEST_BYTE_LENGTH_AES_XCBC);
-	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
-
 	/* Setup Cipher Parameters */
 	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = &ut_params->auth_xform;
@@ -1546,54 +1576,71 @@ test_AES_CBC_HMAC_AES_XCBC_encrypt_digest(void)
 	ut_params->auth_xform.auth.digest_length = DIGEST_BYTE_LENGTH_AES_XCBC;
 
 	/* Create Crypto session*/
-	ut_params->sess =
-		rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
-						&ut_params->cipher_xform);
+	ut_params->sess = rte_cryptodev_sym_session_create(
+			ts_params->valid_devs[0],
+			&ut_params->cipher_xform);
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
 
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
 
-	ut_params->op->iv.data = (uint8_t *)
-		rte_pktmbuf_prepend(ut_params->ibuf,
-				CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	/* Set operation cipher parameters */
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(
+			sym_op->m_src, CIPHER_IV_LENGTH_AES_CBC);
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(sym_op->m_src);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
 			CIPHER_IV_LENGTH_AES_CBC);
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
+
+	/* Set operation authentication parameters */
+	sym_op->auth.digest.data = (uint8_t *)rte_pktmbuf_append(
+			sym_op->m_src, DIGEST_BYTE_LENGTH_AES_XCBC);
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+			sym_op->m_src,
+			CIPHER_IV_LENGTH_AES_CBC + QUOTE_512_BYTES);
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_AES_XCBC;
+
+	memset(sym_op->auth.digest.data, 0, DIGEST_BYTE_LENGTH_AES_XCBC);
+
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
 
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	ut_params->op = process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op);
+	TEST_ASSERT_NOT_NULL(ut_params->op, "failed to process sym crypto op");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
-			CIPHER_IV_LENGTH_AES_CBC,
+			rte_pktmbuf_mtod_offset(ut_params->op->sym->m_src,
+					uint8_t *, CIPHER_IV_LENGTH_AES_CBC),
 			catch_22_quote_2_512_bytes_AES_CBC_ciphertext,
 			QUOTE_512_BYTES,
 			"Ciphertext data not as expected");
+
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			rte_pktmbuf_mtod(ut_params->obuf, uint8_t *) +
-			CIPHER_IV_LENGTH_AES_CBC + QUOTE_512_BYTES,
+			rte_pktmbuf_mtod_offset(
+					ut_params->op->sym->m_src, uint8_t *,
+					CIPHER_IV_LENGTH_AES_CBC +
+					QUOTE_512_BYTES),
 			catch_22_quote_2_512_bytes_HMAC_AES_XCBC_digest,
 			DIGEST_BYTE_LENGTH_AES_XCBC,
 			"Generated digest data not as expected");
@@ -1612,14 +1659,6 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 		(const char *)catch_22_quote_2_512_bytes_AES_CBC_ciphertext,
 		QUOTE_512_BYTES, 0);
 
-	ut_params->digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf,
-			DIGEST_BYTE_LENGTH_AES_XCBC);
-	TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
-
-	rte_memcpy(ut_params->digest,
-			catch_22_quote_2_512_bytes_HMAC_AES_XCBC_digest,
-			DIGEST_BYTE_LENGTH_AES_XCBC);
-
 	/* Setup Cipher Parameters */
 	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
 	ut_params->cipher_xform.next = NULL;
@@ -1646,35 +1685,55 @@ test_AES_CBC_HMAC_AES_XCBC_decrypt_digest_verify(void)
 	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
-	ut_params->op = &ut_params->ol->op.crypto;
+	/* Set crypto operation data parameters */
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
 
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
 
-	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(ut_params->ibuf,
-			CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	sym_op->auth.digest.data = (uint8_t *)rte_pktmbuf_append(
+				ut_params->ibuf, DIGEST_BYTE_LENGTH_AES_XCBC);
+	TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
+			"no room to append digest");
+
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
+			ut_params->ibuf, QUOTE_512_BYTES);
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_AES_XCBC;
+
+	rte_memcpy(sym_op->auth.digest.data,
+			catch_22_quote_2_512_bytes_HMAC_AES_XCBC_digest,
+			DIGEST_BYTE_LENGTH_AES_XCBC);
+
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
+
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(
+			ut_params->ibuf, CIPHER_IV_LENGTH_AES_CBC);
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(ut_params->ibuf);
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
+
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
 			CIPHER_IV_LENGTH_AES_CBC);
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op), "failed to process sym crypto op");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto op processing failed");
+
+	ut_params->obuf = ut_params->op->sym->m_src;
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
@@ -1835,50 +1894,53 @@ test_not_in_place_crypto(void)
 			DIGEST_BYTE_LENGTH_SHA512);
 
 	/* Generate Crypto op data structure */
-	ut_params->ol = rte_pktmbuf_offload_alloc(ts_params->mbuf_ol_pool,
-				RTE_PKTMBUF_OL_CRYPTO_SYM);
-	TEST_ASSERT_NOT_NULL(ut_params->ol,
-			"Failed to allocate pktmbuf offload");
-
-	ut_params->op = &ut_params->ol->op.crypto;
+	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(ut_params->op,
+			"Failed to allocate symmetric crypto operation struct");
 
 
 	/* Set crypto operation data parameters */
-	rte_crypto_sym_op_attach_session(ut_params->op, ut_params->sess);
+	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
+
+	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
+
+	/* set crypto operation source mbuf */
+	sym_op->m_src = ut_params->ibuf;
+	sym_op->m_dst = dst_m;
 
-	ut_params->op->digest.data = ut_params->digest;
-	ut_params->op->digest.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->auth.digest.data = ut_params->digest;
+	sym_op->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, QUOTE_512_BYTES);
-	ut_params->op->digest.length = DIGEST_BYTE_LENGTH_SHA512;
+	sym_op->auth.digest.length = DIGEST_BYTE_LENGTH_SHA512;
 
-	ut_params->op->iv.data = (uint8_t *)rte_pktmbuf_prepend(
+	sym_op->auth.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->auth.data.length = QUOTE_512_BYTES;
+
+
+	sym_op->cipher.iv.data = (uint8_t *)rte_pktmbuf_prepend(
 			ut_params->ibuf, CIPHER_IV_LENGTH_AES_CBC);
-	ut_params->op->iv.phys_addr = rte_pktmbuf_mtophys_offset(
+	sym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys_offset(
 			ut_params->ibuf, 0);
-	ut_params->op->iv.length = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.iv.length = CIPHER_IV_LENGTH_AES_CBC;
 
-	rte_memcpy(ut_params->op->iv.data, aes_cbc_iv,
+	rte_memcpy(sym_op->cipher.iv.data, aes_cbc_iv,
 			CIPHER_IV_LENGTH_AES_CBC);
 
-	ut_params->op->data.to_cipher.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_cipher.length = QUOTE_512_BYTES;
-
-	ut_params->op->data.to_hash.offset = CIPHER_IV_LENGTH_AES_CBC;
-	ut_params->op->data.to_hash.length = QUOTE_512_BYTES;
-
-	ut_params->op->dst.m = dst_m;
-	ut_params->op->dst.offset = 0;
-
-	rte_pktmbuf_offload_attach(ut_params->ibuf, ut_params->ol);
+	sym_op->cipher.data.offset = CIPHER_IV_LENGTH_AES_CBC;
+	sym_op->cipher.data.length = QUOTE_512_BYTES;
 
 	/* Process crypto operation */
-	ut_params->obuf = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->ibuf);
-	TEST_ASSERT_NOT_NULL(ut_params->obuf, "failed to retrieve obuf");
+	ut_params->op = process_crypto_request(ts_params->valid_devs[0],
+			ut_params->op);
+	TEST_ASSERT_NOT_NULL(ut_params->op, "no crypto operation returned");
+
+	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
+			"crypto operation processing failed");
 
 	/* Validate obuf */
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			rte_pktmbuf_mtod(ut_params->op->dst.m, char *),
+			rte_pktmbuf_mtod(ut_params->op->sym->m_dst, char *),
 			catch_22_quote,
 			QUOTE_512_BYTES,
 			"Plaintext data not as expected");
app/test/test_cryptodev_perf.c +110 -111

372 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +72 -61

257 lines not on this page · raw message

drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c +6 -6
index d56de12..b1dd103 100644
@@ -138,9 +138,9 @@ aesni_mb_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 	return 0;
 }
 
-/** Create a ring to place process packets on */
+/** Create a ring to place processed operations on */
 static struct rte_ring *
-aesni_mb_pmd_qp_create_processed_pkts_ring(struct aesni_mb_qp *qp,
+aesni_mb_pmd_qp_create_processed_ops_ring(struct aesni_mb_qp *qp,
 		unsigned ring_size, int socket_id)
 {
 	struct rte_ring *r;
@@ -148,12 +148,12 @@ aesni_mb_pmd_qp_create_processed_pkts_ring(struct aesni_mb_qp *qp,
 	r = rte_ring_lookup(qp->name);
 	if (r) {
 		if (r->prod.size >= ring_size) {
-			MB_LOG_INFO("Reusing existing ring %s for processed packets",
+			MB_LOG_INFO("Reusing existing ring %s for processed ops",
 					 qp->name);
 			return r;
 		}
 
-		MB_LOG_ERR("Unable to reuse existing ring %s for processed packets",
+		MB_LOG_ERR("Unable to reuse existing ring %s for processed ops",
 				 qp->name);
 		return NULL;
 	}
@@ -189,9 +189,9 @@ aesni_mb_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 
 	qp->ops = &job_ops[internals->vector_mode];
 
-	qp->processed_pkts = aesni_mb_pmd_qp_create_processed_pkts_ring(qp,
+	qp->processed_ops = aesni_mb_pmd_qp_create_processed_ops_ring(qp,
 			qp_conf->nb_descriptors, socket_id);
-	if (qp->processed_pkts == NULL)
+	if (qp->processed_ops == NULL)
 		goto qp_setup_cleanup;
 
 	qp->sess_mp = dev->data->session_pool;
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +2 -2
index 0aed177..949d9a6 100644
@@ -146,8 +146,8 @@ struct aesni_mb_qp {
 	/**< Vector mode dependent pointer table of the multi-buffer APIs */
 	MB_MGR mb_mgr;
 	/**< Multi-buffer instance */
-	struct rte_ring *processed_pkts;
-	/**< Ring for placing process packets */
+	struct rte_ring *processed_ops;
+	/**< Ring for placing process operations */
 	struct rte_mempool *sess_mp;
 	/**< Session Mempool */
 	struct rte_cryptodev_stats stats;
drivers/crypto/qat/qat_crypto.c +70 -62

249 lines not on this page · raw message

drivers/crypto/qat/qat_crypto.h +6 -6
index e9f71fe..9323383 100644
@@ -115,12 +115,12 @@ extern void
 qat_crypto_sym_clear_session(struct rte_cryptodev *dev, void *session);
 
 
-uint16_t
-qat_sym_crypto_pkt_tx_burst(void *txq, struct rte_mbuf **tx_pkts,
-		uint16_t nb_pkts);
+extern uint16_t
+qat_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops,
+		uint16_t nb_ops);
 
-uint16_t
-qat_sym_crypto_pkt_rx_burst(void *rxq, struct rte_mbuf **rx_pkts,
-		uint16_t nb_pkts);
+extern uint16_t
+qat_pmd_dequeue_op_burst(void *qp, struct rte_crypto_op **ops,
+		uint16_t nb_ops);
 
 #endif /* _QAT_CRYPTO_H_ */
drivers/crypto/qat/rte_qat_cryptodev.c +2 -2
index 85700fc..5e51aca 100644
@@ -92,8 +92,8 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_
 	cryptodev->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
 	cryptodev->dev_ops = &crypto_qat_ops;
 
-	cryptodev->enqueue_burst = qat_sym_crypto_pkt_tx_burst;
-	cryptodev->dequeue_burst = qat_sym_crypto_pkt_rx_burst;
+	cryptodev->enqueue_burst = qat_pmd_enqueue_op_burst;
+	cryptodev->dequeue_burst = qat_pmd_dequeue_op_burst;
 
 
 	internals = cryptodev->data->dev_private;
examples/l2fwd-crypto/main.c +89 -75

303 lines not on this page · raw message

lib/librte_cryptodev/rte_crypto.h +349 -3

372 lines not on this page · raw message

lib/librte_cryptodev/rte_crypto_sym.h +209 -165

457 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.c +76 -0

76 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.h +53 -55

108 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev_version.map +3 -2
index a46af6f..b682184 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.1.0

Part of the diff is not shown here. View the raw message.