From patchwork Wed Mar 30 22:09:55 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: 64733 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2842472lbc; Wed, 30 Mar 2016 15:11:49 -0700 (PDT) X-Received: by 10.55.74.9 with SMTP id x9mr12959981qka.81.1459375909162; Wed, 30 Mar 2016 15:11:49 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 18si5637879qhf.16.2016.03.30.15.11.48; Wed, 30 Mar 2016 15:11:49 -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; 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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D29B361A07; Wed, 30 Mar 2016 22:11:48 +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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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 4184461A12; Wed, 30 Mar 2016 22:10:51 +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 3A23861A07; Wed, 30 Mar 2016 22:10:45 +0000 (UTC) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by lists.linaro.org (Postfix) with ESMTPS id CBCC161A0A for ; Wed, 30 Mar 2016 22:10:26 +0000 (UTC) Received: by mail-ob0-f182.google.com with SMTP id x3so84615555obt.0 for ; Wed, 30 Mar 2016 15:10:26 -0700 (PDT) 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=zoEP2xts7rz4lxqVuMLQYWwdg4Eskan0N6HZe7egfgM=; b=bvXUF6cF9hYhsGPda6TOkClucjMl6bj3zaIUygvhz2/oXPn6cFT3kv7xsyti3o4eGp IfXStUYqAsXRTcD99I1GFQ5uZT05v2Y7Hzd1I5fWvH/zaFs0yAYHWg0pWwT1WhHoJtn4 sHcqeDq3wZx0IeZN/ANO5dAAT0s1luIPpGSXLTIAxqq6BjNDzNE7oeZy8BfojaxnBUDc ZSiqNTH54baU9n8xxPBFJT6PtH7fuTFM/1bSrzv7QkI+LD7QfTgiPyjlAuMdvRLHbdte 55QFN1z5neaGkG4QG8n0BzmJoZD7EQxpAPmEWBKWlBzn5nmBp5qQlHMYQTIMaKN1btBs 42Nw== X-Gm-Message-State: AD7BkJJNCp/kIMfMmcu2mFggieduFLoJ+X0TPeAeAxeIsqmX/SK8aXxX3b61xpUP+GxubPokKz8= X-Received: by 10.182.50.136 with SMTP id c8mr6801811obo.66.1459375826423; Wed, 30 Mar 2016 15:10:26 -0700 (PDT) Received: from honkintosh.cybertech.lan (65-120-133-114.dia.static.qwest.net. [65.120.133.114]) by smtp.googlemail.com with ESMTPSA id 91sm1813924otg.16.2016.03.30.15.10.23 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Mar 2016 15:10:25 -0700 (PDT) From: "Gary S. Robertson" To: mike.holmes@linaro.org, bill.fischofer@linaro.org, maxim.uvarov@linaro.org, anders.roxell@linaro.org, petri.savolainen@linaro.org Date: Wed, 30 Mar 2016 17:09:55 -0500 Message-Id: <1459375796-23992-5-git-send-email-gary.robertson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459375796-23992-1-git-send-email-gary.robertson@linaro.org> References: <1456929250-7720-1-git-send-email-gary.robertson@linaro.org> <1459375796-23992-1-git-send-email-gary.robertson@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [api-next][PATCH V6 4/5] api: init: 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 pointers to externally supplied cpumasks for control and worker CPUs 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 pointers would be NULL unless explicitly populated prior to calling odp_init_global. odp_init_global would respond to NULL pointers here by ensuring that odp_cpumask_default_control and odp_cpumask_default_worker would return the platform-specific default CPU configurations. If these pointers were not NULL when odp_init_global was called, then the above functions would return cpumasks reflecting the (possibly amended) contents of the referenced cpumasks instead of the platform defaults. Signed-off-by: Gary S. Robertson --- include/odp/api/spec/init.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h index 47ebd54..8560663 100644 --- a/include/odp/api/spec/init.h +++ b/include/odp/api/spec/init.h @@ -31,6 +31,7 @@ extern "C" { #include #include #include +#include /** @defgroup odp_initialization ODP INITIALIZATION * Initialisation operations. @@ -123,6 +124,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; + /** Pointer to bit mask mapping CPUs available to this ODP instance + for running worker threads. + Initialize to a NULL pointer to use default CPU mapping. + When the mask is defined, odp_cpumask_default_worker() + uses it instead of returning a default mask. + Applications code should not access this cpumask directly. + Valid range of CPUs and optimal CPU selection + are platform specific, but generally it is recommended that: + * worker CPUs are dedicated to run only ODP worker threads + (one thread per CPU) + * worker and control masks do not overlap + * different ODP instances do not specify overlapping + worker masks + */ + const odp_cpumask_t *worker_cpus; + /** Pointer to bit mask mapping CPUs available to this ODP instance + for running control threads. + Initialize to a NULL pointer to use default CPU mapping. + When the mask is defined, odp_cpumask_default_control() + uses it instead of returning a default mask. + Applications code should not access this cpumask directly. + Valid range of CPUs and optimal CPU selection + are platform specific, but generally it is recommended that + worker and control masks do not overlap. + */ + const odp_cpumask_t *control_cpus; /** Replacement for the default log fn */ odp_log_func_t log_fn; /** Replacement for the default abort fn */