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

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

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Trahe, Fiona
> Sent: Wednesday, March 09, 2016 12:56 PM
> To: Thomas Monjalon
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v7 2/2] cryptodev: change burst API to be 
> crypto
> op oriented
> 
> 
> 
> > -Original Message-
> > From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> > Sent: Tuesday, March 08, 2016 2:32 PM
> > To: Trahe, Fiona
> > Cc: dev at dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v7 2/2] cryptodev: change burst API to
> > be crypto op oriented
> >
> > 2016-03-07 11:50, 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.
> >
> > Why not doing several patches?
> >
We will post v8 patchset today with more granular patches 

> > > -Packet buffer offload - EXPERIMENTAL
> > > -M: Declan Doherty 
> > > -F: lib/librte_mbuf_offload/
> >
> > Removing a library is important. It is not mentioned in the message.
> > It deserves a separate commit, please.
> >
ok

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

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

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


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

2016-03-09 Thread Trahe, Fiona


> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Tuesday, March 08, 2016 2:32 PM
> To: Trahe, Fiona
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v7 2/2] cryptodev: change burst API to be 
> crypto
> op oriented
> 
> 2016-03-07 11:50, 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.
> 
> Why not doing several patches?
> 
> > -Packet buffer offload - EXPERIMENTAL
> > -M: Declan Doherty 
> > -F: lib/librte_mbuf_offload/
> 
> Removing a library is important. It is not mentioned in the message.
> It deserves a separate commit, please.
> 
> > @@ -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?
> 
> > -#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


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

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

Why not doing several patches?

> -Packet buffer offload - EXPERIMENTAL
> -M: Declan Doherty 
> -F: lib/librte_mbuf_offload/

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

> @@ -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?

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




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

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

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

diff --git a/MAINTAINERS b/MAINTAINERS
index 628bc05..8d84dda 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -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 
-F: lib/librte_mbuf_offload/
-
 Ethernet API
 M: Thomas Monjalon 
 F: lib/librte_ether/
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 951b443..208fc14 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -35,7 +35,6 @@
 #include 
 #include 
 #include 
-#include 

 #include 
 #include 
@@ -48,7 +47,7 @@ static enum rte_cryptodev_type gbl_cryptodev_type;

 struct crypto_testsuite_params {
struct rte_mempool *mbuf_pool;
-   struct rte_mempool *mbuf_ol_pool;
+   struct rte_mempool *op_mpool;
struct rte_cryptodev_config conf;
struct rte_cryptodev_qp_conf qp_conf;

@@ -62,8 +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;

struct rte_mbuf *obuf, *ibuf;

@@ -104,7 +102,7 @@ setup_test_string(struct rte_mempool *mpool,
return m;
 }

-#if HEX_DUMP
+#ifdef HEX_DUMP
 static void
 hexdump_mbuf_data(FILE *f, const char *title, struct rte_mbuf *m)
 {
@@ -112,27 +110,29 @@ hexdump_mbuf_data(FILE *f, const char *title, struct 
rte_mbuf *m)
 }
 #endif

-static struct rte_mbuf *
-process_crypto_request(uint8_t dev_id, struct rte_mbuf *ibuf)
+static struct rte_crypto_op *
+process_crypto_request(uint8_t dev_id, struct rte_crypto_op *op)
 {
-   struct rte_mbuf *obuf = NULL;
-#if HEX_DUMP
+#ifdef HEX_DUMP
hexdump_mbuf_data(stdout, "Enqueued Packet", ibuf);
 #endif

-   if (rte_cryptodev_enqueue_burst(dev_id, 0, , 1) != 1) {
+   if (rte_cryptodev_enqueue_burst(dev_id, 0, , 1) != 1) {
printf("Error sending packet for encryption");
return NULL;
}
-   while (rte_cryptodev_dequeue_burst(dev_id, 0, , 1) == 0)
+
+   op = NULL;
+
+   while (rte_cryptodev_dequeue_burst(dev_id, 0, , 1) == 0)
rte_pause();

-#if HEX_DUMP
+#ifdef HEX_DUMP
if (obuf)
hexdump_mbuf_data(stdout, "Dequeued Packet", obuf);
 #endif

-