From patchwork Fri Jan 22 23:36: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: 60209 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp170714lbb; Fri, 22 Jan 2016 15:39:31 -0800 (PST) X-Received: by 10.55.26.215 with SMTP id l84mr7027461qkh.101.1453505969521; Fri, 22 Jan 2016 15:39:29 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id x130si9690262qka.101.2016.01.22.15.39.29; Fri, 22 Jan 2016 15:39:29 -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 1BD62617A7; Fri, 22 Jan 2016 23:39:29 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=UfIwotMR; 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 0FCF1618E2; Fri, 22 Jan 2016 23:37:40 +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 80EDF619BC; Fri, 22 Jan 2016 23:37:36 +0000 (UTC) Received: from mail-ob0-f173.google.com (mail-ob0-f173.google.com [209.85.214.173]) by lists.linaro.org (Postfix) with ESMTPS id B7EEA6167C for ; Fri, 22 Jan 2016 23:37:05 +0000 (UTC) Received: by mail-ob0-f173.google.com with SMTP id ba1so76643490obb.3 for ; Fri, 22 Jan 2016 15:37: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=lueJ0h1Mi+leSEZqm8djxDRsmBJhWPTm6PZNRc5+qfQ=; b=UfIwotMRqK58jDVHJ4Zb7vPvjcMUNHLFbyIsMZpbxJsDWa93/hy7gMMbjpRdzsFqm4 Uslh0jxZnnA6udsWOoR05o+68WbDkU11G8jSex4wrxHSbKgP5wezJnSmrJJLETAyXA+6 G5swF50RA747JJBqDsEmy7MHyBYWJbn188WSQ= 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=Pez3HNcZDfUQTQCLX7WhXdWU010o4Hb/6iGlXub35qZhoRle39s2aWh7Xra5Iptyb+ F0HVV06MnY+kF41aMx8bGFYRHnBHX6aFaDFYKM0eUbSNCqIzhvXJ7j7fZm7wnKtitw1j 1bT8dnPCGT7NF4xwO0OWtWrJSL9N16DL7w5XV75R/dL+fw4x58vvscyXlYPCKbzFdKn0 T4aLf1uD3Tgdv4/+2vS0ZKVxoJrLlktyUu2/Wvsj4b93vbBAV49xuPCm5saIG2aGorgn Rcw9Vi0HT/SQZ+MXbd58+wCEXCcO1V9muWSH8Ty3sKEDliNiya1uOGJbJe3ORtt5uPbQ HY0w== X-Gm-Message-State: AG10YORg9LrQpVlBuh7P8PnBHVDp81GoVKGbin4F0oCRXQZnr47se9+o4suHMKktk8LFMm4yF5U= X-Received: by 10.60.94.45 with SMTP id cz13mr4812749oeb.42.1453505825357; Fri, 22 Jan 2016 15:37: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 v142sm4331515oie.28.2016.01.22.15.37.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jan 2016 15:37: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: Fri, 22 Jan 2016 17:36:37 -0600 Message-Id: <1453505797-20108-4-git-send-email-gary.robertson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453505797-20108-1-git-send-email-gary.robertson@linaro.org> References: <1453505797-20108-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 */