From patchwork Tue Feb 24 16:00:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 44950 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 676962029F for ; Tue, 24 Feb 2015 16:02:14 +0000 (UTC) Received: by lbiz11 with SMTP id z11sf17866062lbi.2 for ; Tue, 24 Feb 2015 08:02:13 -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=AHhqLm+5H1P3PjOFLjNtixxG4epMb9jm3cDhuo2E0gE=; b=jtwihGRl/6jDu03Eqg2wzKKTpimnS7fPxG6YyNn1G5bWKi6nKCW4XjsuIJrkpFk6LR XBHdm8orsEznrBhmqYNQq/GCkNu18yUbXtab1zK3qqhRKKpnwoUYmuITZrAU2xGJcYzj azZFFk6/4h3REvZGhq2cL3R8zvo9PON58PjH50Iauw5vMcWqMMsHcilppW5UPxyJSEpC UnGDSF2ThC6i1USWIgZoJZ9+A8looxGje21CjdrwpnwwP6kdXCLaHm+j+oCFS4aaEe8h tbz8izywYCJqxNMPGt22Qv56YNkDOU/eaRSff/aInJm/+FPM7glSB/A11t8MMqrouPIw aQjw== X-Gm-Message-State: ALoCoQk2hTXd63yNuqsPSILdTHFtP0juSq8VvFJM60yD4lMVoNPJXFYfkwSWjrMwC1RbDjq3Sfjl X-Received: by 10.112.145.133 with SMTP id su5mr1429476lbb.17.1424793733306; Tue, 24 Feb 2015 08:02:13 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.136 with SMTP id e8ls213906lam.91.gmail; Tue, 24 Feb 2015 08:02:13 -0800 (PST) X-Received: by 10.152.21.100 with SMTP id u4mr14710866lae.41.1424793733108; Tue, 24 Feb 2015 08:02:13 -0800 (PST) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com. [2a00:1450:4010:c03::233]) by mx.google.com with ESMTPS id lu5si12657357lac.163.2015.02.24.08.02.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 08:02:12 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::233 as permitted sender) client-ip=2a00:1450:4010:c03::233; Received: by labgd6 with SMTP id gd6so26586108lab.7 for ; Tue, 24 Feb 2015 08:02:12 -0800 (PST) X-Received: by 10.112.135.196 with SMTP id pu4mr14716792lbb.41.1424793732791; Tue, 24 Feb 2015 08:02:12 -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 h5csp2000937lbj; Tue, 24 Feb 2015 08:02:11 -0800 (PST) X-Received: by 10.140.201.84 with SMTP id w81mr38961533qha.19.1424793729819; Tue, 24 Feb 2015 08:02:09 -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 l4si39507723qci.30.2015.02.24.08.02.08 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Feb 2015 08:02:09 -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 1YQHvz-0006hC-0m; Tue, 24 Feb 2015 16:02:07 +0000 Received: from rcdn-iport-9.cisco.com ([173.37.86.80]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQHvX-0006av-Cs for lng-odp@lists.linaro.org; Tue, 24 Feb 2015 16:01:39 +0000 X-IronPort-AV: E=Sophos;i="5.09,639,1418083200"; d="scan'208";a="395590123" Received: from alln-core-8.cisco.com ([173.36.13.141]) by rcdn-iport-9.cisco.com with ESMTP; 24 Feb 2015 16:01:34 +0000 Received: from cpp-rtpbld-55.cisco.com (cpp-rtpbld-55.cisco.com [172.18.5.199]) by alln-core-8.cisco.com (8.14.5/8.14.5) with ESMTP id t1OG1Xwu018611 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Feb 2015 16:01:33 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 t1OG1XW4028893; Tue, 24 Feb 2015 11:01:33 -0500 Received: (from robking@localhost) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8/Submit) id t1OG1WiU028892; Tue, 24 Feb 2015 11:01:32 -0500 From: Robbie King To: lng-odp@lists.linaro.org Date: Tue, 24 Feb 2015 11:00:46 -0500 Message-Id: <1424793647-28572-10-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: patch Subject: [lng-odp] [PATCHv4 09/10] linux-generic: schedule: add term_local 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::233 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_init.c | 19 ++++++++++++++++++- platform/linux-generic/odp_schedule.c | 14 ++++++++++++-- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 4b9630c..94103e5 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -59,6 +59,7 @@ int odp_crypto_term_global(void); int odp_schedule_init_global(void); int odp_schedule_term_global(void); int odp_schedule_init_local(void); +int odp_schedule_term_local(void); int odp_timer_init_global(void); int odp_timer_disarm_all(void); diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 0cb6cf8..4c0186a 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -148,5 +148,22 @@ int odp_init_local(void) int odp_term_local(void) { - return (odp_thread_term_local() > 0) ? 1 : 0; + int rc = 0; + int rc_thd = 0; + + if (odp_schedule_term_local()) { + ODP_ERR("ODP schedule local term failed.\n"); + rc = -1; + } + + rc_thd = odp_thread_term_local(); + if (rc_thd < 0) { + ODP_ERR("ODP thread local term failed.\n"); + rc = -1; + } else { + if (!rc) + rc = rc_thd; + } + + return rc; } diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 0749b67..1a96cd9 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include #include #include #include @@ -151,8 +152,12 @@ int odp_schedule_term_global(void) int i, j; for (i = 0; i < ODP_CONFIG_SCHED_PRIOS; i++) { - for (j = 0; j < QUEUES_PER_PRIO; j++) - odp_queue_destroy(sched->pri_queue[i][j]); + for (j = 0; j < QUEUES_PER_PRIO; j++) { + if (odp_queue_destroy(sched->pri_queue[i][j])) { + ODP_ERR("Sched term: Queue destroy fail.\n"); + rc = -1; + } + } } if (odp_pool_destroy(sched->pool) != 0) { @@ -187,6 +192,11 @@ int odp_schedule_init_local(void) return 0; } +int odp_schedule_term_local(void) +{ + memset(&sched_local, 0, sizeof(sched_local_t)); + return 0; +} void odp_schedule_mask_set(odp_queue_t queue, int prio) {