From patchwork Wed Feb 21 12:00:00 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: 129040 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp541227ljc; Wed, 21 Feb 2018 04:03:03 -0800 (PST) X-Google-Smtp-Source: AG47ELs25CmKzG+aB6x5picQjj7jv0Zdu9Wku2KyNyJYWdvmkxW30NB083CnQtg9xO9hLbBwrJHj X-Received: by 10.55.120.5 with SMTP id t5mr4491879qkc.14.1519214583626; Wed, 21 Feb 2018 04:03:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519214583; cv=none; d=google.com; s=arc-20160816; b=dcTj7maz098TiMEgN7k6M8i0QvOHEB/bF7zbRP0j+PiZcf09yKPryD3G0ME8BiUHjk rnrHKf9F3OSU/gAb+jz5rDoCUxe3qRv/mU0KYivqh9YaN6vHQHFhyEOn9DvLBwp/Y2R6 pS3AAcvoA85UsHJ10sIINxdOi2H83sNaxbry6SfKHckbKvp5IcieBPmCYH5B0/9LB8Oa Nmtzt0++mO+hIuVSSNU71ELmgCPqI7NtmmgX5pwCeByaNQwW1QBiSpO3asOtrvJEKlAQ h7dmqy9gWfI9eb/EYJ5fS8MtjOQNYxzNJm2asufVQA3zxgTm9diHhkLi7ar/bMt9UImr z1KQ== 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=jWPwjOsSFUrEP+aaYY+apb2nI4Zv3bODm9C76yGMHco=; b=T75SlC25PU63RxGTEs5fiRrd114cdMREJvbCAIvCK5aGYC8KJddTXaOZbvKFBEbptX /l2X0Gx8cZboBEJYoHtIbWW5YOP0c56QDPlumjqHM58aFMiAnWUV8lCKvpyq21BVUtUo yIHbEFa0SbvX+kpxhgo8y0+KU8+WTbai08GzhCDU1PY/60k30j2vg8LLQnBl6/Rl0dDF VU1gr2L627d/DrlrHY5qZl3iEn10QkpEXFco+Wq7NjqC5j5gD6OdMboXR9cUBGfcLHaD 1SMQFd2xD6btsr+5KF+HRyFk0GnYUs+mYgV8K1KSP/+S3Rsi5szTtNStLXKzobOZub5A 9WHQ== 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 t67si1318172qkt.43.2018.02.21.04.03.03; Wed, 21 Feb 2018 04:03:03 -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 4612A61522; Wed, 21 Feb 2018 12:03:03 +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 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 D8E69607BE; Wed, 21 Feb 2018 12:01:54 +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 E623B61514; Wed, 21 Feb 2018 12:01:41 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id 7A55561724 for ; Wed, 21 Feb 2018 12:00:12 +0000 (UTC) Received: from mxback13g.mail.yandex.net (mxback13g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:92]) by forward101j.mail.yandex.net (Yandex) with ESMTP id 68C7A1245B99 for ; Wed, 21 Feb 2018 15:00:11 +0300 (MSK) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [2a02:6b8:0:801::ac]) by mxback13g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id EUsslnT5mP-0BWmwoDG; Wed, 21 Feb 2018 15:00:11 +0300 Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id a6UlmCoovI-0AvaIBZJ; Wed, 21 Feb 2018 15:00:10 +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, 21 Feb 2018 15:00:00 +0300 Message-Id: <1519214407-28047-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519214407-28047-1-git-send-email-odpbot@yandex.ru> References: <1519214407-28047-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 492 Subject: [lng-odp] [PATCH v1 3/10] helper: cuckoo: check pool and queue limits 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 Use capability to check if pool and queue can hold enough events. Also lower test case resource requirement. Signed-off-by: Petri Savolainen --- /** Email created from pull request 492 (psavol:master-sched-optim) ** https://github.com/Linaro/odp/pull/492 ** Patch: https://github.com/Linaro/odp/pull/492.patch ** Base sha: 5a58bbf2bb331fd7dde2ebbc0430634ace6900fb ** Merge commit sha: 82a6bfe942419330a430b63149220e6b472f419c **/ helper/cuckootable.c | 22 ++++++++++++++++++++++ helper/test/cuckootable.c | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/helper/cuckootable.c b/helper/cuckootable.c index 29298d42d..5fe0034c0 100644 --- a/helper/cuckootable.c +++ b/helper/cuckootable.c @@ -184,6 +184,8 @@ odph_cuckoo_table_create( odp_queue_t queue; odp_queue_param_t qparam; + odp_queue_capability_t qcapa; + odp_pool_capability_t pcapa; char pool_name[ODPH_TABLE_NAME_LEN + 3], queue_name[ODPH_TABLE_NAME_LEN + 3]; @@ -191,6 +193,26 @@ odph_cuckoo_table_create( uint32_t impl_size, kv_entry_size, bucket_num, bucket_size; + if (odp_queue_capability(&qcapa)) { + ODPH_DBG("queue capa failed\n"); + return NULL; + } + + if (qcapa.plain.max_size && qcapa.plain.max_size < capacity) { + ODPH_DBG("queue max_size too small\n"); + return NULL; + } + + if (odp_pool_capability(&pcapa)) { + ODPH_DBG("pool capa failed\n"); + return NULL; + } + + if (pcapa.buf.max_num && pcapa.buf.max_num < capacity) { + ODPH_DBG("pool max_num too small\n"); + return NULL; + } + /* Check for valid parameters */ if ( (capacity > HASH_ENTRIES_MAX) || diff --git a/helper/test/cuckootable.c b/helper/test/cuckootable.c index ebe791678..71c82cdc8 100644 --- a/helper/test/cuckootable.c +++ b/helper/test/cuckootable.c @@ -429,7 +429,7 @@ static int test_creation_with_bad_parameters(void) return 0; } -#define PERFORMANCE_CAPACITY 1000000 +#define PERFORMANCE_CAPACITY 4000 /* * Test the performance of cuckoo hash table.