From patchwork Wed Feb 28 12:00:11 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: 129969 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp943282lja; Wed, 28 Feb 2018 04:05:41 -0800 (PST) X-Google-Smtp-Source: AG47ELvYxjQSF4mBSXUpfvvMzV7sbgZ/EPMy+BlRIRJPx7JvBxGzQMf0T6a3Zvi5sDfcBqzo776i X-Received: by 10.200.15.250 with SMTP id f55mr29372259qtk.171.1519819541722; Wed, 28 Feb 2018 04:05:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519819541; cv=none; d=google.com; s=arc-20160816; b=PM/rlMCKFJPCfeK+9yZsHg0aEhlWj0vJ6t2lwJ8ut+6Nj6Plnor6fVj63egjcK9D5C mGzCSDCT6nNISJznzoz/bWS65fD442P0ai76+bhQEi7zWDKxLVlJxszY6tq4ehhERUxO q7oGxKOLw6UT93ufc3acYdZiERT8GdO1hhkkFHzTH2hLBZ/OKrAbX0VMtZWcVFzxsUlh RbrWWfbzvqAPaU0wMt2rKSaqfLK3lZ/3KX92KUU0rQwTCcTl8FFdi5waaizBkVp31vq1 Uz98LOnlvHOckL2V4qBY9o28+i6iB8+t0sdtIKJiV1vOkoJ6GKYL0t0V40tR5n5CC8Va dcmg== 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=HDZGHEi7qbQifQO3rjh0uNx25iwpf01IewEiHz+Dl8U=; b=tADenLXLo96jo9uawauR9zKY2WTGlgHkk+rA/9jBkCcgTwwOgHXcjZfLC6soUeEclb 1wAHNNjG/M0645z26J1KJcf5hl/pNLKRJkUVYEPKWeISDAGQHw4C5wP8WvYmuqZfSSEN J26/YS0rGeO8Sj9QsH0dKgQB/6cShgDfu/HqhStKZnCar5axaak0oDgMcJnBSyKhBI4q grtxonSS3zoJkCwdo0lbd1Yv5skxOBpDAhRqx+XxlXQNUEAtpnU39B3wkoWIOpL6axSm pT7YczZfTg9A1W69wdxi+G2u/ObpnFnIHPIrX2Tjf25i8RlZ6lNYeReqixd4lKgx9hVA +f/w== 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 f132si1571522qka.419.2018.02.28.04.05.41; Wed, 28 Feb 2018 04:05:41 -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 588CE60656; Wed, 28 Feb 2018 12:05:41 +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 DAE1A61759; Wed, 28 Feb 2018 12:01:45 +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 36BAD61745; Wed, 28 Feb 2018 12:01:34 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id BEB3C61737 for ; Wed, 28 Feb 2018 12:00:26 +0000 (UTC) Received: from mxback6g.mail.yandex.net (mxback6g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:167]) by forward101j.mail.yandex.net (Yandex) with ESMTP id 4928112424FE for ; Wed, 28 Feb 2018 15:00:23 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback6g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id uLXqRqMCAU-0Nu8Pt17; Wed, 28 Feb 2018 15:00:23 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id iE1m40jcci-0MS8QVHS; Wed, 28 Feb 2018 15:00:22 +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, 28 Feb 2018 15:00:11 +0300 Message-Id: <1519819218-27901-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519819218-27901-1-git-send-email-odpbot@yandex.ru> References: <1519819218-27901-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 492 Subject: [lng-odp] [PATCH v3 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: f5e12df388352b27f09787028a0040afb28564f4 ** Merge commit sha: 56e6340663c8679516a24dc81df13a53488b86b8 **/ 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 1dc43b57b..febfa28ed 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 7798f94e7..3afa490a6 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.