From patchwork Mon Mar 28 16:11:37 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: 64540 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1532602lbc; Mon, 28 Mar 2016 09:14:59 -0700 (PDT) X-Received: by 10.107.63.215 with SMTP id m206mr3399167ioa.15.1459181699755; Mon, 28 Mar 2016 09:14:59 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n7si24020723ioi.144.2016.03.28.09.14.59; Mon, 28 Mar 2016 09:14:59 -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 Received: by lists.linaro.org (Postfix, from userid 109) id 2C6A76187F; Mon, 28 Mar 2016 16:14:59 +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_H2, 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 03CA0610A9; Mon, 28 Mar 2016 16:12:30 +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 3ED9461589; Mon, 28 Mar 2016 16:12:25 +0000 (UTC) Received: from mail-oi0-f43.google.com (mail-oi0-f43.google.com [209.85.218.43]) by lists.linaro.org (Postfix) with ESMTPS id 1D54561852 for ; Mon, 28 Mar 2016 16:11:52 +0000 (UTC) Received: by mail-oi0-f43.google.com with SMTP id d205so176421337oia.0 for ; Mon, 28 Mar 2016 09:11:52 -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=iNmBMAOJpc179pEAGABrzz3ojeUgpKgHii6W4QfJT/s=; b=ayxFsfaeG/Cp+PxwEvpNgu/5v9YH4wtBTgCFegzlDtUd3y+zo9HapE6Ipkz3i+dGe2 8qR10gamtVeuJb2/XMIpazSBJDDlXYupx0sfiWJpqFy7SQ62wjtjML6Kk+ndp6KmnN6j d0TgZlposoFzAw3fHlYwuHmPKpaMemxT/Z6YTOaH/mBV7R3yxtIxFHV21vYTiOq/BYfK IG/pr+iWcSCxAZlrjoj/DPld5SV81YOCT8LLl/no5WjaBJfBhUyvKa7QOfyyVVNI0oz0 i9mtYR25qBKRV5EMsxHV6yaXjakDn7f/z6bBvcecCfK9JiNZObtMqbyb9f4bBY0ShE88 4uAA== X-Gm-Message-State: AD7BkJLJQseIBclvcycGn2V6V1+AUu53WsgIi1tndjPnSKOFj5wNBTrFSPpvSGa8xMxRXnPGBxU= X-Received: by 10.202.95.68 with SMTP id t65mr11171643oib.7.1459181511673; Mon, 28 Mar 2016 09:11:51 -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 19sm8047972ote.18.2016.03.28.09.11.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Mar 2016 09:11:51 -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: Mon, 28 Mar 2016 11:11:37 -0500 Message-Id: <1459181498-8134-5-git-send-email-gary.robertson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459181498-8134-1-git-send-email-gary.robertson@linaro.org> References: <1456929250-7720-1-git-send-email-gary.robertson@linaro.org> <1459181498-8134-1-git-send-email-gary.robertson@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH 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..df91ed8 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 + */ + 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. + */ + odp_cpumask_t *control_cpus; /** Replacement for the default log fn */ odp_log_func_t log_fn; /** Replacement for the default abort fn */