From patchwork Mon Jul 17 08:29:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 26988 X-Patchwork-Delegate: pablo.de.lara.guarch@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id C014B532E; Mon, 17 Jul 2017 18:29:38 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id C8A42532C for ; Mon, 17 Jul 2017 18:29:37 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2017 09:29:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,375,1496127600"; d="scan'208";a="128375081" Received: from silpixa00399464.ir.intel.com (HELO silpixa00399464.ger.corp.intel.com) ([10.237.222.157]) by fmsmga006.fm.intel.com with ESMTP; 17 Jul 2017 09:29:34 -0700 From: Pablo de Lara To: declan.doherty@intel.com Cc: dev@dpdk.org, Pablo de Lara Date: Mon, 17 Jul 2017 09:29:51 +0100 Message-Id: <20170717082953.74995-1-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.9.4 Subject: [dpdk-dev] [PATCH 1/3] cryptodev: modify some field sizes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Crypto keys and digests are not expected to be big, so using a uint16_t to store their lengths should be enough. Signed-off-by: Pablo de Lara Acked-by: Fiona Trahe --- doc/guides/rel_notes/release_17_08.rst | 2 ++ lib/librte_cryptodev/rte_crypto_sym.h | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/guides/rel_notes/release_17_08.rst b/doc/guides/rel_notes/release_17_08.rst index c6281eb..27453a3 100644 --- a/doc/guides/rel_notes/release_17_08.rst +++ b/doc/guides/rel_notes/release_17_08.rst @@ -313,6 +313,7 @@ ABI Changes * **Reorganized the ``rte_crypto_sym_cipher_xform`` structure.** * Added cipher IV length and offset parameters. + * Changed field size of key length from size_t to uint16_t. * **Reorganized the ``rte_crypto_sym_auth_xform`` structure.** @@ -320,6 +321,7 @@ ABI Changes * Changed field size of AAD length from uint32_t to uint16_t. * Changed field size of digest length from uint32_t to uint16_t. * Removed AAD length. + * Changed field size of key length from size_t to uint16_t. * Replaced ``dev_type`` enumeration with uint8_t ``driver_id`` in ``rte_cryptodev_info`` and ``rte_cryptodev`` structures. diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h index f9955a4..27439af 100644 --- a/lib/librte_cryptodev/rte_crypto_sym.h +++ b/lib/librte_cryptodev/rte_crypto_sym.h @@ -143,7 +143,7 @@ struct rte_crypto_cipher_xform { struct { uint8_t *data; /**< pointer to key data */ - size_t length; /**< key length in bytes */ + uint16_t length;/**< key length in bytes */ } key; /**< Cipher key * @@ -306,7 +306,7 @@ struct rte_crypto_auth_xform { struct { uint8_t *data; /**< pointer to key data */ - size_t length; /**< key length in bytes */ + uint16_t length;/**< key length in bytes */ } key; /**< Authentication key data. * The authentication key length MUST be less than or equal to the @@ -389,7 +389,7 @@ struct rte_crypto_aead_xform { struct { uint8_t *data; /**< pointer to key data */ - size_t length; /**< key length in bytes */ + uint16_t length;/**< key length in bytes */ } key; struct { @@ -424,7 +424,7 @@ struct rte_crypto_aead_xform { */ } iv; /**< Initialisation vector parameters */ - uint32_t digest_length; + uint16_t digest_length; uint16_t add_auth_data_length; /**< The length of the additional authenticated data (AAD) in bytes. */