From patchwork Wed Jul 5 14:00:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 107080 Delivered-To: patch@linaro.org Received: by 10.182.135.102 with SMTP id pr6csp881991obb; Wed, 5 Jul 2017 07:05:01 -0700 (PDT) X-Received: by 10.200.61.130 with SMTP id v2mr47409492qtf.230.1499263501693; Wed, 05 Jul 2017 07:05:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499263501; cv=none; d=google.com; s=arc-20160816; b=Aa2k0ygWHa7ArcsPClYcFJYPR29JWge379oGfRV1ejxqdNUhbuwpgnET4xtOgp4bHD i5VitBZ1HFRcO/wWQsU6a89jgLX1nldOEgStiaEO8fAgavwggVvSOOJQ3+AhZCPHGVVs fQLHLSPqLpx7x6m3sGB7lj8AftJzYGckcJ6llFBuI7VKKb6EfCbuW7KTjg9jFO0t8XdC dUA1EIWDfOZnL2iypa6Bc034avRh6K6rKXD1X4OTYldknzPdTMCmpCB41B7Ug5RAE7qY riYzKyu/RnUuT6QTuIePNS7a0M+TDIEbVj2GUNwqtTVcCy1c/lE+j14yWTrIJyS2zb36 7IGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=lIV3R6MIUP2+S9hOUw9QkqQg66JUGNxvz8YtEJaCU54=; b=0tGn4nZ2I4yODN/VJMqrsoOxoEY82125gR9KkotLHjGPQc7hO7GVcId+l04qKDy8DO igh2jLDw8irvqP2wfzVna95/aEGSDuYio/lRhxMLHnSbA8WPTynbiyIsnfGv4tZ+2y0X oQpnaEcJExUTOIgYtl6Sv39UXktXhIRoiXLJTUcRShTyFiUyFxYS+24V0jnGN4hQj32x W7XZpOUFavpNFZQdqXCo3MF3UQv17s32POSX+lpFuryVT6UuicKQOypkVsQCVWKWPI6Z 1R9k6BEpvek8DlJbNR+ypTlm2eIddEnOfx/6tqz+hYqegMymJV9Nvt5lM0Tttj8T+hru Orew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p4si17189351qtc.73.2017.07.05.07.05.01; Wed, 05 Jul 2017 07:05:01 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 5792160D37; Wed, 5 Jul 2017 14:05:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 6085A60D48; Wed, 5 Jul 2017 14:01:33 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E010D60816; Wed, 5 Jul 2017 14:01:11 +0000 (UTC) Received: from forward5h.cmail.yandex.net (forward5h.cmail.yandex.net [87.250.230.20]) by lists.linaro.org (Postfix) with ESMTPS id DBE3160D35 for ; Wed, 5 Jul 2017 14:00:45 +0000 (UTC) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::15:6]) by forward5h.cmail.yandex.net (Yandex) with ESMTP id 62E8C21836 for ; Wed, 5 Jul 2017 17:00:44 +0300 (MSK) Received: from smtp4j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp4j.mail.yandex.net (Yandex) with ESMTP id 9D5CC3241075 for ; Wed, 5 Jul 2017 17:00:41 +0300 (MSK) Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id SKW8niBPOU-0eEmUGZr; Wed, 05 Jul 2017 17:00:40 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 5 Jul 2017 17:00:21 +0300 Message-Id: <1499263226-5288-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499263226-5288-1-git-send-email-odpbot@yandex.ru> References: <1499263226-5288-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 64 Subject: [lng-odp] [PATCH API-NEXT v8 5/10] api: crypto: deprecate ASYNC mode and odp_crypto_compl_t X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov 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 --- /** Email created from pull request 64 (lumag:crypto-packet) ** https://github.com/Linaro/odp/pull/64 ** Patch: https://github.com/Linaro/odp/pull/64.patch ** Base sha: 00a21c6dce65a30c8250db59a42a43c658e8ca1b ** Merge commit sha: ac9b299a7f3bee72dd9343bbfaa826217d243ea6 **/ example/ipsec/odp_ipsec.c | 14 +------- example/ipsec/odp_ipsec_cache.c | 15 ++------ example/ipsec/odp_ipsec_cache.h | 6 +--- include/odp/api/spec/crypto.h | 31 ++++++++++------ include/odp/arch/default/api/abi/crypto.h | 4 ++- include/odp/arch/default/api/abi/event.h | 4 ++- .../include/odp/api/plat/crypto_types.h | 3 +- .../include/odp/api/plat/event_types.h | 3 +- platform/linux-generic/odp_crypto.c | 14 +++++--- platform/linux-generic/odp_event.c | 2 ++ test/common_plat/performance/odp_crypto.c | 42 +--------------------- test/common_plat/validation/api/crypto/crypto.c | 2 -- .../validation/api/crypto/odp_crypto_test_inp.c | 40 +-------------------- .../validation/api/crypto/odp_crypto_test_inp.h | 2 -- 14 files changed, 49 insertions(+), 133 deletions(-) diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 9ed3aa20..1ed03585 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(¶ms, 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(¶ms, 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 dba0ea0a..e4150336 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 7a4b95cd..ce37ccce 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 diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 01b15d6b..454855ea 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -270,8 +270,11 @@ typedef struct odp_crypto_session_param_t { */ odp_bool_t auth_cipher_text; - /** Preferred sync vs. async */ - odp_crypto_op_mode_t pref_mode; + /** Preferred sync vs. async + * + * @deprecated no-op now, odp_crypto_operation() will always process + * data in non-posted mode */ + odp_crypto_op_mode_t ODP_DEPRECATE(pref_mode); /** Cipher algorithm * @@ -334,8 +337,11 @@ typedef struct odp_crypto_op_param_t { /** Session handle from creation */ odp_crypto_session_t session; - /** User context */ - void *ctx; + /** User context + * + * @deprecated No need to pass context around sync calls + * */ + void *ODP_DEPRECATE(ctx); /** Input packet * @@ -618,7 +624,8 @@ int odp_crypto_session_destroy(odp_crypto_session_t session); * * @return crypto completion handle */ -odp_crypto_compl_t odp_crypto_compl_from_event(odp_event_t ev); +ODP_DEPRECATE(odp_crypto_compl_t) ODP_DEPRECATE(odp_crypto_compl_from_event)( + odp_event_t ev); /** * Convert crypto completion handle to event handle @@ -627,14 +634,16 @@ odp_crypto_compl_t odp_crypto_compl_from_event(odp_event_t ev); * * @return Event handle */ -odp_event_t odp_crypto_compl_to_event(odp_crypto_compl_t completion_event); +odp_event_t ODP_DEPRECATE(odp_crypto_compl_to_event)( + ODP_DEPRECATE(odp_crypto_compl_t) completion_event); /** * Release crypto completion event * * @param completion_event Completion event we are done accessing */ -void odp_crypto_compl_free(odp_crypto_compl_t completion_event); +void ODP_DEPRECATE(odp_crypto_compl_free)( + ODP_DEPRECATE(odp_crypto_compl_t) completion_event); /** * Crypto per packet operation @@ -660,8 +669,9 @@ int odp_crypto_operation(odp_crypto_op_param_t *param, * @param completion_event Event containing operation results * @param result Pointer to result structure */ -void odp_crypto_compl_result(odp_crypto_compl_t completion_event, - odp_crypto_op_result_t *result); +void ODP_DEPRECATE(odp_crypto_compl_result)( + ODP_DEPRECATE(odp_crypto_compl_t) completion_event, + odp_crypto_op_result_t *result); /** * Get printable value for an odp_crypto_session_t @@ -687,7 +697,8 @@ uint64_t odp_crypto_session_to_u64(odp_crypto_session_t hdl); * to enable applications to generate a printable value that represents * an odp_crypto_compl_t handle. */ -uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl); +uint64_t ODP_DEPRECATE(odp_crypto_compl_to_u64)( + ODP_DEPRECATE(odp_crypto_compl_t) hdl); /** * Initialize crypto session parameters diff --git a/include/odp/arch/default/api/abi/crypto.h b/include/odp/arch/default/api/abi/crypto.h index f0793a19..2d02eee6 100644 --- a/include/odp/arch/default/api/abi/crypto.h +++ b/include/odp/arch/default/api/abi/crypto.h @@ -11,6 +11,8 @@ extern "C" { #endif +#include + #include /** @internal Dummy type for strong typing */ @@ -23,7 +25,7 @@ typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_crypto_compl_t; #define ODP_CRYPTO_SESSION_INVALID (0xffffffffffffffffULL) typedef uint64_t odp_crypto_session_t; -typedef _odp_abi_crypto_compl_t *odp_crypto_compl_t; +typedef _odp_abi_crypto_compl_t *ODP_DEPRECATE(odp_crypto_compl_t); /** * @} diff --git a/include/odp/arch/default/api/abi/event.h b/include/odp/arch/default/api/abi/event.h index ab3c0f75..23b16efd 100644 --- a/include/odp/arch/default/api/abi/event.h +++ b/include/odp/arch/default/api/abi/event.h @@ -11,6 +11,8 @@ extern "C" { #endif +#include + #include /** @internal Dummy type for strong typing */ @@ -28,7 +30,7 @@ typedef enum odp_event_type_t { ODP_EVENT_BUFFER = 1, ODP_EVENT_PACKET = 2, ODP_EVENT_TIMEOUT = 3, - ODP_EVENT_CRYPTO_COMPL = 4, + ODP_DEPRECATE(ODP_EVENT_CRYPTO_COMPL) = 4, ODP_EVENT_IPSEC_STATUS = 5 } odp_event_type_t; diff --git a/platform/linux-generic/include/odp/api/plat/crypto_types.h b/platform/linux-generic/include/odp/api/plat/crypto_types.h index 2cc747eb..23e1cc42 100644 --- a/platform/linux-generic/include/odp/api/plat/crypto_types.h +++ b/platform/linux-generic/include/odp/api/plat/crypto_types.h @@ -22,6 +22,7 @@ extern "C" { #if ODP_ABI_COMPAT == 1 #include #else +#include /** @ingroup odp_crypto * @{ @@ -30,7 +31,7 @@ extern "C" { #define ODP_CRYPTO_SESSION_INVALID (0xffffffffffffffffULL) typedef uint64_t odp_crypto_session_t; -typedef ODP_HANDLE_T(odp_crypto_compl_t); +typedef ODP_HANDLE_T(ODP_DEPRECATE(odp_crypto_compl_t)); /** * @} diff --git a/platform/linux-generic/include/odp/api/plat/event_types.h b/platform/linux-generic/include/odp/api/plat/event_types.h index 5b3a07e3..1987bc8b 100644 --- a/platform/linux-generic/include/odp/api/plat/event_types.h +++ b/platform/linux-generic/include/odp/api/plat/event_types.h @@ -23,6 +23,7 @@ extern "C" { #include #else +#include #include #include @@ -38,7 +39,7 @@ typedef enum odp_event_type_t { ODP_EVENT_BUFFER = 1, ODP_EVENT_PACKET = 2, ODP_EVENT_TIMEOUT = 3, - ODP_EVENT_CRYPTO_COMPL = 4, + ODP_DEPRECATE(ODP_EVENT_CRYPTO_COMPL) = 4, ODP_EVENT_IPSEC_STATUS = 5 } odp_event_type_t; diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index b23b5b6b..075bb02b 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -885,7 +885,9 @@ odp_crypto_operation(odp_crypto_op_param_t *param, } /* Fill in result */ +#if ODP_DEPRECATED_API local_result.ctx = param->ctx; +#endif local_result.pkt = param->out_pkt; local_result.cipher_status.alg_err = rc_cipher; local_result.cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE; @@ -1045,6 +1047,7 @@ int32_t odp_random_test_data(uint8_t *buf, uint32_t len, uint64_t *seed) return len; } +#if ODP_DEPRECATED_API odp_crypto_compl_t odp_crypto_compl_from_event(odp_event_t ev) { /* This check not mandated by the API specification */ @@ -1077,6 +1080,12 @@ odp_crypto_compl_free(odp_crypto_compl_t completion_event) odp_buffer_free(odp_buffer_from_event(ev)); } +uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl) +{ + return _odp_pri(hdl); +} +#endif + void odp_crypto_session_param_init(odp_crypto_session_param_t *param) { memset(param, 0, sizeof(odp_crypto_session_param_t)); @@ -1086,8 +1095,3 @@ uint64_t odp_crypto_session_to_u64(odp_crypto_session_t hdl) { return (uint64_t)hdl; } - -uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl) -{ - return _odp_pri(hdl); -} diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c index 23b410d8..56cc90b0 100644 --- a/platform/linux-generic/odp_event.c +++ b/platform/linux-generic/odp_event.c @@ -46,9 +46,11 @@ void odp_event_free(odp_event_t event) case ODP_EVENT_TIMEOUT: odp_timeout_free(odp_timeout_from_event(event)); break; +#if ODP_DEPRECATED_API case ODP_EVENT_CRYPTO_COMPL: odp_crypto_compl_free(odp_crypto_compl_from_event(event)); break; +#endif default: ODP_ABORT("Invalid event type: %d\n", odp_event_type(event)); } diff --git a/test/common_plat/performance/odp_crypto.c b/test/common_plat/performance/odp_crypto.c index c3dd6d38..bc29a888 100644 --- a/test/common_plat/performance/odp_crypto.c +++ b/test/common_plat/performance/odp_crypto.c @@ -427,7 +427,6 @@ create_session_from_config(odp_crypto_session_t *session, odp_crypto_session_param_init(¶ms); memcpy(¶ms, &config->session, sizeof(odp_crypto_session_param_t)); params.op = ODP_CRYPTO_OP_ENCODE; - params.pref_mode = ODP_CRYPTO_SYNC; /* Lookup the packet pool */ pkt_pool = odp_pool_lookup("packet_pool"); @@ -571,7 +570,7 @@ run_measure_one(crypto_args_t *cargs, packets_sent++; } - if (!posted) { + if (1) { packets_received++; if (cargs->debug_packets) { mem = odp_packet_data(params.out_pkt); @@ -587,45 +586,6 @@ run_measure_one(crypto_args_t *cargs, odp_packet_free(params.out_pkt); } } - } else { - odp_event_t ev; - odp_crypto_compl_t compl; - odp_crypto_op_result_t result; - odp_packet_t out_pkt; - - if (cargs->schedule) - ev = odp_schedule(NULL, - ODP_SCHED_NO_WAIT); - else - ev = odp_queue_deq(out_queue); - - while (ev != ODP_EVENT_INVALID) { - compl = odp_crypto_compl_from_event(ev); - odp_crypto_compl_result(compl, &result); - odp_crypto_compl_free(compl); - out_pkt = result.pkt; - - if (cargs->debug_packets) { - mem = odp_packet_data(out_pkt); - print_mem("Receieved encrypted packet", - mem, - payload_length + - config-> - session.auth_digest_len); - } - if (cargs->reuse_packet) { - params.pkt = out_pkt; - params.out_pkt = ODP_PACKET_INVALID; - } else { - odp_packet_free(out_pkt); - } - packets_received++; - if (cargs->schedule) - ev = odp_schedule(NULL, - ODP_SCHED_NO_WAIT); - else - ev = odp_queue_deq(out_queue); - }; } } diff --git a/test/common_plat/validation/api/crypto/crypto.c b/test/common_plat/validation/api/crypto/crypto.c index 94beb2f1..fde95ab7 100644 --- a/test/common_plat/validation/api/crypto/crypto.c +++ b/test/common_plat/validation/api/crypto/crypto.c @@ -15,8 +15,6 @@ odp_suiteinfo_t crypto_suites[] = { {ODP_CRYPTO_SYNC_INP, crypto_suite_sync_init, crypto_suite_term, crypto_suite}, - {ODP_CRYPTO_ASYNC_INP, crypto_suite_async_init, crypto_suite_term, - crypto_suite}, ODP_SUITE_INFO_NULL, }; diff --git a/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c b/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c index 1d7d49a2..d42ecb68 100644 --- a/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c @@ -14,7 +14,6 @@ #define MAX_ALG_CAPA 32 struct suite_context_s { - odp_crypto_op_mode_t pref_mode; odp_pool_t pool; odp_queue_t queue; }; @@ -92,8 +91,6 @@ static void alg_test(odp_crypto_op_t op, int rc; odp_crypto_ses_create_err_t status; odp_bool_t posted; - odp_event_t event; - odp_crypto_compl_t compl_event; odp_crypto_op_result_t result; odp_crypto_session_param_t ses_params; odp_crypto_op_param_t op_params; @@ -196,7 +193,6 @@ static void alg_test(odp_crypto_op_t op, odp_crypto_session_param_init(&ses_params); ses_params.op = op; ses_params.auth_cipher_text = false; - ses_params.pref_mode = suite_context.pref_mode; ses_params.cipher_alg = cipher_alg; ses_params.auth_alg = auth_alg; ses_params.compl_queue = suite_context.queue; @@ -225,7 +221,6 @@ static void alg_test(odp_crypto_op_t op, op_params.session = session; op_params.pkt = pkt; op_params.out_pkt = pkt; - op_params.ctx = (void *)0xdeadbeef; if (cipher_range) { op_params.cipher_range = *cipher_range; @@ -258,27 +253,8 @@ static void alg_test(odp_crypto_op_t op, goto cleanup; } - if (posted) { - /* Poll completion queue for results */ - do { - event = odp_queue_deq(suite_context.queue); - } while (event == ODP_EVENT_INVALID); - - CU_ASSERT(ODP_EVENT_CRYPTO_COMPL == odp_event_type(event)); - CU_ASSERT(ODP_EVENT_NO_SUBTYPE == odp_event_subtype(event)); - CU_ASSERT(ODP_EVENT_CRYPTO_COMPL == - odp_event_types(event, &subtype)); - CU_ASSERT(ODP_EVENT_NO_SUBTYPE == subtype); - - compl_event = odp_crypto_compl_from_event(event); - CU_ASSERT(odp_crypto_compl_to_u64(compl_event) == - odp_crypto_compl_to_u64(odp_crypto_compl_from_event(event))); - odp_crypto_compl_result(compl_event, &result); - odp_crypto_compl_free(compl_event); - } - + CU_ASSERT(posted == 0); CU_ASSERT(result.pkt == pkt); - CU_ASSERT(result.ctx == (void *)0xdeadbeef); CU_ASSERT(ODP_EVENT_PACKET == odp_event_type(odp_packet_to_event(result.pkt))); CU_ASSERT(ODP_EVENT_PACKET_BASIC == @@ -1519,20 +1495,6 @@ int crypto_suite_sync_init(void) return -1; suite_context.queue = ODP_QUEUE_INVALID; - suite_context.pref_mode = ODP_CRYPTO_SYNC; - return 0; -} - -int crypto_suite_async_init(void) -{ - suite_context.pool = odp_pool_lookup("packet_pool"); - if (suite_context.pool == ODP_POOL_INVALID) - return -1; - suite_context.queue = odp_queue_lookup("crypto-out"); - if (suite_context.queue == ODP_QUEUE_INVALID) - return -1; - - suite_context.pref_mode = ODP_CRYPTO_ASYNC; return 0; } diff --git a/test/common_plat/validation/api/crypto/odp_crypto_test_inp.h b/test/common_plat/validation/api/crypto/odp_crypto_test_inp.h index 0f693379..86ecce8e 100644 --- a/test/common_plat/validation/api/crypto/odp_crypto_test_inp.h +++ b/test/common_plat/validation/api/crypto/odp_crypto_test_inp.h @@ -9,14 +9,12 @@ #include /* Suite names */ -#define ODP_CRYPTO_ASYNC_INP "odp_crypto_async_inp" #define ODP_CRYPTO_SYNC_INP "odp_crypto_sync_inp" /* Suite test array */ extern odp_testinfo_t crypto_suite[]; int crypto_suite_sync_init(void); -int crypto_suite_async_init(void); int crypto_suite_term(void); #endif