From patchwork Tue Sep 15 10:42:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Savolainen, Petri \(Nokia - FI/Espoo\)" X-Patchwork-Id: 53632 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 1CE2922A22 for ; Tue, 15 Sep 2015 10:42:31 +0000 (UTC) Received: by wisv5 with SMTP id v5sf6546637wis.0 for ; Tue, 15 Sep 2015 03:42: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=IDIDlidkdqKBlAI6Jp0Tr8cjYEz530oGW3+WVmSZGB8=; b=WhTqIP/qHyuD115JktjzsDFvlZiJPb4GdRHGUkYMkeQhgjVk2vs35k4JGUOfmobd8N A7U0jQzY1vXaS/psYCV7yTLuwbOwLNTEsEoTp59a1rI3r6d0B665Yrxr/cLzsCAdnu23 4a3uH1lXvwnh4GZhotDsKAEAFbgKZfOIy5h397lqQrorBYoqUzqE7KrcYDGJq3okM7za PV3zlyxD8WpeRbAHrSl90U1AHNcTRA6EsJ8/yaeXajmo7P+LxlFJhzYtCvow+Chkw9VI GzPUEETIHJ7W5HBAGFUVKl8e98sPZLKF8wCl4LeMbS9AgdyAUlwWyB/xPKRohL8QWBjV 4kLg== X-Gm-Message-State: ALoCoQmylKfXuwNBdJs99HxUSgDbeYRVdzgXcuB2YxDHcnxTHzaJCc/TaFUDQiGeZLLjxLMB9cAd X-Received: by 10.180.87.199 with SMTP id ba7mr629703wib.5.1442313750345; Tue, 15 Sep 2015 03:42:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.168 with SMTP id c8ls627130laa.106.gmail; Tue, 15 Sep 2015 03:42:30 -0700 (PDT) X-Received: by 10.152.27.70 with SMTP id r6mr19399032lag.67.1442313750150; Tue, 15 Sep 2015 03:42:30 -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 c2si12882774lag.44.2015.09.15.03.42.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2015 03:42:30 -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 lahg1 with SMTP id g1so74947632lah.1 for ; Tue, 15 Sep 2015 03:42:30 -0700 (PDT) X-Received: by 10.112.129.202 with SMTP id ny10mr19729324lbb.112.1442313749987; Tue, 15 Sep 2015 03:42: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 w3csp1713092lbq; Tue, 15 Sep 2015 03:42:29 -0700 (PDT) X-Received: by 10.107.5.74 with SMTP id 71mr23430034iof.161.1442313747485; Tue, 15 Sep 2015 03:42:27 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id m27si12505262iod.163.2015.09.15.03.42.26; Tue, 15 Sep 2015 03:42: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 1749162CD5; Tue, 15 Sep 2015 10:42:26 +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 E076D62CB6; Tue, 15 Sep 2015 10:42: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 2CF8A62CB9; Tue, 15 Sep 2015 10:42:16 +0000 (UTC) Received: from demumfd002.nsn-inter.net (demumfd002.nsn-inter.net [93.183.12.31]) by lists.linaro.org (Postfix) with ESMTPS id BA4A961FB9 for ; Tue, 15 Sep 2015 10:42:14 +0000 (UTC) Received: from demuprx017.emea.nsn-intra.net ([10.150.129.56]) by demumfd002.nsn-inter.net (8.15.2/8.15.2) with ESMTPS id t8FAgCEx018507 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Sep 2015 10:42:12 GMT Received: from DEMUHTC002.nsn-intra.net ([10.159.42.33]) by demuprx017.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id t8FAgBob017763 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 15 Sep 2015 12:42:12 +0200 Received: from DEMUMBX002.nsn-intra.net ([169.254.3.192]) by DEMUHTC002.nsn-intra.net ([10.159.42.33]) with mapi id 14.03.0248.002; Tue, 15 Sep 2015 12:42:11 +0200 From: "Savolainen, Petri (Nokia - FI/Espoo)" To: EXT Bill Fischofer Thread-Topic: [lng-odp] [API-NEXT PATCH v2 3/3] api: config: removed ODP_CONFIG_MAX_THREADS Thread-Index: AQHQ7Ko7OJ/UF/zyu0y0aasmwAgaR549bEVw Date: Tue, 15 Sep 2015 10:42:10 +0000 Message-ID: References: <1441976144-20403-1-git-send-email-petri.savolainen@nokia.com> <1441976144-20403-3-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: 23732 X-purgate-ID: 151667::1442313732-0000538C-E4F4927A/0/0 X-Topics: patch Cc: LNG ODP Mailman List Subject: Re: [lng-odp] [API-NEXT PATCH v2 3/3] api: config: removed ODP_CONFIG_MAX_THREADS 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:55 PM To: Savolainen, Petri (Nokia - FI/Espoo) Cc: LNG ODP Mailman List Subject: Re: [lng-odp] [API-NEXT PATCH v2 3/3] api: config: removed ODP_CONFIG_MAX_THREADS On Fri, Sep 11, 2015 at 7:55 AM, Petri Savolainen > wrote: New thread API call odp_thread_count_max() replaces the preprocessor macro in the API. A macro is still used internally. Signed-off-by: Petri Savolainen > --- include/odp/api/config.h | 5 --- .../linux-generic/include/odp/plat/cpumask_types.h | 3 +- .../include/odp/plat/rwlock_recursive_types.h | 4 +-- .../linux-generic/include/odp_buffer_internal.h | 3 +- .../linux-generic/include/odp_config_internal.h | 29 ++++++++++++++++ platform/linux-generic/odp_thread.c | 9 ++--- platform/linux-generic/odp_thrmask.c | 4 +-- test/performance/odp_pktio_perf.c | 40 +++++++++++++++++++--- test/validation/thread/thread.c | 2 +- 9 files changed, 78 insertions(+), 21 deletions(-) create mode 100644 platform/linux-generic/include/odp_config_internal.h +#define __ODP_CONFIG_MAX_THREADS 128 We've been using one leading underscore for internal APIs. Should we be consistent here for internal constants? Changed to _ODP_INTERNAL_MAX_THREADS to highlight that this is internal define. It’s visible through odp.h, so must be clearly visible that it’s not part of API. -Petri diff --git a/include/odp/api/config.h b/include/odp/api/config.h index 302eaf5..bf88be8 100644 --- a/include/odp/api/config.h +++ b/include/odp/api/config.h @@ -24,11 +24,6 @@ extern "C" { */ /** - * Maximum number of threads - */ -#define ODP_CONFIG_MAX_THREADS 128 - -/** * Maximum number of pools */ #define ODP_CONFIG_POOLS 16 diff --git a/platform/linux-generic/include/odp/plat/cpumask_types.h b/platform/linux-generic/include/odp/plat/cpumask_types.h index 6fba832..d3bf988 100644 --- a/platform/linux-generic/include/odp/plat/cpumask_types.h +++ b/platform/linux-generic/include/odp/plat/cpumask_types.h @@ -23,11 +23,12 @@ extern "C" { */ #include +#include /** * Minimum size of output buffer for odp_cpumask_to_str() */ -#define ODP_CPUMASK_STR_SIZE ((ODP_CONFIG_MAX_THREADS + 3) / 4 + 3) +#define ODP_CPUMASK_STR_SIZE ((__ODP_CONFIG_MAX_THREADS + 3) / 4 + 3) /** * CPU mask diff --git a/platform/linux-generic/include/odp/plat/rwlock_recursive_types.h b/platform/linux-generic/include/odp/plat/rwlock_recursive_types.h index 9e220f5..0e20b40 100644 --- a/platform/linux-generic/include/odp/plat/rwlock_recursive_types.h +++ b/platform/linux-generic/include/odp/plat/rwlock_recursive_types.h @@ -19,7 +19,7 @@ extern "C" { #include #include -#include +#include /** * @internal @@ -29,7 +29,7 @@ struct odp_rwlock_recursive_s { odp_rwlock_t lock; /**< the lock */ int wr_owner; /**< write owner thread */ uint32_t wr_cnt; /**< write recursion count */ - uint8_t rd_cnt[ODP_CONFIG_MAX_THREADS]; /**< read recursion count */ + uint8_t rd_cnt[__ODP_CONFIG_MAX_THREADS]; /**< read recursion count */ }; /** @addtogroup odp_synchronizers diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index 4cacca1..7671ea7 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -30,6 +30,7 @@ extern "C" { #include #include #include +#include #define ODP_BITSIZE(x) \ ((x) <= 2 ? 1 : \ @@ -143,7 +144,7 @@ struct odp_buffer_hdr_t { /** @internal Compile time assert that the * allocator field can handle any allocator id*/ -_ODP_STATIC_ASSERT(INT16_MAX >= ODP_CONFIG_MAX_THREADS, +_ODP_STATIC_ASSERT(INT16_MAX >= __ODP_CONFIG_MAX_THREADS, "ODP_BUFFER_HDR_T__ALLOCATOR__SIZE_ERROR"); typedef struct odp_buffer_hdr_stride { diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h new file mode 100644 index 0000000..c60ec66 --- /dev/null +++ b/platform/linux-generic/include/odp_config_internal.h @@ -0,0 +1,29 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * Linux-generic platform internal configuration + */ + +#ifndef ODP_INTERNAL_CONFIG_H_ +#define ODP_INTERNAL_CONFIG_H_ The file is named odp_config_internal so shouldn't this be ODP_CONFIG_INTERNAL_H_ ? OK. + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Maximum number of threads + */