From patchwork Wed Feb 24 22:50:00 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: 62840 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2678971lbl; Wed, 24 Feb 2016 14:51:45 -0800 (PST) X-Received: by 10.107.14.20 with SMTP id 20mr36538ioo.39.1456354305823; Wed, 24 Feb 2016 14:51:45 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id ha8si333062igb.39.2016.02.24.14.51.45; Wed, 24 Feb 2016 14:51:45 -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 Received: by lists.linaro.org (Postfix, from userid 109) id 4303064D7A; Wed, 24 Feb 2016 22:51:45 +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 9832564DB1; Wed, 24 Feb 2016 22:50:38 +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 0E19D639D9; Wed, 24 Feb 2016 22:50:21 +0000 (UTC) Received: from mail-oi0-f52.google.com (mail-oi0-f52.google.com [209.85.218.52]) by lists.linaro.org (Postfix) with ESMTPS id 1CF7263014 for ; Wed, 24 Feb 2016 22:50:18 +0000 (UTC) Received: by mail-oi0-f52.google.com with SMTP id j125so28287335oih.0 for ; Wed, 24 Feb 2016 14:50:18 -0800 (PST) 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=Si3mZWxa5kcRR92EM21UUE59I+/hozewEFDy6vrgihI=; b=DUdSQEMssQZ+yDh14WvVoPPhmk52w3urBXoRuxJqKDNpSvovvzNmf0pyR/ysVJVjaj nU3ZBs3hA9AIJF5FtkzZxVZHxSgcUggIiaB47Eu0EVw8O9RH2nrQfyoQ+7hs9pOFDPUM chmOg7K/7c79tIEg964n30LewdtSaD1ZUUbp6ce1jj2FSVFtpwFGDGB7ei7XLSK3VpHU tAsFcexcjslCCmLlaj6nEXh4cjEDW6CVl4/2c0KwN43ABRZrwdDLQqC9WAEUjXVLkNId wBSrgXNNE+VqZjxmxaUUv6imp65ajaFEcpTI5/SGDH5cq5qVsLvWTT2+kcdMw7T6p/XE jg5g== X-Gm-Message-State: AG10YOTYLgPUbU42VuFbovcomGoZzqaxUHGx1dQiiGCzJFXRfB+Y7XaghJGNbd0nSCEBdCeu0zs= X-Received: by 10.202.186.193 with SMTP id k184mr32880419oif.66.1456354217685; Wed, 24 Feb 2016 14:50:17 -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 qs6sm3271948oeb.3.2016.02.24.14.50.16 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Feb 2016 14:50:16 -0800 (PST) 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, 24 Feb 2016 16:50:00 -0600 Message-Id: <1456354201-31304-4-git-send-email-gary.robertson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456354201-31304-1-git-send-email-gary.robertson@linaro.org> References: <1456354201-31304-1-git-send-email-gary.robertson@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [API-NEXT PATCH 3/4] 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/spec/init.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h index 2c98109..c369d7f 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. @@ -118,6 +119,44 @@ 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. + Validation of the contents of this cpumask is implementation + and installation dependent and outside the scope of ODP definition. + 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. + Validation of the contents of this cpumask is implementation + and installation dependent and outside the scope of ODP definition. + 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 */