From patchwork Fri Dec 12 22:40:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 42202 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0577826C77 for ; Fri, 12 Dec 2014 22:41:11 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id hs14sf5511929lab.9 for ; Fri, 12 Dec 2014 14:41:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=du+SbzTEMeRenqes0gT7eXjEivmaAlsl+8Jbn5qNLmU=; b=DENyubXpZ9QZKxtYSbfyN2QzrVi+vVsPLj5mF0sJWrOu+mwsBGBmxwJ8MSnhS6Xi/p jW9i9xiWJW4G0z3Vf+Mg+8rp7LMeDot43EfnuH5OQ0MJDZPTZ3ZOZkqnD+WAcY87jSZV Z5hHcG06lD5aOQO+1uWAPD/a7nt8BTHUUUNqRMfYQAWhLKZfdxXZkLRRAUvvP3Mmtn7C PfZ1zwxwx1o0YdBklMyFkYSnI0a85sX59kv0x2g3EE/BQq6AlshfNRoujFgjfAPEERbb NqIFiqnIUfx7xZO7WhpRJwC1wkm9+jTV7wRASHf1DC62RNoKNQ/DqKNJIwMAQ/Q853zW sEOQ== X-Gm-Message-State: ALoCoQn0XgIAV26a33Tw6vFEdTLxId5VGcibVn6YMLKEE5fRJai9SH0ZSt0UxDMFqynRQGaoTacG X-Received: by 10.194.133.39 with SMTP id oz7mr737902wjb.3.1418424069929; Fri, 12 Dec 2014 14:41:09 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.202 with SMTP id v10ls383622lag.77.gmail; Fri, 12 Dec 2014 14:41:09 -0800 (PST) X-Received: by 10.152.203.201 with SMTP id ks9mr4224904lac.57.1418424069446; Fri, 12 Dec 2014 14:41:09 -0800 (PST) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id ap1si2744221lbc.100.2014.12.12.14.41.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Dec 2014 14:41:09 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id w7so2383531lbi.16 for ; Fri, 12 Dec 2014 14:41:09 -0800 (PST) X-Received: by 10.152.87.100 with SMTP id w4mr17863597laz.71.1418424069180; Fri, 12 Dec 2014 14:41:09 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.142.69 with SMTP id ru5csp116692lbb; Fri, 12 Dec 2014 14:41:08 -0800 (PST) X-Received: by 10.224.79.212 with SMTP id q20mr36113269qak.4.1418424067753; Fri, 12 Dec 2014 14:41:07 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id k10si3105202qay.56.2014.12.12.14.41.06 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 12 Dec 2014 14:41:07 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XzYtV-0001fa-60; Fri, 12 Dec 2014 22:41:05 +0000 Received: from mail-la0-f47.google.com ([209.85.215.47]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XzYtA-0001cY-SQ for lng-odp@lists.linaro.org; Fri, 12 Dec 2014 22:40:45 +0000 Received: by mail-la0-f47.google.com with SMTP id hz20so6692723lab.20 for ; Fri, 12 Dec 2014 14:40:39 -0800 (PST) X-Received: by 10.112.145.37 with SMTP id sr5mr18355286lbb.76.1418424039365; Fri, 12 Dec 2014 14:40:39 -0800 (PST) Received: from localhost.localdomain ([80.77.38.170]) by mx.google.com with ESMTPSA id kt7sm745502lac.4.2014.12.12.14.40.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Dec 2014 14:40:38 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org, robking@cisco.com Date: Sat, 13 Dec 2014 00:40:26 +0200 Message-Id: <1418424026-4526-4-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1418424026-4526-1-git-send-email-taras.kondratiuk@linaro.org> References: <1418424026-4526-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: crypto patch Subject: [lng-odp] [PATCH 3/3] linux-generic: crypto: implement odp_crypto_get_operation_compl_packet() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Taras Kondratiuk --- platform/linux-generic/include/odp_crypto_internal.h | 1 + platform/linux-generic/odp_crypto.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/include/odp_crypto_internal.h b/platform/linux-generic/include/odp_crypto_internal.h index 6ecfe80..8a50d60 100644 --- a/platform/linux-generic/include/odp_crypto_internal.h +++ b/platform/linux-generic/include/odp_crypto_internal.h @@ -70,6 +70,7 @@ typedef struct odp_crypto_generic_op_result { odp_crypto_compl_status_t cipher; odp_crypto_compl_status_t auth; void* op_context; + odp_packet_t out_pkt; } odp_crypto_generic_op_result_t; /** diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index e605d59..d611cc6 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -386,6 +386,7 @@ odp_crypto_operation(odp_crypto_op_params_t *params, result->cipher.hw_err = ODP_CRYPTO_HW_ERR_NONE; result->auth.alg_err = rc_auth; result->auth.hw_err = ODP_CRYPTO_HW_ERR_NONE; + result->out_pkt = params->out_pkt; /* If specified during creation post event to completion queue */ if (ODP_QUEUE_INVALID != session->compl_queue) { @@ -476,8 +477,14 @@ void } odp_packet_t -odp_crypto_get_operation_compl_packet(odp_buffer_t completion_event ODP_UNUSED) +odp_crypto_get_operation_compl_packet(odp_buffer_t completion_event) { - ODP_UNIMPLEMENTED(); - return ODP_PACKET_INVALID; + odp_crypto_generic_op_result_t *result; + + result = get_op_result_from_buffer(completion_event); + ODP_ASSERT(OP_RESULT_MAGIC == result->magic, "Bad completion magic"); + ODP_ASSERT(odp_buffer_type(completion_event == ODP_BUFFER_TYPE_PACKET), + "Completion is not a packet"); + + return result->out_pkt; }