From patchwork Thu Jan 11 15:00:16 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: 124236 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp792931qgn; Thu, 11 Jan 2018 07:00:48 -0800 (PST) X-Google-Smtp-Source: ACJfBoszKLmFqQEnxq6lO4Czoe5WVchYfl/QWbObY8pX3yqv580WF7013tj8GcsV6059ZKBcGrYx X-Received: by 10.55.99.10 with SMTP id x10mr5689071qkb.307.1515682848620; Thu, 11 Jan 2018 07:00:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515682848; cv=none; d=google.com; s=arc-20160816; b=eUVmPH0wA0+cUPYo99Hu6FT9ETLO3TRYgi7G0KEE1CJpom/Ss1hFnghWgw5zmUSgHn 37cuvRRSPzrK3/PUgTBaJRbUVLO4FVfj9wWvdd2C8bqyZBriE6+fpy4QzuyTB/9Q2q/f VUbVxivmMnCxfNqQXHM6zKQ9aUbLGka4y1FrviNkJrol0gCpu4joH6Hb8Ue3yxmgGbGm INhDOKOB5rG3H+vH5BA2MvLfMj0dOOe1rkyFlQzs8vB1r+lHuBIkC8bY9bFG7NK81mLo INoJDOZudMWxkBRIHTD/iGzFQWmrgYIvi0Oxbwjsp1dVpMhvwAro9EV+H4wfF0jV2qAl SfAA== 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=qaCQY2FeplCHDI+mMkNP9TyqKgXl8j2nr46Q0eTURms=; b=Y8siU7DEszt7nuUvgIRWM6L8bHW8MaSTPEzQVf4q8twSKydMHIIZpQveBIivCls38v 3TJN+7MkOgoF9s9FCSKC+Z+GNf52ji/XOI1VSNnX0qrWBBtoS+918tZZyOR9nrBquaxP O9H0RJO/1OdWyXiijbnhTjpmLY0YKkQvnVDlcazzo08GAf1/gVxzvLg3UPajGlblpkMX XlqY8s/WgSPJ6nYYmGJ1TfP3fWpW/jZZZtLOPw12X67cmbc2XTOpfnDzRmk/jxC+FjHc VcSquLjqPYt4tvSiTSvV+ShBLo950ghF+VA5mS1+ObntFmywJmZoZOzgnAFCJYQcD815 vVcw== 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 f10si3186389qke.33.2018.01.11.07.00.47; Thu, 11 Jan 2018 07:00:48 -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 CFB85617A1; Thu, 11 Jan 2018 15:00:47 +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 34D8761506; Thu, 11 Jan 2018 15:00:39 +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 9BA3D61782; Thu, 11 Jan 2018 15:00:29 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id AD50160958 for ; Thu, 11 Jan 2018 15:00:23 +0000 (UTC) Received: from mxback17j.mail.yandex.net (mxback17j.mail.yandex.net [IPv6:2a02:6b8:0:1619::93]) by forward101j.mail.yandex.net (Yandex) with ESMTP id BD2D81246272 for ; Thu, 11 Jan 2018 18:00:21 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback17j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id w9ZrkCJUvt-0LLqpbgA; Thu, 11 Jan 2018 18:00:21 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 4ImPmxf1Zz-0KiqTMGP; Thu, 11 Jan 2018 18:00:20 +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: Thu, 11 Jan 2018 18:00:16 +0300 Message-Id: <1515682819-12495-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515682819-12495-1-git-send-email-odpbot@yandex.ru> References: <1515682819-12495-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 353 Subject: [lng-odp] [PATCH API-NEXT v4 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 353 (psavol:next-lockfree-queue-impl2) ** https://github.com/Linaro/odp/pull/353 ** Patch: https://github.com/Linaro/odp/pull/353.patch ** Base sha: 6303c7d0e98fafe0f14c8c4dd9989b3b7633ebf4 ** Merge commit sha: 065c75576263a97f76d1a47df24ee73cd18f54c5 **/ 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)