From patchwork Wed Jan 13 20:00:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gary.robertson@linaro.org X-Patchwork-Id: 59678 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3574893lbb; Wed, 13 Jan 2016 12:01:13 -0800 (PST) X-Received: by 10.140.84.200 with SMTP id l66mr86189qgd.90.1452715273474; Wed, 13 Jan 2016 12:01:13 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id x130si2934418qka.101.2016.01.13.12.01.12; Wed, 13 Jan 2016 12:01:13 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id AFE48617A0; Wed, 13 Jan 2016 20:01:12 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=N3Bb/OsT; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,T_DKIM_INVALID,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 A44D961707; Wed, 13 Jan 2016 20:01:08 +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 A8B0C6179E; Wed, 13 Jan 2016 20:01:06 +0000 (UTC) Received: from mail-qg0-f53.google.com (mail-qg0-f53.google.com [209.85.192.53]) by lists.linaro.org (Postfix) with ESMTPS id D65506107B for ; Wed, 13 Jan 2016 20:01:05 +0000 (UTC) Received: by mail-qg0-f53.google.com with SMTP id o11so463481794qge.2 for ; Wed, 13 Jan 2016 12:01:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A6yqstOq4/JL1OrXrmwQi38B5OZrwilRuAFi7ks3yTw=; b=N3Bb/OsTv+CCEZtvBIeP+cJTXk4ibErFVi+IGon7OoCMjFkzSeWAuzW8SNtWmJPlcE xZcBTFO9YpqCasELDWJHxhCkCu9X13XoNPryt0y/gE9GvpZuIQMY9t+gfRCKrKetMv0Z dSZecWnW8lxXB4huBodjDd5Z3hDSjRFkwjb8Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=A6yqstOq4/JL1OrXrmwQi38B5OZrwilRuAFi7ks3yTw=; b=PAXD51dDUUNQ4GB/+kzei2bKtE1GyHl3yJ9QJUAOfynFtzVJbXSHL2lqpaCCdPCPlN w80+c2rGNUdqR9VINPDNHPUFie7qIK04e51qcsYsjtGfyrD17E2MINL9LnKh/P8LIcjQ kv2fmG3pYX3JBAflnuczLISPUUCNHuRZeLBBQd8xsuR5eOR4gPkoPPHaLY/Vcxlhibab BQ0CudcA/CmOrHuvALUVcrwJkCtyWoEhPSzNvtjjkrnK/yZp9cPl+9NVuNIRrGMkK/YY B/YEO2wwo6dAkT0l8ZKhvS64Wo0N3pL5pI+6oZPs5N5hD4hVjvv+Bti4zCabuCoTbcMs jA+Q== X-Gm-Message-State: ALoCoQksvpUXX1bzl110W1lZTGm3nVSfJVdmzc28K26g3i2MpmZ4gij0DceHKsTfsh6gC+arw4TBWc5zJVIhOeZf3pFHotQc1Q== X-Received: by 10.140.81.211 with SMTP id f77mr65460qgd.11.1452715265631; Wed, 13 Jan 2016 12:01:05 -0800 (PST) Received: from honkintosh.cybertech.lan (65-120-133-114.dia.static.qwest.net. [65.120.133.114]) by smtp.googlemail.com with ESMTPSA id j69sm1114136qkh.21.2016.01.13.12.01.03 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jan 2016 12:01:04 -0800 (PST) From: "Gary S. Robertson" To: mike.holmes@linaro.org, bill.fischofer@linaro.org, maxim.uvarov@linaro.org, anders.roxell@linaro.org, stuart.haslam@linaro.org, petri.savolainen@linaro.org Date: Wed, 13 Jan 2016 14:00:39 -0600 Message-Id: <1452715239-15255-2-git-send-email-gary.robertson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452715239-15255-1-git-send-email-gary.robertson@linaro.org> References: <1452715239-15255-1-git-send-email-gary.robertson@linaro.org> Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [API_NEXT RFC 01/01] ODP API: add control/worker cpumasks to init data X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" 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" Adds cpumasks for control and worker cores to the ODP global init data which is passed as an argument to odp_init_global. The intent is to allow an external entity to pass in lists of the CPU resources available to the current ODP application. It is assumed that these masks would by default be initialized to zeros and would thus be empty unless explicitly populated prior to calling odp_init_global. odp_init_global would respond to empty cpumasks here by ensuring that odp_cpumask_default_control and odp_cpumask_default_worker would return the platform-specific default CPU configurations... but if the initial cpumasks were not empty when odp_init_global was called, then the above functions would return cpumasks reflecting the (possibly amended) contents of the initially specified cpumasks instead of the platform defaults. Signed-off-by: Gary S. Robertson --- include/odp/api/init.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/include/odp/api/init.h b/include/odp/api/init.h index e667d25..324081b 100644 --- a/include/odp/api/init.h +++ b/include/odp/api/init.h @@ -31,6 +31,7 @@ extern "C" { #include #include #include +#include /** @defgroup odp_initialization ODP INITIALIZATION * Initialisation operations. @@ -118,6 +119,32 @@ typedef struct odp_init_t { Valid range is from 0 to platform specific maximum. Set both num_worker and num_control to zero for default number of threads. */ int num_control; + /** Mask mapping CPUs available to this ODP instance for running + worker threads. + Valid range is from 0 to platform specific maximum CPU. + Initialize to an empty set to use default cpu mapping and + default isolation setup (or the lack of isolation) for + worker CPUs. + Explicit population of this cpumask implies that the platform + implementation should (optionally) provide isolation support + for the CPUs designated by that population, to whatever extent + such isolation is supportable on the platform. + Any CPU isolation support provided by the underlying platform + implementation will be disabled if a range is specified + which overlaps the control CPU map. */ + odp_cpumask_t worker_cpus; + /** Mask mapping CPUs available to this ODP instance for running + control threads. + Valid range is from 0 to platform specific maximum CPU. + Initialize to an empty set to use default cpu mapping for + control CPUs. + Control CPUs are expected to provide shared, non-isolated + runtime environments for control threads. + It is therefore expected that - if this cpumask is explicitly + populated - this cpumask will be identical for all ODP instances + running concurrently on the underlying platform and will specify + CPU resources to be shared among all concurrent ODP instances. */ + odp_cpumask_t control_cpus; /** Replacement for the default log fn */ odp_log_func_t log_fn; /** Replacement for the default abort fn */