From patchwork Tue Feb 24 16:00:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 44944 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7709D2029F for ; Tue, 24 Feb 2015 16:01:42 +0000 (UTC) Received: by lbdu10 with SMTP id u10sf17861767lbd.3 for ; Tue, 24 Feb 2015 08:01:41 -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=nw3L9SWVSvsNx32d4Jn3veBRKMYjyG5J3yfixLHc14A=; b=Zp5vyD2BZS5dOWW4Kw87SKdSCW+6yBm/AFw0u4Cu4Fb6A6j3HGm7SNDWp7Snw6yE0R MOmkG/farxeyYGh2xS4HKlR4oO2YMcPF3ZGbQeO07laLY2M3sTkyrsvfuUjzQlcfcYoU +VNa245vdUgQ2HWn8XE3kKxCTH3CaxSLf7waZGTjUEzRmX1pKUKtCtxg4IwMICgVY0Ky n8nelakrRPwOofWIQfDIEsqca7QBVTBiis8m8ktGXNM7IvUC4K7eocdU30q61nSc72NK ZEddCIgfDfxgRADtLr2L6Cic2NCA6f7n+H5+d62gGIDrDo+cMYSLFHGgFg5Y39T6A3Lv 73eQ== X-Gm-Message-State: ALoCoQlKOeASx7HB0S6xXz84U6hogQzufqbLdjlEvmJVsT9x9FzxZKQF0DEm/SKGQXy7YySWi7+6 X-Received: by 10.112.168.104 with SMTP id zv8mr2223893lbb.10.1424793701197; Tue, 24 Feb 2015 08:01:41 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.246.11 with SMTP id xs11ls703373lac.54.gmail; Tue, 24 Feb 2015 08:01:41 -0800 (PST) X-Received: by 10.112.9.74 with SMTP id x10mr3523568lba.93.1424793701055; Tue, 24 Feb 2015 08:01:41 -0800 (PST) Received: from mail-lb0-x22a.google.com (mail-lb0-x22a.google.com. [2a00:1450:4010:c04::22a]) by mx.google.com with ESMTPS id dh1si27078471lac.170.2015.02.24.08.01.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 08:01:41 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22a as permitted sender) client-ip=2a00:1450:4010:c04::22a; Received: by lbjf15 with SMTP id f15so25667677lbj.13 for ; Tue, 24 Feb 2015 08:01:41 -0800 (PST) X-Received: by 10.112.211.200 with SMTP id ne8mr14755583lbc.73.1424793700948; Tue, 24 Feb 2015 08:01:40 -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 h5csp2000528lbj; Tue, 24 Feb 2015 08:01:40 -0800 (PST) X-Received: by 10.140.40.70 with SMTP id w64mr37013119qgw.14.1424793699556; Tue, 24 Feb 2015 08:01:39 -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 j78si39555264qge.103.2015.02.24.08.01.38 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Feb 2015 08:01:39 -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 1YQHvT-0006b1-I4; Tue, 24 Feb 2015 16:01:35 +0000 Received: from rcdn-iport-4.cisco.com ([173.37.86.75]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQHvH-0006Zv-H3 for lng-odp@lists.linaro.org; Tue, 24 Feb 2015 16:01:23 +0000 X-IronPort-AV: E=Sophos;i="5.09,639,1418083200"; d="scan'208";a="398776137" Received: from alln-core-5.cisco.com ([173.36.13.138]) by rcdn-iport-4.cisco.com with ESMTP; 24 Feb 2015 16:01:18 +0000 Received: from cpp-rtpbld-55.cisco.com (cpp-rtpbld-55.cisco.com [172.18.5.199]) by alln-core-5.cisco.com (8.14.5/8.14.5) with ESMTP id t1OG1He9001551 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Feb 2015 16:01:18 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 t1OG1H2g028836; Tue, 24 Feb 2015 11:01:17 -0500 Received: (from robking@localhost) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8/Submit) id t1OG1G9P028835; Tue, 24 Feb 2015 11:01:16 -0500 From: Robbie King To: lng-odp@lists.linaro.org Date: Tue, 24 Feb 2015 11:00:39 -0500 Message-Id: <1424793647-28572-3-git-send-email-robking@cisco.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1424793647-28572-1-git-send-email-robking@cisco.com> References: <1424793647-28572-1-git-send-email-robking@cisco.com> X-Topics: crypto patch Subject: [lng-odp] [PATCHv4 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:c04::22a 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..2df37e7 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; + + 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 58e1ab6..602a3fd 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; }