cryptodev: add ff_disable field in cryptodev config

Message ID 1559575528-5363-1-git-send-email-anoobj@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series cryptodev: add ff_disable field in cryptodev config |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation fail Compilation issues

Commit Message

Anoob Joseph June 3, 2019, 3:25 p.m. UTC
  Adding a new field, ff_disable, to allow applications to control the
features enabled on the crypto device. This would allow for efficient
usage of HW/SW offloads by disabling the features not required by the
application.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 doc/guides/rel_notes/deprecation.rst   | 14 --------------
 doc/guides/rel_notes/release_19_08.rst | 11 ++++++++++-
 lib/librte_cryptodev/Makefile          |  2 +-
 lib/librte_cryptodev/meson.build       |  2 +-
 lib/librte_cryptodev/rte_cryptodev.h   |  7 +++++++
 5 files changed, 19 insertions(+), 17 deletions(-)
  

Comments

Akhil Goyal June 20, 2019, 2:06 p.m. UTC | #1
> 
> Adding a new field, ff_disable, to allow applications to control the
> features enabled on the crypto device. This would allow for efficient
> usage of HW/SW offloads by disabling the features not required by the
> application.
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> ---
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
  
Akhil Goyal June 21, 2019, 1:10 p.m. UTC | #2
Hi Anoob,

> 
> Adding a new field, ff_disable, to allow applications to control the
> features enabled on the crypto device. This would allow for efficient
> usage of HW/SW offloads by disabling the features not required by the
> application.
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>

I see a compilation issue with this change. 
/home/akhil/up/dpdk-next-crypto/examples/fips_validation/fips_dev_self_test.c: In function 'fips_dev_auto_test_init':
/home/akhil/up/dpdk-next-crypto/examples/fips_validation/fips_dev_self_test.c:1560:9: error: missing initializer for field 'ff_disable' of 'struct rte_cryptodev_config' [-Werror=missing-field-initializers]
  struct rte_cryptodev_config conf = {rte_cryptodev_socket_id(dev_id), 1};
         ^~~~~~~~~~~~~~~~~~~~
In file included from /home/akhil/up/dpdk-next-crypto/examples/fips_validation/fips_dev_self_test.c:5:0:
/home/akhil/up/dpdk-next-crypto/arm64-dpaa-linuxapp-gcc/include/rte_cryptodev.h:615:11: note: 'ff_disable' declared here
  uint64_t ff_disable;
           ^~~~~~~~~~

Please add a patch for all applications which use struct rte_cryptodev_config and set the default values of its parameters.

> ---
>  doc/guides/rel_notes/deprecation.rst   | 14 --------------
>  doc/guides/rel_notes/release_19_08.rst | 11 ++++++++++-
>  lib/librte_cryptodev/Makefile          |  2 +-
>  lib/librte_cryptodev/meson.build       |  2 +-
>  lib/librte_cryptodev/rte_cryptodev.h   |  7 +++++++
>  5 files changed, 19 insertions(+), 17 deletions(-)
>
  
Anoob Joseph June 24, 2019, 3:40 a.m. UTC | #3
Hi Akhil,

I'll fix the issues and send a revised patch.

Thanks,
Anoob

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Akhil Goyal
> Sent: Friday, June 21, 2019 6:40 PM
> To: Anoob Joseph <anoobj@marvell.com>; Declan Doherty
> <declan.doherty@intel.com>; Fiona Trahe <fiona.trahe@intel.com>; Pablo
> de Lara <pablo.de.lara.guarch@intel.com>; dev@dpdk.org
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Narayana Prasad Raju
> Athreya <pathreya@marvell.com>
> Subject: [EXT] Re: [dpdk-dev] [PATCH] cryptodev: add ff_disable field in
> cryptodev config
> 
> External Email
> 
> ----------------------------------------------------------------------
> Hi Anoob,
> 
> >
> > Adding a new field, ff_disable, to allow applications to control the
> > features enabled on the crypto device. This would allow for efficient
> > usage of HW/SW offloads by disabling the features not required by the
> > application.
> >
> > Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> 
> I see a compilation issue with this change.
> /home/akhil/up/dpdk-next-
> crypto/examples/fips_validation/fips_dev_self_test.c: In function
> 'fips_dev_auto_test_init':
> /home/akhil/up/dpdk-next-
> crypto/examples/fips_validation/fips_dev_self_test.c:1560:9: error: missing
> initializer for field 'ff_disable' of 'struct rte_cryptodev_config' [-
> Werror=missing-field-initializers]
>   struct rte_cryptodev_config conf = {rte_cryptodev_socket_id(dev_id), 1};
>          ^~~~~~~~~~~~~~~~~~~~
> In file included from /home/akhil/up/dpdk-next-
> crypto/examples/fips_validation/fips_dev_self_test.c:5:0:
> /home/akhil/up/dpdk-next-crypto/arm64-dpaa-linuxapp-
> gcc/include/rte_cryptodev.h:615:11: note: 'ff_disable' declared here
>   uint64_t ff_disable;
>            ^~~~~~~~~~
> 
> Please add a patch for all applications which use struct rte_cryptodev_config
> and set the default values of its parameters.
> 
> > ---
> >  doc/guides/rel_notes/deprecation.rst   | 14 --------------
> >  doc/guides/rel_notes/release_19_08.rst | 11 ++++++++++-
> >  lib/librte_cryptodev/Makefile          |  2 +-
> >  lib/librte_cryptodev/meson.build       |  2 +-
> >  lib/librte_cryptodev/rte_cryptodev.h   |  7 +++++++
> >  5 files changed, 19 insertions(+), 17 deletions(-)
> >
  

Patch

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 098d243..ea1d7b7 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -75,20 +75,6 @@  Deprecation Notices
   kernel modules in DPDK. As a result users won't be able to use ``ethtool``
   via ``igb`` & ``ixgbe`` anymore.
 
-* cryptodev: New member in ``rte_cryptodev_config`` to allow applications to
-  disable features supported by the crypto device. Only the following features
-  would be allowed to be disabled this way,
-
-  - ``RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO``
-  - ``RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO``
-  - ``RTE_CRYPTODEV_FF_SECURITY``
-
-  Disabling unused features would facilitate efficient usage of HW/SW offload.
-
-  - Member ``uint64_t ff_disable`` in ``rte_cryptodev_config``
-
-  The field would be added in v19.08.
-
 * cryptodev: the ``uint8_t *data`` member of ``key`` structure in the xforms
   structure (``rte_crypto_cipher_xform``, ``rte_crypto_auth_xform``, and
   ``rte_crypto_aead_xform``) will be changed to ``const uint8_t *data``.
diff --git a/doc/guides/rel_notes/release_19_08.rst b/doc/guides/rel_notes/release_19_08.rst
index b9510f9..205733d 100644
--- a/doc/guides/rel_notes/release_19_08.rst
+++ b/doc/guides/rel_notes/release_19_08.rst
@@ -99,6 +99,15 @@  ABI Changes
    Also, make sure to start the actual text at the margin.
    =========================================================
 
+* cryptodev: New member in ``rte_cryptodev_config`` to allow applications to
+  disable features supported by the crypto device. Only the following features
+  would be allowed to be disabled this way,
+
+  - ``RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO``
+  - ``RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO``
+  - ``RTE_CRYPTODEV_FF_SECURITY``
+
+  Disabling unused features would facilitate efficient usage of HW/SW offload.
 
 Shared Library Versions
 -----------------------
@@ -130,7 +139,7 @@  The libraries prepended with a plus sign were incremented in this version.
      librte_cfgfile.so.2
      librte_cmdline.so.2
      librte_compressdev.so.1
-     librte_cryptodev.so.7
+   + librte_cryptodev.so.8
      librte_distributor.so.1
      librte_eal.so.10
      librte_efd.so.1
diff --git a/lib/librte_cryptodev/Makefile b/lib/librte_cryptodev/Makefile
index c20e090..55d352a 100644
--- a/lib/librte_cryptodev/Makefile
+++ b/lib/librte_cryptodev/Makefile
@@ -7,7 +7,7 @@  include $(RTE_SDK)/mk/rte.vars.mk
 LIB = librte_cryptodev.a
 
 # library version
-LIBABIVER := 7
+LIBABIVER := 8
 
 # build flags
 CFLAGS += -O3
diff --git a/lib/librte_cryptodev/meson.build b/lib/librte_cryptodev/meson.build
index 9e009d4..0a2275d 100644
--- a/lib/librte_cryptodev/meson.build
+++ b/lib/librte_cryptodev/meson.build
@@ -1,7 +1,7 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
-version = 7
+version = 8
 allow_experimental_apis = true
 sources = files('rte_cryptodev.c', 'rte_cryptodev_pmd.c')
 headers = files('rte_cryptodev.h',
diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index 2d4f6d7..58bfab5 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -612,6 +612,13 @@  struct rte_cryptodev_config {
 	int socket_id;			/**< Socket to allocate resources on */
 	uint16_t nb_queue_pairs;
 	/**< Number of queue pairs to configure on device */
+	uint64_t ff_disable;
+	/**< Feature flags to be disabled. Only the following features are
+	 * allowed to be disabled,
+	 *  - RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO
+	 *  - RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO
+	 *  - RTE_CRYTPODEV_FF_SECURITY
+	 */
 };
 
 /**