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 2 of 2

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

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

In reply to Fiona Trahe

2016-03-10 13:43, Fiona Trahe:

Quoted 1 line
 lib/librte_cryptodev/rte_crypto.h                  | 352 +++++++++++-

One of the problems with inline functions in a header, is that it must compile with C and C++. Unfortunately there is a small error here when included in a C++ app:

rte_crypto.h:172:24: error:
invalid conversion from ‘void*’ to ‘rte_crypto_op_pool_private*’
rte_crypto.h:220:29: error:
invalid conversion from ‘void*’ to ‘rte_crypto_op_pool_private*’

#47 lore raw

PATCH v8 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.1.0
Tested-by on the v7 series
#48 lore raw

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

In reply to Fiona Trahe

- Tested Commit: e702183bab5a13f6e7d77be0d414914319469020
- 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 24 cases, 24 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

- test case 3: l2fwd-crypto
Total 1 cases, 1 passed, 0 failed

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Fiona Trahe
Sent: Monday, March 07, 2016 7:50 PM
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

#49 lore raw

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

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                          | 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
#50 lore raw

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

Hi,

2016-03-07 11:50, Fiona Trahe:

Quoted 7 lines

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.

It seems you need to update the examples in the same patch, they do not compile anymore after these changes.
Again, it would be easier to review if you had split the changes to several
patches: one for the sym suffix, others for more tidying.

#51 lore raw

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

Hi Thomas,

Quoted 19 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Tuesday, March 08, 2016 2:11 PM
To: Trahe, Fiona
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v7 1/2] cryptodev: API tidy and changes to support future extensions

Hi,

2016-03-07 11:50, Fiona Trahe:

Quoted 7 lines

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.

Quoted 2 lines

It seems you need to update the examples in the same patch, they do not compile anymore after these changes.

Sorry, fixed.

Quoted 2 lines

Again, it would be easier to review if you had split the changes to several
patches: one for the sym suffix, others for more tidying.

V8 patchset will be sent shortly with more granular split

#52 lore raw

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

In reply to Fiona Trahe

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                                        |   4 -
 app/test/test_cryptodev.c                          | 804 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 253 +++----
 config/common_base                                 |   7 -
 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 -
 24 files changed, 1576 insertions(+), 1522 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 +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_base +0 -7
index 1af28c8..3066e9a 100644
@@ -360,13 +360,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

183 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 +55 -58

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.

#53 lore raw

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

2016-03-07 11:50, Fiona Trahe:

Quoted 5 lines

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.

Quoted 8 lines

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.

Why not doing several patches?

MAINTAINERS F: lib/librte_mbuf/ · line 227

Quoted 3 lines
MAINTAINERS +0 -3
-Packet buffer offload - EXPERIMENTAL
-M: Declan Doherty <[email protected]>
-F: lib/librte_mbuf_offload/

Removing a library is important. It is not mentioned in the message. It deserves a separate commit, please.

app/test/test_cryptodev.c struct crypto_unittest_params { · line 64

Quoted 7 lines
app/test/test_cryptodev.c +1 -2
@@ -62,8 +61,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;

Isn't it something which was just renamed in the previous patch?

app/test/test_cryptodev.c setup_test_string(struct rte_mempool *mpool, · line 107

Quoted 4 lines
app/test/test_cryptodev.c +1 -1
-#if HEX_DUMP
+#ifdef HEX_DUMP
 static void
 hexdump_mbuf_data(FILE *f, const char *title, struct rte_mbuf *m)

A better clean-up would be to remove this ifdef.
If you need a debug function which is not already in EAL, you can consider adding it.

#54 lore raw

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

Quoted 44 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Tuesday, March 08, 2016 2:32 PM
To: Trahe, Fiona
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v7 2/2] cryptodev: change burst API to be crypto op oriented

2016-03-07 11:50, Fiona Trahe:

Quoted 5 lines

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.

Quoted 8 lines

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.

Why not doing several patches?

MAINTAINERS F: lib/librte_mbuf/ · line 227

Quoted 3 lines
MAINTAINERS +0 -3
-Packet buffer offload - EXPERIMENTAL
-M: Declan Doherty <[email protected]>
-F: lib/librte_mbuf_offload/

Removing a library is important. It is not mentioned in the message. It deserves a separate commit, please.

app/test/test_cryptodev.c struct crypto_unittest_params { · line 64

Quoted 7 lines
app/test/test_cryptodev.c +1 -2
@@ -62,8 +61,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;

Isn't it something which was just renamed in the previous patch?

Quoted 9 lines

app/test/test_cryptodev.c setup_test_string(struct rte_mempool *mpool, · line 107

Quoted 4 lines
app/test/test_cryptodev.c +1 -1
-#if HEX_DUMP
+#ifdef HEX_DUMP
 static void
 hexdump_mbuf_data(FILE *f, const char *title, struct rte_mbuf *m)

A better clean-up would be to remove this ifdef.
If you need a debug function which is not already in EAL, you can consider adding it.

Hi Thomas,
We're working on this. Will spin the patchset as soon as we can. Fiona

#55 lore raw

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

Hi Thomas,

Quoted 27 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Trahe, Fiona
Sent: Wednesday, March 09, 2016 12:56 PM
To: Thomas Monjalon
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v7 2/2] cryptodev: change burst API to be crypto op oriented

Quoted 8 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Tuesday, March 08, 2016 2:32 PM
To: Trahe, Fiona
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v7 2/2] cryptodev: change burst API to be crypto op oriented

Quoted 9 lines

2016-03-07 11:50, Fiona Trahe:

Quoted 8 lines

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

Quoted 10 lines

future.

Quoted 5 lines
Quoted 5 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 and finally removes the now unused rte_mbuf_offload

library.

Quoted 3 lines

Why not doing several patches?

We will post v8 patchset today with more granular patches

Quoted 7 lines
Quoted 7 lines

MAINTAINERS F: lib/librte_mbuf/ · line 227

Quoted 3 lines
MAINTAINERS +0 -3
-Packet buffer offload - EXPERIMENTAL
-M: Declan Doherty <[email protected]>
-F: lib/librte_mbuf_offload/

Removing a library is important. It is not mentioned in the message. It deserves a separate commit, please.

ok

Quoted 9 lines
Quoted 9 lines

app/test/test_cryptodev.c struct crypto_unittest_params { · line 64

Quoted 7 lines
app/test/test_cryptodev.c +1 -2
@@ -62,8 +61,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;

Isn't it something which was just renamed in the previous patch?

It looks like a double rename, but it's more than that.
In first patch rte_crypto_op was renamed rte_crypto_sym_op and moved from rte_crypto.h to to rte_crypto_sym.h
because it was exclusively for symmetric operations.
In the later patch a more generic rte_crypto_op was introduced in rte_crypto.h which can handle various operation types by having a type and union. Initially the only type is symmetric and so the union points to an rte_crypto_sym_op but it's planned to extended to handle asymmetric.

Quoted 10 lines
Quoted 10 lines

app/test/test_cryptodev.c setup_test_string(struct rte_mempool *mpool, · line 107

Quoted 5 lines
app/test/test_cryptodev.c +1 -1
-#if HEX_DUMP
+#ifdef HEX_DUMP
 static void
 hexdump_mbuf_data(FILE *f, const char *title, struct rte_mbuf *m)

A better clean-up would be to remove this ifdef.
If you need a debug function which is not already in EAL, you can consider adding it.

Agreed. We will look at adding the debug needed. However this is not likely to make it into the patchset today.

Quoted 4 lines

Hi Thomas,
We're working on this. Will spin the patchset as soon as we can. Fiona

Tested-by on the v6 series
#56 lore raw

Re: [PATCH v6 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 24 cases, 24 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

- test case 3: l2fwd-crypto
Total 1 cases, 1 passed, 0 failed

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Fiona Trahe
Sent: Saturday, March 05, 2016 2:30 AM
To: [email protected]
Subject: [dpdk-dev] [PATCH v6 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.

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

--
2.1.0

#57 lore raw

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

In reply to Declan Doherty

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_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
#58 lore raw

PATCH v6 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                                        |   4 -
 app/test/test_cryptodev.c                          | 804 +++++++++++----------
 app/test/test_cryptodev.h                          |   9 +-
 app/test/test_cryptodev_perf.c                     | 253 +++----
 config/common_bsdapp                               |   9 +-
 config/common_linuxapp                             |   9 +-
 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               | 115 ++-
 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, 1579 insertions(+), 1532 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 +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 +1 -8
index 7df5ac6..54255f8 100644
@@ -301,7 +301,7 @@ CONFIG_RTE_PMD_PACKET_PREFETCH=y
 
 #
 # Compile generic crypto device library
-# EXPERIMENTAL: API may change without prior notice
+# EXPERIMENTAL: API may change without prior notice. 
 #
 CONFIG_RTE_LIBRTE_CRYPTODEV=y
 CONFIG_RTE_LIBRTE_CRYPTODEV_DEBUG=n
@@ -352,13 +352,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 +1 -8
index 26df137..654e0bd 100644
@@ -315,7 +315,7 @@ CONFIG_RTE_PMD_PACKET_PREFETCH=y
 
 #
 # Compile generic crypto device library
-# EXPERIMENTAL: API may change without prior notice
+# EXPERIMENTAL: API may change without prior notice. 
 #
 CONFIG_RTE_LIBRTE_CRYPTODEV=y
 CONFIG_RTE_LIBRTE_CRYPTODEV_DEBUG=n
@@ -368,13 +368,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

154 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 +56 -59

115 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.

Tested-by on the v4 series
#59 lore raw

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

In reply to Declan Doherty

- 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 24 cases, 24 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

- test case 3: l2fwd-crypto
Total 1 cases, 1 passed, 0 failed

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Declan Doherty
Sent: Tuesday, March 01, 2016 12:52 AM
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

--
2.5.0

Tested-by on the v3 series
#60 lore raw

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

In reply to Declan Doherty

- 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 24 cases, 24 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

- test case 3: l2fwd-crypto
Total 1 cases, 1 passed, 0 failed

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Declan Doherty
Sent: Saturday, February 27, 2016 1:30 AM
To: [email protected]
Subject: [dpdk-dev] [PATCH v3 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.

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

--
2.5.0

Tested-by on the v2 series
#61 lore raw

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

In reply to Declan Doherty

- 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 24 cases, 24 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

- test case 3: l2fwd-crypto
Total 1 cases, 1 passed, 0 failed

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Declan Doherty
Sent: Friday, February 19, 2016 7:01 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH v2 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.

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

--
2.5.0