From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: pablo.de.lara.guarch@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 03/22] cryptodev: remove opaque data pointer in crypto op
Date: Wed, 21 Jun 2017 08:47:12 +0100 [thread overview]
Message-ID: <20170621074731.45013-3-pablo.de.lara.guarch@intel.com> (raw)
In-Reply-To: <20170621074731.45013-1-pablo.de.lara.guarch@intel.com>
Storing a pointer to the user data is unnecessary,
since user can store additional data, after the crypto operation.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
app/test-crypto-perf/cperf_test_latency.c | 30 +++++++++++++++++++-----------
lib/librte_cryptodev/rte_crypto.h | 5 -----
2 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
index e61ac97..215614e 100644
--- a/app/test-crypto-perf/cperf_test_latency.c
+++ b/app/test-crypto-perf/cperf_test_latency.c
@@ -66,6 +66,10 @@ struct cperf_latency_ctx {
struct cperf_op_result *res;
};
+struct priv_op_data {
+ struct cperf_op_result *result;
+};
+
#define max(a, b) (a > b ? (uint64_t)a : (uint64_t)b)
#define min(a, b) (a < b ? (uint64_t)a : (uint64_t)b)
@@ -276,8 +280,9 @@ cperf_latency_test_constructor(uint8_t dev_id, uint16_t qp_id,
snprintf(pool_name, sizeof(pool_name), "cperf_op_pool_cdev_%d",
dev_id);
+ uint16_t priv_size = sizeof(struct priv_op_data);
ctx->crypto_op_pool = rte_crypto_op_pool_create(pool_name,
- RTE_CRYPTO_OP_TYPE_SYMMETRIC, options->pool_sz, 0, 0,
+ RTE_CRYPTO_OP_TYPE_SYMMETRIC, options->pool_sz, 0, priv_size,
rte_socket_id());
if (ctx->crypto_op_pool == NULL)
goto err;
@@ -299,7 +304,6 @@ int
cperf_latency_test_runner(void *arg)
{
struct cperf_latency_ctx *ctx = arg;
- struct cperf_op_result *pres;
uint16_t test_burst_size;
uint8_t burst_size_idx = 0;
@@ -311,6 +315,7 @@ cperf_latency_test_runner(void *arg)
struct rte_crypto_op *ops[ctx->options->max_burst_size];
struct rte_crypto_op *ops_processed[ctx->options->max_burst_size];
uint64_t i;
+ struct priv_op_data *priv_data;
uint32_t lcore = rte_lcore_id();
@@ -398,7 +403,12 @@ cperf_latency_test_runner(void *arg)
for (i = 0; i < ops_enqd; i++) {
ctx->res[tsc_idx].tsc_start = tsc_start;
- ops[i]->opaque_data = (void *)&ctx->res[tsc_idx];
+ /*
+ * Private data structure starts after the end of the
+ * rte_crypto_sym_op structure.
+ */
+ priv_data = (struct priv_op_data *) (ops[i]->sym + 1);
+ priv_data->result = (void *)&ctx->res[tsc_idx];
tsc_idx++;
}
@@ -410,10 +420,9 @@ cperf_latency_test_runner(void *arg)
* failures.
*/
for (i = 0; i < ops_deqd; i++) {
- pres = (struct cperf_op_result *)
- (ops_processed[i]->opaque_data);
- pres->status = ops_processed[i]->status;
- pres->tsc_end = tsc_end;
+ priv_data = (struct priv_op_data *) (ops[i]->sym + 1);
+ priv_data->result->status = ops_processed[i]->status;
+ priv_data->result->tsc_end = tsc_end;
rte_crypto_op_free(ops_processed[i]);
}
@@ -446,10 +455,9 @@ cperf_latency_test_runner(void *arg)
if (ops_deqd != 0) {
for (i = 0; i < ops_deqd; i++) {
- pres = (struct cperf_op_result *)
- (ops_processed[i]->opaque_data);
- pres->status = ops_processed[i]->status;
- pres->tsc_end = tsc_end;
+ priv_data = (struct priv_op_data *) (ops[i]->sym + 1);
+ priv_data->result->status = ops_processed[i]->status;
+ priv_data->result->tsc_end = tsc_end;
rte_crypto_op_free(ops_processed[i]);
}
diff --git a/lib/librte_cryptodev/rte_crypto.h b/lib/librte_cryptodev/rte_crypto.h
index 8e2b640..c2677fa 100644
--- a/lib/librte_cryptodev/rte_crypto.h
+++ b/lib/librte_cryptodev/rte_crypto.h
@@ -122,9 +122,6 @@ struct rte_crypto_op {
phys_addr_t phys_addr;
/**< physical address of crypto operation */
- void *opaque_data;
- /**< Opaque pointer for user data */
-
RTE_STD_C11
union {
struct rte_crypto_sym_op *sym;
@@ -158,8 +155,6 @@ __rte_crypto_op_reset(struct rte_crypto_op *op, enum rte_crypto_op_type type)
default:
break;
}
-
- op->opaque_data = NULL;
}
/**
--
2.9.4
next prev parent reply other threads:[~2017-06-21 15:47 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-21 7:47 [dpdk-dev] [PATCH 01/22] cryptodev: move session type to generic " Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 02/22] cryptodev: replace enums with 1-byte variables Pablo de Lara
2017-06-21 7:47 ` Pablo de Lara [this message]
2017-06-21 7:47 ` [dpdk-dev] [PATCH 04/22] cryptodev: do not store pointer to op specific params Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 05/22] cryptodev: add crypto op helper macros Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 06/22] crypto/qat: fix auth parameters for KASUMI Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 07/22] test/crypto: move IV to crypto op private data Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 08/22] test/crypto-perf: " Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 09/22] app/crypto-perf: " Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 10/22] examples/l2fwd-crypto: " Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 11/22] examples/ipsec-secgw: " Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 12/22] cryptodev: pass IV as offset Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 13/22] cryptodev: move IV parameters to crypto session Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 14/22] cryptodev: add auth IV Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 15/22] cryptodev: do not use AAD in wireless algorithms Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 16/22] cryptodev: remove AAD length from crypto op Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 17/22] cryptodev: remove digest " Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 18/22] cryptodev: set AES-GMAC as auth-only algo Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 19/22] cryptodev: add AEAD specific data Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 20/22] cryptodev: add AEAD parameters in crypto operation Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 21/22] cryptodev: use AES-GCM/CCM as AEAD algorithms Pablo de Lara
2017-06-21 7:47 ` [dpdk-dev] [PATCH 22/22] cryptodev: remove AAD from authentication structure Pablo de Lara
2017-06-21 16:29 ` [dpdk-dev] [PATCH 01/22] cryptodev: move session type to generic crypto op De Lara Guarch, Pablo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170621074731.45013-3-pablo.de.lara.guarch@intel.com \
--to=pablo.de.lara.guarch@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).