From patchwork Mon Jun 26 10:22:37 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: 25738 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 68A4258F6; Mon, 26 Jun 2017 20:22:58 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id EDF42377E for ; Mon, 26 Jun 2017 20:22:51 +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:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,396,1493708400"; d="scan'208";a="101655402" 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:49 -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:37 +0100 Message-Id: <20170626102300.56637-5-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 04/27] cryptodev: do not store pointer to op specific params 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" Instead of storing a pointer to operation specific parameters, such as symmetric crypto parameters, use a zero-length array, to mark that these parameters will be stored after the generic crypto operation structure, which was already assumed in the code, reducing the memory footprint of the crypto operation. Besides, it is always expected to have rte_crypto_op and rte_crypto_sym_op (the only operation specific parameters structure right now) to be together, as they are initialized as a single object in the crypto operation pool. Signed-off-by: Pablo de Lara --- doc/guides/rel_notes/release_17_08.rst | 2 ++ examples/ipsec-secgw/ipsec.c | 1 - lib/librte_cryptodev/rte_crypto.h | 8 +------- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/doc/guides/rel_notes/release_17_08.rst b/doc/guides/rel_notes/release_17_08.rst index 20f459e..6acbf35 100644 --- a/doc/guides/rel_notes/release_17_08.rst +++ b/doc/guides/rel_notes/release_17_08.rst @@ -155,6 +155,8 @@ API Changes ``rte_crypto_op_sess_type`` in ``rte_crypto_op`` have been modified to be uint8_t values. * Removed the field ``opaque_data`` from ``rte_crypto_op``. + * Pointer to ``rte_crypto_sym_op`` in ``rte_crypto_op`` has been replaced + with a zero length array. ABI Changes diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c index edca5f0..126d79f 100644 --- a/examples/ipsec-secgw/ipsec.c +++ b/examples/ipsec-secgw/ipsec.c @@ -140,7 +140,6 @@ ipsec_enqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx, priv->cop.status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED; rte_prefetch0(&priv->sym_cop); - priv->cop.sym = &priv->sym_cop; if ((unlikely(sa->crypto_session == NULL)) && create_session(ipsec_ctx, sa)) { diff --git a/lib/librte_cryptodev/rte_crypto.h b/lib/librte_cryptodev/rte_crypto.h index c2677fa..85716a6 100644 --- a/lib/librte_cryptodev/rte_crypto.h +++ b/lib/librte_cryptodev/rte_crypto.h @@ -124,7 +124,7 @@ struct rte_crypto_op { RTE_STD_C11 union { - struct rte_crypto_sym_op *sym; + struct rte_crypto_sym_op sym[0]; /**< Symmetric operation parameters */ }; /**< operation specific parameters */ } __rte_cache_aligned; @@ -144,12 +144,6 @@ __rte_crypto_op_reset(struct rte_crypto_op *op, enum rte_crypto_op_type type) switch (type) { case RTE_CRYPTO_OP_TYPE_SYMMETRIC: - /** Symmetric operation structure starts after the end of the - * rte_crypto_op structure. - */ - op->sym = (struct rte_crypto_sym_op *)(op + 1); - op->type = type; - __rte_crypto_sym_op_reset(op->sym); break; default: