From patchwork Fri Jan 22 23:37: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: 60211 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp171883lbb; Fri, 22 Jan 2016 15:42:17 -0800 (PST) X-Received: by 10.50.43.133 with SMTP id w5mr5884653igl.52.1453506133866; Fri, 22 Jan 2016 15:42:13 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h8si8054399igh.28.2016.01.22.15.42.13; Fri, 22 Jan 2016 15:42: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 358C6619EE; Fri, 22 Jan 2016 23:42:13 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=X742TMO9; 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_H3, RCVD_IN_MSPIKE_WL, 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 6CB7C61A30; Fri, 22 Jan 2016 23:39:46 +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 61019618E2; Fri, 22 Jan 2016 23:39:39 +0000 (UTC) Received: from mail-ob0-f169.google.com (mail-ob0-f169.google.com [209.85.214.169]) by lists.linaro.org (Postfix) with ESMTPS id D501661A47 for ; Fri, 22 Jan 2016 23:37:55 +0000 (UTC) Received: by mail-ob0-f169.google.com with SMTP id vt7so75649294obb.1 for ; Fri, 22 Jan 2016 15:37:55 -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=lueJ0h1Mi+leSEZqm8djxDRsmBJhWPTm6PZNRc5+qfQ=; b=X742TMO9jeVv4RMKHBP+PGrycZ+r2LeuhKxnscCl19mV2cShbE51rkwXt8s9khU83k yahknRy+axFiOLstyPFS972cEkmxpAeZooKXFiiKzx31OUpCWqDMY9PFNmuj1u4cri61 fpjtmoU7IljH1u6Y+Z6mlzPfBqPlCOjGEAcG8= 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=lueJ0h1Mi+leSEZqm8djxDRsmBJhWPTm6PZNRc5+qfQ=; b=ka68fzUNQA2/iqYMkREvmQDfcAyGSngFsSRZLNm30t67Revev+IJO3u0NDjBMHuUjU si5mJq8du0tbKvmPSHM+pzn3iuSxnx5pK9CprabiwR/gp5TSx1ifzqHYHgg1ylII8lRy K++iW4Z32iHPcq2zJQPV+EX1+X0usjeiUTQQPOa8ek/C/19t0W1+hhTI+rHuPc+yE0Bp EWHw3vMxoExcOaq1mlRB6aukMFRFJXVdSnZWS3g8ZCOwEBEWb3Kzhln9nzUkqfmYA9dD lS5gIOYSb/sX5tlZ6zuYCuLQD4tT/Ddu4m2BRgSKocft6UacsyoKscKsZCcUjsDQUxNc e82A== X-Gm-Message-State: AG10YOQDDF2Esar0oQrgtIPGRPQ0mCfyQhjLy3d5E6RWfIiu84FTvGEMGzE2vpvpE3SC0sfNKSo= X-Received: by 10.182.98.227 with SMTP id el3mr4563295obb.8.1453505875432; Fri, 22 Jan 2016 15:37:55 -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 s7sm4372237obk.17.2016.01.22.15.37.53 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jan 2016 15:37:54 -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: Fri, 22 Jan 2016 17:37:39 -0600 Message-Id: <1453505859-20419-4-git-send-email-gary.robertson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453505859-20419-1-git-send-email-gary.robertson@linaro.org> References: <1453505859-20419-1-git-send-email-gary.robertson@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [API_NEXT PATCH V3 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 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/init.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/include/odp/api/init.h b/include/odp/api/init.h index e667d25..448a520 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,40 @@ 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. + Valid range for mask is from 0 to platform specific maximum CPU. + Initialize to a NULL pointer to use default cpu mapping and + default isolation setup (or the lack of isolation) for + worker CPUs. + If worker CPUs are expected to provide isolated runtime + environments for worker threads, then the contents of this cpumask + should be unique for each ODP instance running concurrently + on the underlying platform, and should not contain any + control CPUs. + This cpumask is used only to convey externally supplied + information regarding worker CPU resources available to this + ODP instance during initialization. Applications code must call + odp_cpumask_default_worker() to obtain information as to the + CPU resources available for worker threads. */ + odp_cpumask_t *worker_cpus; + /** Pointer to bit mask mapping CPUs available to this ODP instance + for running control threads. + Valid range for mask is from 0 to platform specific maximum CPU. + Initialize to a NULL pointer to use default cpu mapping for + control CPUs. + Control CPUs are expected to provide shared, non-isolated + runtime environments for control threads. + It must therefore be anticipated that this cpumask may be + identical for all ODP instances running concurrently + on the underlying platform and may specify CPU resources + to be shared among all concurrent ODP instances. + This cpumask is used only to convey externally supplied + information regarding control CPU resources available to this + ODP instance during initialization. Applications code must call + odp_cpumask_default_control() to obtain information as to the + CPU resources available for control threads. */ + odp_cpumask_t *control_cpus; /** Replacement for the default log fn */ odp_log_func_t log_fn; /** Replacement for the default abort fn */