From patchwork Mon Feb 23 20:36:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 44914 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f198.google.com (mail-we0-f198.google.com [74.125.82.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E760921562 for ; Mon, 23 Feb 2015 20:37:20 +0000 (UTC) Received: by wesk11 with SMTP id k11sf13787222wes.3 for ; Mon, 23 Feb 2015 12:37:20 -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=VsmEXJli9Ey59Ew24gAiPn+OZiFhOaqAKg3Zykqt+pw=; b=MEHxbfPnjI59xVEkxh2EqT8iwjXgWugzEpxnrY4MBBZYBxcqm3WeYAtGSEuuh5cP3P SLYOSveDCLMmcZstGmKn+X0Zx4yHMFZ5rByvnZKMs9GSxV3kjTxjLYkflYoQIxfgi2sw 8+7U8A6J0WxL2P8HY+AgmdiUtgl0RclM0x2sDkIlBCwzurYK5sry8KIeRWeHB5cptr9y X2fWJ9BZUo3WjIG/3NN7EndGb8VYGFPan9sokQcj85tn3NKSoKco6ou/KJG6hcctbB5p vNLL065cwN3Kzg8mCfe90EAEOqnU8cq2E9fboVLE2roz9Hc0G4QTjTH+1yIuFtwf0jAM /scA== X-Gm-Message-State: ALoCoQkbymeDB0KQdsuXqlVci5c044yzQhy/bHyqmAcZf9RLNMD8+yOBCSnGAunXZY7I6laPjcSg X-Received: by 10.112.9.65 with SMTP id x1mr1397114lba.16.1424723839870; Mon, 23 Feb 2015 12:37:19 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.165 with SMTP id uf5ls588238lac.60.gmail; Mon, 23 Feb 2015 12:37:19 -0800 (PST) X-Received: by 10.152.9.2 with SMTP id v2mr11217312laa.67.1424723839537; Mon, 23 Feb 2015 12:37:19 -0800 (PST) Received: from mail-la0-x235.google.com (mail-la0-x235.google.com. [2a00:1450:4010:c03::235]) by mx.google.com with ESMTPS id a8si1558035laa.66.2015.02.23.12.37.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Feb 2015 12:37:19 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::235 as permitted sender) client-ip=2a00:1450:4010:c03::235; Received: by lams18 with SMTP id s18so21103886lam.11 for ; Mon, 23 Feb 2015 12:37:19 -0800 (PST) X-Received: by 10.112.56.139 with SMTP id a11mr11487820lbq.36.1424723839123; Mon, 23 Feb 2015 12:37:19 -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.35.133 with SMTP id h5csp1500315lbj; Mon, 23 Feb 2015 12:37:18 -0800 (PST) X-Received: by 10.140.95.43 with SMTP id h40mr27456880qge.68.1424723837775; Mon, 23 Feb 2015 12:37:17 -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 b69si15121627qhc.13.2015.02.23.12.37.16 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 23 Feb 2015 12:37:17 -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 1YPzkg-0002g4-Ku; Mon, 23 Feb 2015 20:37:14 +0000 Received: from alln-iport-3.cisco.com ([173.37.142.90]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YPzkI-0002cB-DP for lng-odp@lists.linaro.org; Mon, 23 Feb 2015 20:36:50 +0000 X-IronPort-AV: E=Sophos;i="5.09,633,1418083200"; d="scan'208";a="126179296" Received: from alln-core-10.cisco.com ([173.36.13.132]) by alln-iport-3.cisco.com with ESMTP; 23 Feb 2015 20:36:46 +0000 Received: from cpp-rtpbld-55.cisco.com (cpp-rtpbld-55.cisco.com [172.18.5.199]) by alln-core-10.cisco.com (8.14.5/8.14.5) with ESMTP id t1NKajlZ014973 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Feb 2015 20:36:46 GMT Received: from cpp-rtpbld-55.cisco.com (localhost.localdomain [127.0.0.1]) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8) with ESMTP id t1NKajZn030606; Mon, 23 Feb 2015 15:36:45 -0500 Received: (from robking@localhost) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8/Submit) id t1NKaidl030605; Mon, 23 Feb 2015 15:36:44 -0500 From: Robbie King To: lng-odp@lists.linaro.org Date: Mon, 23 Feb 2015 15:36:01 -0500 Message-Id: <1424723769-8762-3-git-send-email-robking@cisco.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1424723769-8762-1-git-send-email-robking@cisco.com> References: <1424723769-8762-1-git-send-email-robking@cisco.com> X-Topics: crypto patch Subject: [lng-odp] [PATCHv3 02/10] linux-generic: odp_crypto: add term_global 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-Original-Sender: robking@cisco.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::235 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=fail header.i=@cisco.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Yan Sonming Signed-off-by: Yan Sonming Signed-off-by: Mike Holmes Signed-off-by: Robbie King --- platform/linux-generic/include/odp_internal.h | 1 + platform/linux-generic/odp_crypto.c | 11 +++++++++++ platform/linux-generic/odp_init.c | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index fd684d1..9ae8530 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -49,6 +49,7 @@ int odp_classification_term_global(void); int odp_queue_init_global(void); int odp_crypto_init_global(void); +int odp_crypto_term_global(void); int odp_schedule_init_global(void); int odp_schedule_init_local(void); diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index bc0f961..631b0d0 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -447,6 +447,17 @@ odp_crypto_init_global(void) return 0; } +int odp_crypto_term_global(void) +{ + int ret = 0; + + ret = odp_shm_free(odp_shm_lookup("crypto_pool")); + if (ret < 0) + ODP_ERR("shm free failed for crypto_pool"); + + return ret; +} + ssize_t odp_random_data(uint8_t *buf, ssize_t len, odp_bool_t use_entropy ODP_UNUSED) { diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 064deea..645ac10 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -83,6 +83,11 @@ int odp_term_global(void) rc = -1; } + if (odp_crypto_term_global()) { + ODP_ERR("ODP crypto term failed.\n"); + rc = -1; + } + return rc; }