aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>2017-06-29 18:05:57 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2017-12-27 21:41:45 +0300
commite9d60da192588bbd041230b1431030ca19a18959 (patch)
tree79bf7d4cd6f8ba43621c6472525b6a312c04736d /example
parent9cb761fe020b76dbdd7acbcc541f6f1c0d8d90d7 (diff)
api: crypto: deprecate ASYNC mode and odp_crypto_compl_t
Setting pref_mode to ASYNC now results in SYNC behaviour, so let's deprecate all ASYNC-related crypto items: pref_mode, odp_crypto_compl_t and related functions. Passing context through param/result is also deprecated, as odp_crypto_operation now works only in sync mode, thus there is no need to pass additional data around it. Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'example')
-rw-r--r--example/ipsec/odp_ipsec.c14
-rw-r--r--example/ipsec/odp_ipsec_cache.c15
-rw-r--r--example/ipsec/odp_ipsec_cache.h6
3 files changed, 5 insertions, 30 deletions
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
index 59c3fa817..775c26dd4 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -393,9 +393,7 @@ void ipsec_init_post(crypto_api_mode_e api_mode)
auth_sa,
tun,
api_mode,
- entry->input,
- completionq,
- out_pool)) {
+ entry->input)) {
EXAMPLE_ERR("Error: IPSec cache entry failed.\n"
);
exit(EXIT_FAILURE);
@@ -662,7 +660,6 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t pkt,
/* Initialize parameters block */
memset(&params, 0, sizeof(params));
- params.ctx = ctx;
params.session = entry->state.session;
params.pkt = pkt;
params.out_pkt = entry->in_place ? pkt : ODP_PACKET_INVALID;
@@ -843,7 +840,6 @@ pkt_disposition_e do_ipsec_out_classify(odp_packet_t pkt,
/* Initialize parameters block */
memset(&params, 0, sizeof(params));
params.session = entry->state.session;
- params.ctx = ctx;
params.pkt = pkt;
params.out_pkt = entry->in_place ? pkt : ODP_PACKET_INVALID;
@@ -1085,14 +1081,6 @@ int pktio_thread(void *arg EXAMPLE_UNUSED)
}
ctx->state = PKT_STATE_INPUT_VERIFY;
}
- } else if (ODP_EVENT_CRYPTO_COMPL == odp_event_type(ev)) {
- odp_crypto_compl_t compl;
-
- compl = odp_crypto_compl_from_event(ev);
- odp_crypto_compl_result(compl, &result);
- odp_crypto_compl_free(compl);
- pkt = result.pkt;
- ctx = result.ctx;
} else {
abort();
}
diff --git a/example/ipsec/odp_ipsec_cache.c b/example/ipsec/odp_ipsec_cache.c
index dba0ea0ab..e41503368 100644
--- a/example/ipsec/odp_ipsec_cache.c
+++ b/example/ipsec/odp_ipsec_cache.c
@@ -40,9 +40,7 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa,
sa_db_entry_t *auth_sa,
tun_db_entry_t *tun,
crypto_api_mode_e api_mode,
- odp_bool_t in,
- odp_queue_t completionq,
- odp_pool_t out_pool)
+ odp_bool_t in)
{
odp_crypto_session_param_t params;
ipsec_cache_entry_t *entry;
@@ -65,15 +63,8 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa,
/* Setup parameters and call crypto library to create session */
params.op = (in) ? ODP_CRYPTO_OP_DECODE : ODP_CRYPTO_OP_ENCODE;
params.auth_cipher_text = TRUE;
- if (CRYPTO_API_SYNC == api_mode) {
- params.pref_mode = ODP_CRYPTO_SYNC;
- params.compl_queue = ODP_QUEUE_INVALID;
- params.output_pool = ODP_POOL_INVALID;
- } else {
- params.pref_mode = ODP_CRYPTO_ASYNC;
- params.compl_queue = completionq;
- params.output_pool = out_pool;
- }
+ params.compl_queue = ODP_QUEUE_INVALID;
+ params.output_pool = ODP_POOL_INVALID;
if (CRYPTO_API_ASYNC_NEW_BUFFER == api_mode)
entry->in_place = FALSE;
diff --git a/example/ipsec/odp_ipsec_cache.h b/example/ipsec/odp_ipsec_cache.h
index 7a4b95cd4..ce37ccced 100644
--- a/example/ipsec/odp_ipsec_cache.h
+++ b/example/ipsec/odp_ipsec_cache.h
@@ -85,8 +85,6 @@ void init_ipsec_cache(void);
* @param tun Tunnel DB entry pointer
* @param api_mode Crypto API mode for testing
* @param in Direction (input versus output)
- * @param completionq Completion queue
- * @param out_pool Output buffer pool
*
* @return 0 if successful else -1
*/
@@ -94,9 +92,7 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa,
sa_db_entry_t *auth_sa,
tun_db_entry_t *tun,
crypto_api_mode_e api_mode,
- odp_bool_t in,
- odp_queue_t completionq,
- odp_pool_t out_pool);
+ odp_bool_t in);
/**
* Find a matching IPsec cache entry for input packet