From patchwork Sat Aug 8 03:02:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 52056 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id 70C6520539 for ; Sat, 8 Aug 2015 03:04:11 +0000 (UTC) Received: by lbsm2 with SMTP id m2sf9707303lbs.1 for ; Fri, 07 Aug 2015 20:04:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=fxHfoQUt8YFSXEsfz+f9VIXrQ5iYGLQyBmkNjd5DlpQ=; b=QDBAJbr4YgSoWkDGARC7TGIuK+unOp+9m3P6uo4cQyrj+zxtl9jwZV+7TjzfC9xQXR vpIE7xrxMVlohZnIV6/oABSVFPVYPgkIOIN9toMh5gVTsRuFQhvnO0ydmVywQUBHV25L jXF4zURJOkjJxgluFEjpBxM+sCG1qBv/DDXqAyaHaFtLClZpKR5ucInPjjtNt/GodO6w BS8NUMZ+hGdlkPKdkHLipGVMpmL6pcqXc9b2AtPRHZtCDmdoH9lKV5BwcnTigi7eAWQg fQU0Q4mlILxc6OtvVHVZi/osiYwVB5ELT+zf8Yni5efPLwJbTmn42jF7AxdQZlUwxR2y iO2w== X-Gm-Message-State: ALoCoQn1MaxIDZwXXJK7YBGT+arIzGhO1ufv39Gx9NTJX2Eb/4hFNSj7uMz5yVzinGTG4dMayZZa X-Received: by 10.180.11.226 with SMTP id t2mr393107wib.0.1439003050182; Fri, 07 Aug 2015 20:04:10 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.100 with SMTP id a4ls552241lah.52.gmail; Fri, 07 Aug 2015 20:04:10 -0700 (PDT) X-Received: by 10.112.161.197 with SMTP id xu5mr11049334lbb.69.1439003050014; Fri, 07 Aug 2015 20:04:10 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id e10si9089021lam.131.2015.08.07.20.04.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Aug 2015 20:04:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by labd1 with SMTP id d1so17533186lab.1 for ; Fri, 07 Aug 2015 20:04:09 -0700 (PDT) X-Received: by 10.112.166.2 with SMTP id zc2mr10991812lbb.29.1439003049866; Fri, 07 Aug 2015 20:04:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp717026lba; Fri, 7 Aug 2015 20:04:08 -0700 (PDT) X-Received: by 10.107.28.67 with SMTP id c64mr11838331ioc.90.1439003047716; Fri, 07 Aug 2015 20:04:07 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z3si986376igl.24.2015.08.07.20.04.06; Fri, 07 Aug 2015 20:04:07 -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; Received: by lists.linaro.org (Postfix, from userid 109) id B8475623AB; Sat, 8 Aug 2015 03:04:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal 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 ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id A4AB762397; Sat, 8 Aug 2015 03:03:25 +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 0D64062392; Sat, 8 Aug 2015 03:03:21 +0000 (UTC) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) by lists.linaro.org (Postfix) with ESMTPS id D46436238F for ; Sat, 8 Aug 2015 03:03:19 +0000 (UTC) Received: by oio137 with SMTP id 137so62095530oio.0 for ; Fri, 07 Aug 2015 20:03:19 -0700 (PDT) X-Received: by 10.202.97.197 with SMTP id v188mr9476691oib.100.1439002999207; Fri, 07 Aug 2015 20:03:19 -0700 (PDT) Received: from localhost.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by smtp.gmail.com with ESMTPSA id kp7sm7375667oeb.14.2015.08.07.20.03.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Aug 2015 20:03:18 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Fri, 7 Aug 2015 22:02:59 -0500 Message-Id: <1439002992-29285-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1439002992-29285-1-git-send-email-bill.fischofer@linaro.org> References: <1439002992-29285-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv10 01/14] api: schedule: additional scheduler group functions X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bill.fischofer@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Additional APIs for scheduler groups: odp_schedule_group_lookup() odp_schedule_group_join() odp_schedule_group_leave() odp_schedule_group_count() Signed-off-by: Bill Fischofer --- include/odp/api/schedule.h | 63 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 4 deletions(-) diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h index 36e52cd..bd858b3 100644 --- a/include/odp/api/schedule.h +++ b/include/odp/api/schedule.h @@ -187,12 +187,12 @@ int odp_schedule_num_prio(void); /** * Schedule group create * - * Creates a schedule group with the thread mask. Only threads in the + * Create a schedule group with the specified thread mask. Only threads in the * mask will receive events from a queue that belongs to the schedule group. * Thread masks of various schedule groups may overlap. There are predefined * groups such as ODP_SCHED_GROUP_ALL and ODP_SCHED_GROUP_WORKER, which are - * always present and automatically updated. Group name is optional - * (may be NULL) and can have ODP_SCHED_GROUP_NAME_LEN characters in maximum. + * always present and automatically updated. Group name is optional (may be + * NULL) and can contain a maximum of ODP_SCHED_GROUP_NAME_LEN characters. * * @param name Schedule group name * @param mask Thread mask @@ -208,7 +208,7 @@ odp_schedule_group_t odp_schedule_group_create(const char *name, /** * Schedule group destroy * - * Destroys a schedule group. All queues belonging to the schedule group must + * Destroy a schedule group. All queues belonging to the schedule group must * be destroyed before destroying the group. Other operations on this group * must not be invoked in parallel. * @@ -220,6 +220,61 @@ odp_schedule_group_t odp_schedule_group_create(const char *name, int odp_schedule_group_destroy(odp_schedule_group_t group); /** + * Look up a schedule group by name + * + * Return the handle of a schedule group from its name + * + * @param name Name of schedule group + * + * @return Handle of schedule group for specified name + * @retval ODP_SCHEDULE_GROUP_INVALID No matching schedule group found + */ +odp_schedule_group_t odp_schedule_group_lookup(const char *name); + +/** + * Join a schedule group + * + * Join a threadmask to an existing schedule group + * + * @param group Schdule group handle + * @param mask Thread mask + * + * @retval 0 on success + * @retval <0 on failure + */ +int odp_schedule_group_join(odp_schedule_group_t group, + const odp_thrmask_t *mask); + +/** + * Leave a schedule group + * + * Remove a threadmask from an existing schedule group + * + * @param group Schedule group handle + * @param mask Thread mask + * + * @retval 0 on success + * @retval <0 on failure + * + * @note Leaving a schedule group means threads in the specified mask will no + * longer receive events from queues belonging to the specified schedule + * group. This effect is not instantaneous, however, and events that have been + * prestaged may still be presented to the masked threads. + */ +int odp_schedule_group_leave(odp_schedule_group_t group, + const odp_thrmask_t *mask); + +/** + * Count members in a schedule group + * + * @param group Schedule group handle + * + * @return Count of threads currently members of this schedule group. + * @retval <0 Invalid group specified + */ +int odp_schedule_group_count(odp_schedule_group_t group); + +/** * Initialize ordered context lock * * Initialize an ordered queue context lock. The lock can be associated only