From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D88D2293B for ; Mon, 26 Jun 2017 20:22:47 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2017 11:22:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,396,1493708400"; d="scan'208";a="101655388" Received: from silpixa00399464.ir.intel.com (HELO silpixa00399464.ger.corp.intel.com) ([10.237.222.157]) by orsmga004.jf.intel.com with ESMTP; 26 Jun 2017 11:22:45 -0700 From: Pablo de Lara To: declan.doherty@intel.com, zbigniew.bodek@caviumnetworks.com, jerin.jacob@caviumnetworks.com, akhil.goyal@nxp.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, Pablo de Lara Date: Mon, 26 Jun 2017 11:22:35 +0100 Message-Id: <20170626102300.56637-3-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170626102300.56637-1-pablo.de.lara.guarch@intel.com> References: <1496005522-134934-1-git-send-email-pablo.de.lara.guarch@intel.com> <20170626102300.56637-1-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH v2 02/27] cryptodev: replace enums with 1-byte variables 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: , X-List-Received-Date: Mon, 26 Jun 2017 18:22:48 -0000 Instead of storing some crypto operation flags, such as operation status, as enumerations, store them as uint8_t, for memory efficiency. Also, reserve extra 5 bytes in the crypto operation, for future additions. Signed-off-by: Pablo de Lara --- doc/guides/rel_notes/release_17_08.rst | 3 +++ lib/librte_cryptodev/rte_crypto.h | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/guides/rel_notes/release_17_08.rst b/doc/guides/rel_notes/release_17_08.rst index 2bc405d..bbb14a9 100644 --- a/doc/guides/rel_notes/release_17_08.rst +++ b/doc/guides/rel_notes/release_17_08.rst @@ -151,6 +151,9 @@ API Changes * Removed the field ``rte_crypto_sym_op_sess_type`` from ``rte_crypto_sym_op``, and moved it to ``rte_crypto_op`` as ``rte_crypto_op_sess_type``. + * Enumerations ``rte_crypto_op_sess_type``, ``rte_crypto_op_status`` and + ``rte_crypto_op_sess_type`` in ``rte_crypto_op`` have been modified to be + uint8_t values. ABI Changes diff --git a/lib/librte_cryptodev/rte_crypto.h b/lib/librte_cryptodev/rte_crypto.h index ac5c184..8e2b640 100644 --- a/lib/librte_cryptodev/rte_crypto.h +++ b/lib/librte_cryptodev/rte_crypto.h @@ -102,19 +102,20 @@ enum rte_crypto_op_sess_type { * rte_cryptodev_enqueue_burst() / rte_cryptodev_dequeue_burst() . */ struct rte_crypto_op { - enum rte_crypto_op_type type; + uint8_t type; /**< operation type */ - - enum rte_crypto_op_status status; + uint8_t status; /**< * operation status - this is reset to * RTE_CRYPTO_OP_STATUS_NOT_PROCESSED on allocation from mempool and * will be set to RTE_CRYPTO_OP_STATUS_SUCCESS after crypto operation * is successfully processed by a crypto PMD */ - enum rte_crypto_op_sess_type sess_type; + uint8_t sess_type; /**< operation session type */ + uint8_t reserved[5]; + /**< Reserved bytes to fill 64 bits for future additions */ struct rte_mempool *mempool; /**< crypto operation mempool which operation is allocated from */ -- 2.9.4