From patchwork Mon Feb 23 20:36:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 44921 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6C64621562 for ; Mon, 23 Feb 2015 20:38:00 +0000 (UTC) Received: by lamq1 with SMTP id q1sf13706206lam.0 for ; Mon, 23 Feb 2015 12:37:59 -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=clmXZF/YcH7bsIISWYOI6pUvKuSmm81pKRvqa6fv1Ps=; b=HeANKFMNNhdzWu7Vs0ix5n4h/cMg821FZHaiUR34M3TWShTon+U/qFoiu3pY0oQksh KAOARLauh1dyY9kZy5bIhLYYFaIgojBPBVuGTv6Vq0kaxKAGL0THQ4VPfn4QzCAVQd2r cDDvLcixsLFfgOAxkw6thJwsdSX/fc/2Y3TROlrow/AeDx+c8PHtJrCWN5A1LfQbpJCv xTNTeik7GVwW7dg5NF/yv5KvVdIZ/tkRCOb58evSiIOPkBye5i8vmYZekD9+JtUD83RW 6+nKXSR5Pd3m7f/R2yZb/4Gwr9hMrgbvOnvCHqI8KBOhc473g+4pai4G5qYqC0NEzoNB N4BA== X-Gm-Message-State: ALoCoQl+ptw9uyZMDr7Ek+V/B0itsatkhbTIpo79GASXiqozY/QJTfWPT/Ktmi1IE6nJttxvmYud X-Received: by 10.112.162.135 with SMTP id ya7mr1612796lbb.14.1424723879290; Mon, 23 Feb 2015 12:37:59 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.201 with SMTP id m9ls595784lah.6.gmail; Mon, 23 Feb 2015 12:37:59 -0800 (PST) X-Received: by 10.112.125.39 with SMTP id mn7mr11397652lbb.23.1424723879110; Mon, 23 Feb 2015 12:37:59 -0800 (PST) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com. [2a00:1450:4010:c04::229]) by mx.google.com with ESMTPS id vk9si15690421lbb.58.2015.02.23.12.37.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Feb 2015 12:37:59 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::229 as permitted sender) client-ip=2a00:1450:4010:c04::229; Received: by lbiz12 with SMTP id z12so20877041lbi.11 for ; Mon, 23 Feb 2015 12:37:59 -0800 (PST) X-Received: by 10.112.56.139 with SMTP id a11mr11490116lbq.36.1424723879036; Mon, 23 Feb 2015 12:37:59 -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 h5csp1500606lbj; Mon, 23 Feb 2015 12:37:58 -0800 (PST) X-Received: by 10.140.91.131 with SMTP id z3mr27561415qgd.1.1424723877663; Mon, 23 Feb 2015 12:37:57 -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 bt3si37038259qcb.47.2015.02.23.12.37.56 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 23 Feb 2015 12:37:57 -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 1YPzlK-0002r3-Jh; Mon, 23 Feb 2015 20:37:54 +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 1YPzkT-0002d1-UW for lng-odp@lists.linaro.org; Mon, 23 Feb 2015 20:37:02 +0000 X-IronPort-AV: E=Sophos;i="5.09,633,1418083200"; d="scan'208";a="126179352" Received: from alln-core-7.cisco.com ([173.36.13.140]) by alln-iport-3.cisco.com with ESMTP; 23 Feb 2015 20:36:58 +0000 Received: from cpp-rtpbld-55.cisco.com (cpp-rtpbld-55.cisco.com [172.18.5.199]) by alln-core-7.cisco.com (8.14.5/8.14.5) with ESMTP id t1NKavUm010877 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Feb 2015 20:36:58 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 t1NKav3J030663; Mon, 23 Feb 2015 15:36:57 -0500 Received: (from robking@localhost) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8/Submit) id t1NKauPX030662; Mon, 23 Feb 2015 15:36:56 -0500 From: Robbie King To: lng-odp@lists.linaro.org Date: Mon, 23 Feb 2015 15:36:08 -0500 Message-Id: <1424723769-8762-10-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: patch Subject: [lng-odp] [PATCHv3 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:c04::229 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 7426a97..ad36283 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) {