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

2016-03-10 Thread Trahe, Fiona
Hi Thomas,

> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Tuesday, March 08, 2016 2:11 PM
> To: Trahe, Fiona
> Cc: dev at dpdk.org
> 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:
> > 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.
Sorry, fixed.

> 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


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

2016-03-08 Thread Thomas Monjalon
Hi,

2016-03-07 11:50, 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.

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.


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

2016-03-07 Thread 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.

Signed-off-by: Fiona Trahe 
---
 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

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 62f8fb0..951b443 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -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,
_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 @@