From patchwork Thu Mar 31 13:08:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 64781 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp149702lbc; Thu, 31 Mar 2016 06:11:51 -0700 (PDT) X-Received: by 10.140.238.76 with SMTP id j73mr17309248qhc.49.1459429911166; Thu, 31 Mar 2016 06:11:51 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b124si7640882qhd.126.2016.03.31.06.11.50; Thu, 31 Mar 2016 06:11:51 -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 C788961A11; Thu, 31 Mar 2016 13:11:50 +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 1604F61A0B; Thu, 31 Mar 2016 13:08:53 +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 6FB9C619DD; Thu, 31 Mar 2016 13:08:50 +0000 (UTC) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com [209.85.218.51]) by lists.linaro.org (Postfix) with ESMTPS id D13EE619E6 for ; Thu, 31 Mar 2016 13:08:21 +0000 (UTC) Received: by mail-oi0-f51.google.com with SMTP id r187so59275196oih.3 for ; Thu, 31 Mar 2016 06:08:21 -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=nrS5Uw4hVgQ1gC2dL/vXQhDJwT4DLJV36pKWzU02+/Q=; b=O5obYLmjS2/EH5BvG6fy+3aGKCkkB/SnSVEnZdrL7OPk+UlkPlXyrO/wxmV81oVHHy Nys8Fbl7PWn+Zktv25ocdorvMV2EEjxf4L3zOLQ59pjerHDS77vn4ZwZtaTYhuBvairg l7fY0yTuD78d+32GayG771D9Ev1LwPtA7bK7UyE3g4j2H0dss+ppMeRZuOiVgtBD5JiQ JFc+jUDKeeBfiL+zzBo8RcR3GBjXioaHlUfL/Hp3pdQSqzUEbaKCV2dk0vE5v0ebs1eq fgXWbpF6V4TkEHGwjFqvuXpTiv+79WjN/4diy4UC3sLn4zF+dyILHXhtr9N6Tqvv1edl MTxg== X-Gm-Message-State: AD7BkJLncHCxcPeSDh2bTrYA0M8WBuMbXhUwK0oRxGF6kt4TkBSJb8xsRAWuQiXMTas5Z++Wotg= X-Received: by 10.157.36.80 with SMTP id p74mr8382108ota.17.1459429701359; Thu, 31 Mar 2016 06:08:21 -0700 (PDT) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id yn3sm2668627obc.27.2016.03.31.06.08.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Mar 2016 06:08:20 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 31 Mar 2016 08:08:13 -0500 Message-Id: <1459429694-6832-5-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459429694-6832-1-git-send-email-bill.fischofer@linaro.org> References: <1459429694-6832-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv7 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" From: "Gary S. Robertson" 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 Signed-off-by: Bill Fischofer --- 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 */