From patchwork Thu Feb 22 10:00:15 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: 129189 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp434599lja; Thu, 22 Feb 2018 02:21:05 -0800 (PST) X-Google-Smtp-Source: AH8x225iET1Z7Ys6avuB6IN9YPEp+O9I2yyYOvntyWfRz2wyQnU5ucgZii3UfikvggElFliL46Nz X-Received: by 10.237.59.146 with SMTP id r18mr10176594qte.231.1519294865334; Thu, 22 Feb 2018 02:21:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519294865; cv=none; d=google.com; s=arc-20160816; b=livwf315Ik8WykehubQ9YQ4y8BaSttbteGnPglv0ksNdnLBogDZZZ0wOR/TJXG7qwt qENsbgFDc33JG83TGKbSMWwUlCwsz6UTSPe+D1KU+MUD9MqwA+RrDIKTrVdefDqZwEPz E/tyG7p7BV8k21A/lrud3rFqBjU6tav9VpYc7V+XjWwzq3PgaXJneG5MopgVqaMKqqAO jfH+R7gcq/nfYeerF5sIiQd6yzmk7AC/A8rtfyN0GwBrdUXY2aZgevSq9ggSXP6AahQS AhzrxQhJgwTvowUhgEsux/07lJE0If9AMgcg/MlmfsDrWxUwJGzxE7FnCoTBlZN6IgMM M6YQ== 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=oAv6i13uQahYjUIWXkKLeg3BEGpkCepIwfbWW/9j1lA=; b=MzGgaKtJwdeed98y0S57VUjWhTBDg/4TkI/o0vCglamsjKr0mZskeMT9RqYSRIPHdb y4TDFXSALNM7XulSgKqiybpocg6IIfBIePOpbeA5S7AYYRoR5PsqnoUbzrteAX5dOg5K +EJKyfCWDiOIucmBxylEKr9v7dYqPVXf1uYhz/DXCrvvu6t99iJlJdkUB79sdUC8+8D4 fqwl/KA/FDSjdvRWO9a4AmRFTKrvcCDp14oUTHXErfn8M8b2x990WHZKwlfmc6YxtqbO 4B074owjCidxqPNB0HCY3PbE03hTdZPzB0Mq/h6EuunMrTiFbnVXUD3qTpRnOIf39+Kw BGfA== 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 b1si1417291qtj.421.2018.02.22.02.21.04; Thu, 22 Feb 2018 02:21: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 C6C37608C3; Thu, 22 Feb 2018 10:21: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 9BF5B619C9; Thu, 22 Feb 2018 10:06:56 +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 D1BE56107F; Thu, 22 Feb 2018 10:06:49 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 75BB360C9D for ; Thu, 22 Feb 2018 10:01:32 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 46AFC4083BD3 for ; Thu, 22 Feb 2018 13:00:25 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id a0cW4WSwA9-0PVOvS2Z; Thu, 22 Feb 2018 13:00:25 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id azPEnBhLoH-0OvC2g2O; Thu, 22 Feb 2018 13:00:24 +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, 22 Feb 2018 13:00:15 +0300 Message-Id: <1519293622-14665-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519293622-14665-1-git-send-email-odpbot@yandex.ru> References: <1519293622-14665-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 492 Subject: [lng-odp] [PATCH v2 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: b29563293c1bca56419d2dc355a8e64d961e024a **/ 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.