From patchwork Wed Dec 20 15:00:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 122471 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5685586qgn; Wed, 20 Dec 2017 07:01:15 -0800 (PST) X-Google-Smtp-Source: ACJfBosLMdGg7/uhtbwKNulYIpoGOlBRnZAcc8OSYN3xxqeLscR9ga8kzrSP6OrlSZU8POhP3cop X-Received: by 10.200.36.203 with SMTP id t11mr10252260qtt.277.1513782075714; Wed, 20 Dec 2017 07:01:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513782075; cv=none; d=google.com; s=arc-20160816; b=TQ9wJtRr9n337tNBZfsf1d1pzdPSmFScH1deME3xu27fTv3Mw8YoGdNnAnUa6aTFtt ZjCDxdErSf+yp139oF5E1a/pfI1y9Y0Ec5D33NxTF4+NvzXMt1rWjkMhXtIu4jW5eU4g Nq8GCAxCrkSqdcr+mFt6oFGggvC1XTI91wEFpTK2qZI/CsvpE4KTs+SjW6ovK27FAOeC D7zB2v6UTyHhGGZNeVQQ/Kgu2RdVnMCPHWw5sSh+psTQ7NlvMn4EHoEMzi2bRxrIY5jR 6ucyE3NW+xSz6wXxRlZu4YoSXAUtFFtxR7ygAD3oubuhHf1fd19zJ0R1U6hTzGePKUFg rTnA== 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=zyJ5PHakCeWWSi50ay+qJ3QUqQmRa4Wro1XqTp/dUzg=; b=lnmmuiEFI4Wnw5gjluW93ZKS2EqW/puEl1A4IQFMxLEc2neXsoMdIdBK8ifSso18qC q2k61fuW8QGJh3qyqhks3R4xNj8EVLJnSVY+8U/ERaV49VrNhNNqkGXvD6xNLOlheYeo 0kLwE+2scom6G61FWk9Hfx/DOQuxz7AiHsuqQMlIIRG3yY8wpJenrOfUmwhy2vYEI63y yPyONsa5bJmUeFqELNpMr5sauQARlaw3WO6J0WiP9VujklfJ7L0LBHPjD6aRfjh7YVWZ OgQVTeGd0SGJ3qYtZduotmbk7h6ZFLhkn54R7vXfwzt/Hz9hVPf0xUKJQlBWRf1c1o5v 4kPQ== 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 135si1188265qke.107.2017.12.20.07.01.13; Wed, 20 Dec 2017 07:01:15 -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 BA68E608E2; Wed, 20 Dec 2017 15:01:13 +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_H3, RCVD_IN_MSPIKE_WL 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 8072C608E7; Wed, 20 Dec 2017 15:00:28 +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 62BA7608E8; Wed, 20 Dec 2017 15:00:20 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id F3280608DD for ; Wed, 20 Dec 2017 15:00:13 +0000 (UTC) Received: from mxback4o.mail.yandex.net (mxback4o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1e]) by forward105j.mail.yandex.net (Yandex) with ESMTP id A5306184FD4 for ; Wed, 20 Dec 2017 18:00:12 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback4o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id zKOOvKdTHX-0CFqNgtV; Wed, 20 Dec 2017 18:00:12 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 9OmWOYMNlY-0B5OCxgr; Wed, 20 Dec 2017 18:00:11 +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: Wed, 20 Dec 2017 18:00:08 +0300 Message-Id: <1513782010-27654-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513782010-27654-1-git-send-email-odpbot@yandex.ru> References: <1513782010-27654-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 353 Subject: [lng-odp] [PATCH API-NEXT v1 1/3] 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: 12fd3a9224a856271934986a1bad981843915d68 ** Merge commit sha: 291f28b061ad4fa89a0346d6da4c6324c6335eca **/ 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)