From patchwork Mon Sep 14 14:23:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Savolainen, Petri \(Nokia - FI/Espoo\)" X-Patchwork-Id: 53588 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 patches.linaro.org (Postfix) with ESMTPS id 93FCB2056A for ; Mon, 14 Sep 2015 14:23:31 +0000 (UTC) Received: by lbbmp1 with SMTP id mp1sf46168154lbb.2 for ; Mon, 14 Sep 2015 07:23:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:thread-topic :thread-index:date:message-id:references:in-reply-to:accept-language :content-language:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=Cyqz1WRngdqs1VoKl7t20sfFZeQZTWKH08UdqmaWiZE=; b=hgXDaFSMsjJnMyN7UqR2pPYH2QPaKdyUWqMgsTypj4nhsNGtJsSk0tqOBubkmJ2yrv crWz4k3IY/vUv3MYVIOxF2tBabztuRhFK8v2yNnS9oyzDAXxhGHZ/Slqs3h5JMyrOWwX xDNClZYiGpyEcKGoHS++jwa9ldFYlYZVoyo/u/1x1OddLRIH/9O58WUHDGtlCaaTxETS Qlv3T4dbChotqrfj/AZuS8OJDi8s1+TN8XBY91kV7ounl+/L1nTRacxYjRKydmZRBOPy spzkhsB7ex7O3feZNzyRnm7FKixoX+unsWkiK9f9UuSQFqAdUmuFEkxwgBcqwDKli3qo QqzA== X-Gm-Message-State: ALoCoQkirviy5y1tTVSSKWC3lUIgzYf0JYq1dN0iXb5GCXP3+ObcgfuuZSzOOixrVni01dBH31Ci X-Received: by 10.180.100.71 with SMTP id ew7mr2977635wib.0.1442240610040; Mon, 14 Sep 2015 07:23:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.168 with SMTP id o8ls519439lae.47.gmail; Mon, 14 Sep 2015 07:23:29 -0700 (PDT) X-Received: by 10.112.180.98 with SMTP id dn2mr14640518lbc.0.1442240609821; Mon, 14 Sep 2015 07:23:29 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id dl10si9873570lad.154.2015.09.14.07.23.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 07:23:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lanb10 with SMTP id b10so87503663lan.3 for ; Mon, 14 Sep 2015 07:23:29 -0700 (PDT) X-Received: by 10.152.28.9 with SMTP id x9mr5509313lag.73.1442240609511; Mon, 14 Sep 2015 07:23:29 -0700 (PDT) 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.59.35 with SMTP id w3csp1228330lbq; Mon, 14 Sep 2015 07:23:27 -0700 (PDT) X-Received: by 10.140.129.212 with SMTP id 203mr23568869qhb.46.1442240607093; Mon, 14 Sep 2015 07:23:27 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g205si12199774qhc.20.2015.09.14.07.23.25; Mon, 14 Sep 2015 07:23:27 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id BC5F961D55; Mon, 14 Sep 2015 14:23:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 4973261CDF; Mon, 14 Sep 2015 14:23:17 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A66A061CE9; Mon, 14 Sep 2015 14:23:14 +0000 (UTC) Received: from demumfd002.nsn-inter.net (demumfd002.nsn-inter.net [93.183.12.31]) by lists.linaro.org (Postfix) with ESMTPS id 50E34619DA for ; Mon, 14 Sep 2015 14:23:13 +0000 (UTC) Received: from demuprx016.emea.nsn-intra.net ([10.150.129.55]) by demumfd002.nsn-inter.net (8.15.2/8.15.2) with ESMTPS id t8EEN6v2028766 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Sep 2015 14:23:06 GMT Received: from DEMUHTC004.nsn-intra.net ([10.159.42.35]) by demuprx016.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id t8EEN5I2017695 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 14 Sep 2015 16:23:05 +0200 Received: from DEMUHTC012.nsn-intra.net (10.159.42.43) by DEMUHTC004.nsn-intra.net (10.159.42.35) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 14 Sep 2015 16:23:04 +0200 Received: from DEMUMBX002.nsn-intra.net ([169.254.3.192]) by DEMUHTC012.nsn-intra.net ([10.159.42.43]) with mapi id 14.03.0248.002; Mon, 14 Sep 2015 16:23:04 +0200 From: "Savolainen, Petri (Nokia - FI/Espoo)" To: EXT Bill Fischofer Thread-Topic: [lng-odp] [API-NEXT PATCH v2 2/3] api: thread: added thread count max Thread-Index: AQHQ7Klzqdgk3qG2OEuifujqQ42NQZ48F2Kg Date: Mon, 14 Sep 2015 14:23:04 +0000 Message-ID: References: <1441976144-20403-1-git-send-email-petri.savolainen@nokia.com> <1441976144-20403-2-git-send-email-petri.savolainen@nokia.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.159.42.103] MIME-Version: 1.0 X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-size: 19476 X-purgate-ID: 151667::1442240586-0000538C-28A2582D/0/0 X-Topics: patch Cc: LNG ODP Mailman List Subject: Re: [lng-odp] [API-NEXT PATCH v2 2/3] api: thread: added thread count max X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: petri.savolainen@nokia.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mailfrom=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 From: EXT Bill Fischofer [mailto:bill.fischofer@linaro.org] Sent: Friday, September 11, 2015 6:50 PM To: Savolainen, Petri (Nokia - FI/Espoo) Cc: LNG ODP Mailman List Subject: Re: [lng-odp] [API-NEXT PATCH v2 2/3] api: thread: added thread count max On Fri, Sep 11, 2015 at 7:55 AM, Petri Savolainen > wrote: Maximum thread count is needed for preparation to remove ODP_CONFIG_MAX_THREADS. It can be used e.g. to allocate resources per thread ID. Thread IDs range from 0 to count_max - 1. Signed-off-by: Petri Savolainen > --- include/odp/api/thread.h | 14 ++++++++++++-- platform/linux-generic/odp_thread.c | 5 +++++ 2 files changed, 17 insertions(+), 2 deletions(-) return this_thread->type; -- 2.5.1 _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp diff --git a/include/odp/api/thread.h b/include/odp/api/thread.h index 89eae2b..746a830 100644 --- a/include/odp/api/thread.h +++ b/include/odp/api/thread.h @@ -54,7 +54,7 @@ typedef enum odp_thread_type_e { * Get thread identifier * * Returns the thread identifier of the current thread. Thread ids range from 0 - * to ODP_CONFIG_MAX_THREADS-1. The ODP thread id is assinged by + * to odp_thread_count_max() - 1. The ODP thread id is assinged by * odp_init_local() and freed by odp_term_local(). Thread id is unique within * the ODP instance. * @@ -68,13 +68,23 @@ int odp_thread_id(void); * Returns the current ODP thread count. This is the number of active threads * running the ODP instance. Each odp_init_local() call increments and each * odp_term_local() call decrements the count. The count is always between 1 and - * ODP_CONFIG_MAX_THREADS. + * odp_thread_count_max(). * * @return Current thread count */ int odp_thread_count(void); /** + * Maximum thread count + * + * Returns the maximum thread count, which is a constant value and set in + * ODP initialization phase. + * + * @return Maximum thread count + */ +int odp_thread_count_max(void); Should be: const int odp_thread_count_max(void); Since these are implementation-defined constants that are being returned. In file included from ./include/odp/thread.h:28:0, from ./include/odp_buffer_internal.h:30, from ./include/odp_pool_internal.h:25, from odp_buffer.c:8: ../../include/odp/api/thread.h:85:11: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers] const int odp_thread_count_max(void); It fails to build with our compiler warning level. Compiler seems to ignore const as function return type qualifier. -Petri + +/** * Thread type * * Returns the thread type of the current thread. diff --git a/platform/linux-generic/odp_thread.c b/platform/linux-generic/odp_thread.c index 770c64e..a8ce133 100644 --- a/platform/linux-generic/odp_thread.c +++ b/platform/linux-generic/odp_thread.c @@ -204,6 +204,11 @@ int odp_thread_count(void) return thread_globals->num; } +int odp_thread_count_max(void) const int odp_thread_count_max(void) +{ + return __ODP_CONFIG_MAX_THREADS; +} + odp_thread_type_t odp_thread_type(void) {