From patchwork Tue Jan 16 12:00:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 124661 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp988557lje; Tue, 16 Jan 2018 04:03:05 -0800 (PST) X-Google-Smtp-Source: ACJfBovm+i6Hy4LXeqUAoWtpEiDDWKfQBcVvyGNht8lH3bMNMwoKV2Rp4v1t7XbRxJxLXRjse7sj X-Received: by 10.55.25.234 with SMTP id 103mr53655632qkz.217.1516104185038; Tue, 16 Jan 2018 04:03:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516104185; cv=none; d=google.com; s=arc-20160816; b=imPJ+96MoWpWCn9QHuRkSPY1lihn539LsvGGHWKscmkbbuai9Ajbz1htX5GENONmCg JX1r98uaqiBfDyQpatDnPL3x6G3TiMRjv4tS+bAxTb4ocR7A9EQMd29N31znrptgEDn0 SizCXCoDhm0Gu+OFVRuXpWjbJgNC/MeXkxj4QaWjI2Fwm+iuZdK1ARpIxnxXCtqC5EdB 3QqOdb0sZjO6TFsjKNdl4q7gI/SOZAuRsaMfXSIo77onoogaDRp4Qa5Dp6Fotz6c765B wIqsEahXfK4DSM8ggkaTZuJFcamULlSefAqt8JycxKW4dE0WB2HXL7C66qcxbSwGj3wt AjWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=z2OATuWcdA+ZZUY2m6Huln2WgniYZWNvjjQQZhWxxls=; b=s0I9Twcdn77N+yY4ATSPGETTtQIQ3F0lN5EMB5IeaP5A8fr3AyjMyCKQ19qnOXd3WD CM78dJAf36GrS3eDsIb2Lscx3PTIn1/fbulTnNgcrQkzLqG1XN082m0YwqomQzYBaUF1 yGxohfyVWorDSNX0AHnCl7ykr54ez9nhHY+uLW8EaLxJOo74lkqos9lfCYqW7QLDrawL 1bR3TFkEWUTx370XUhz1WWM4kwimdCR8cqFjIrbjruaOEox+dFkzacmVDzCK87STLf0g VShOMNjjd4GaDlkOqsA6QjzdXqnmZRdfQemnkbbkrfeD1lXQ9jS2qTko8tL4mJmnaNqZ O4yw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id c50si2143959qtk.86.2018.01.16.04.03.04; Tue, 16 Jan 2018 04:03:05 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 8B468617BF; Tue, 16 Jan 2018 12:03:04 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 8489F617A6; Tue, 16 Jan 2018 12:01:07 +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 E144F61798; Tue, 16 Jan 2018 12:00:49 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id C6CE4617A8 for ; Tue, 16 Jan 2018 12:00:11 +0000 (UTC) Received: from mxback2g.mail.yandex.net (mxback2g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:163]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 63F854443DB1 for ; Tue, 16 Jan 2018 15:00:10 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback2g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id aIeQeCrd4R-0ANWv6sL; Tue, 16 Jan 2018 15:00:10 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id b7CVxjO9hV-09gKr6EX; Tue, 16 Jan 2018 15:00:09 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 16 Jan 2018 15:00:05 +0300 Message-Id: <1516104008-9628-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516104008-9628-1-git-send-email-odpbot@yandex.ru> References: <1516104008-9628-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 393 Subject: [lng-odp] [PATCH API-NEXT v1 1/4] api: queue: block-free capabilities 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Lock-free and wait-free implementations may differ a lot from the default (blocking) implementation. Thus the maximum number of queues and queue sizes may be more limited. Non-blocking enum is not needed anymore as capability, since number of queues may be zero for LF/WF when not implemented. Signed-off-by: Petri Savolainen --- /** Email created from pull request 393 (psavol:next-lockfree-queue-impl-rebased) ** https://github.com/Linaro/odp/pull/393 ** Patch: https://github.com/Linaro/odp/pull/393.patch ** Base sha: f6dab2bfa90ef5d3146cb76f86bc8782666f0f3e ** Merge commit sha: 3da13358015ca674abf51f61f539fcbf6607cb2d **/ include/odp/api/spec/queue.h | 74 +++++++++++++++++++++++------ platform/linux-generic/odp_queue.c | 2 - platform/linux-generic/odp_queue_scalable.c | 2 - test/validation/api/queue/queue.c | 2 - 4 files changed, 60 insertions(+), 20 deletions(-) diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h index 79a26df3a..107ef3f75 100644 --- a/include/odp/api/spec/queue.h +++ b/include/odp/api/spec/queue.h @@ -164,35 +164,81 @@ typedef struct odp_queue_capability_t { /** Plain queue capabilities */ struct { - /** Maximum number of plain queues of the default size. */ + /** Maximum number of plain (ODP_BLOCKING) queues of the + * default size. */ uint32_t max_num; - /** Maximum number of events a plain queue can store - * simultaneously. The value of zero means that plain + /** Maximum number of events a plain (ODP_BLOCKING) queue can + * store simultaneously. The value of zero means that plain * queues do not have a size limit, but a single queue can * store all available events. */ uint32_t max_size; - /** The strongest guarantee of block freedom that is supported - * for plain queues. */ - odp_nonblocking_t nonblocking; + /** Lock-free (ODP_NONBLOCKING_LF) implementation capabilities. + * The specification is the same as for the blocking + * implementation. */ + struct { + /** Maximum number of queues. Lock-free queues are not + * supported when zero. */ + uint32_t max_num; + + /** Maximum queue size */ + uint32_t max_size; + + } lockfree; + + /** Wait-free (ODP_NONBLOCKING_WF) implementation capabilities. + * The specification is the same as for the blocking + * implementation. */ + struct { + /** Maximum number of queues. Wait-free queues are not + * supported when zero. */ + uint32_t max_num; + + /** Maximum queue size */ + uint32_t max_size; + + } waitfree; } plain; /** Scheduled queue capabilities */ struct { - /** Maximum number of scheduled queues of the default size. */ + /** Maximum number of scheduled (ODP_BLOCKING) queues of the + * default size. */ uint32_t max_num; - /** Maximum number of events a scheduled queue can store - * simultaneously. The value of zero means that scheduled - * queues do not have a size limit, but a single queue can - * store all available events. */ + /** Maximum number of events a scheduled (ODP_BLOCKING) queue + * can store simultaneously. The value of zero means that + * scheduled queues do not have a size limit, but a single + * queue can store all available events. */ uint32_t max_size; - /** The strongest guarantee of block freedom that is supported - * for scheduled queues. */ - odp_nonblocking_t nonblocking; + /** Lock-free (ODP_NONBLOCKING_LF) implementation capabilities. + * The specification is the same as for the blocking + * implementation. */ + struct { + /** Maximum number of queues. Lock-free queues are not + * supported when zero. */ + uint32_t max_num; + + /** Maximum queue size */ + uint32_t max_size; + + } lockfree; + + /** Wait-free (ODP_NONBLOCKING_WF) implementation capabilities. + * The specification is the same as for the blocking + * implementation. */ + struct { + /** Maximum number of queues. Wait-free queues are not + * supported when zero. */ + uint32_t max_num; + + /** Maximum queue size */ + uint32_t max_size; + + } waitfree; } sched; diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c index 58103930c..6a69eb849 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -150,9 +150,7 @@ static int queue_capability(odp_queue_capability_t *capa) capa->max_sched_groups = sched_fn->num_grps(); capa->sched_prios = odp_schedule_num_prio(); capa->plain.max_num = capa->max_queues; - capa->plain.nonblocking = ODP_BLOCKING; capa->sched.max_num = capa->max_queues; - capa->sched.nonblocking = ODP_BLOCKING; return 0; } diff --git a/platform/linux-generic/odp_queue_scalable.c b/platform/linux-generic/odp_queue_scalable.c index 88a5a8c27..72dec15b0 100644 --- a/platform/linux-generic/odp_queue_scalable.c +++ b/platform/linux-generic/odp_queue_scalable.c @@ -315,10 +315,8 @@ static int queue_capability(odp_queue_capability_t *capa) capa->sched_prios = odp_schedule_num_prio(); capa->plain.max_num = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES; capa->plain.max_size = 0; - capa->plain.nonblocking = ODP_BLOCKING; capa->sched.max_num = ODP_CONFIG_QUEUES - NUM_INTERNAL_QUEUES; capa->sched.max_size = 0; - capa->sched.nonblocking = ODP_BLOCKING; return 0; } diff --git a/test/validation/api/queue/queue.c b/test/validation/api/queue/queue.c index 3c6db33ab..f674b0813 100644 --- a/test/validation/api/queue/queue.c +++ b/test/validation/api/queue/queue.c @@ -69,8 +69,6 @@ void queue_test_capa(void) CU_ASSERT(capa.sched_prios != 0); CU_ASSERT(capa.plain.max_num != 0); CU_ASSERT(capa.sched.max_num != 0); - CU_ASSERT(capa.plain.nonblocking >= ODP_BLOCKING); - CU_ASSERT(capa.sched.nonblocking >= ODP_BLOCKING); min = capa.plain.max_num; if (min > capa.sched.max_num)