From patchwork Wed Feb 3 14:46:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 61099 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp336657lbl; Wed, 3 Feb 2016 06:46:30 -0800 (PST) X-Received: by 10.50.41.65 with SMTP id d1mr3802836igl.44.1454510790496; Wed, 03 Feb 2016 06:46:30 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id hu10si12871431igb.7.2016.02.03.06.46.30; Wed, 03 Feb 2016 06:46:30 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id BDA2461777; Wed, 3 Feb 2016 14:46:29 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=cJAW1iv0; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED 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 64677616B1; Wed, 3 Feb 2016 14:46:25 +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 CDB3761760; Wed, 3 Feb 2016 14:46:22 +0000 (UTC) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) by lists.linaro.org (Postfix) with ESMTPS id D2D17616B1 for ; Wed, 3 Feb 2016 14:46:20 +0000 (UTC) Received: by mail-lf0-f49.google.com with SMTP id 78so15293842lfy.3 for ; Wed, 03 Feb 2016 06:46:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=y23FwZj0LXBd8x7rY1FolVGSCrJ536PinmJc+e8QYKg=; b=cJAW1iv0nByJx00RgtVUfDWRhDQhHCag/V57SETaSs7xtHoMmHLjjMfFr356h76V09 TxeSTDVd6xjx4JkdaXw4uxygHBA1x3P+n8VS1xx0YzBiyhlb5BU+VcPaeHtHnW1c2I59 WTW7r8AwKW3ZQNufIko6znAnpAMY3V08URDRE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=y23FwZj0LXBd8x7rY1FolVGSCrJ536PinmJc+e8QYKg=; b=TS6JoCFqVIIif3dCfCtLvyUnf/oaRhZyTl2ff4L89nP3r4Cm9rPW5PFbL3nMBzQeHR ZssO8VqY1rYeWlYTjXjoT78CvGLERi1HNUYZBdXrx2h4vsnLwY1atI5jagkE63MSrKyn NuT7vyxH1Jjpo1xhQxoWG7m0fUHMvsOf3MzChZpVZ0DEvPy0Xi8o1tO52iWxJpyHpTwA UFTgofbFcxot9l5gJdiuD4vF6W3RdpaFW75HZYhT3u9T49n1yU1FISryRVOdUDkxVKt7 OHi2ccCVZCji0xuG19VtyfpXTq+ty++uTpNrVB3LL0wILj2kUVQYGrAYoAKEW2tJAVXW mChw== X-Gm-Message-State: AG10YOTvdN3ahek57wlWQgx85ESJ7LrKtwJMH6LvGiyJmfyFKe6+1FJ7pBtUdNgb0tOAAoRwCK0= X-Received: by 10.25.167.74 with SMTP id q71mr867431lfe.22.1454510779853; Wed, 03 Feb 2016 06:46:19 -0800 (PST) Received: from localhost.localdomain (ppp91-76-173-134.pppoe.mtu-net.ru. [91.76.173.134]) by smtp.gmail.com with ESMTPSA id l129sm944329lfl.37.2016.02.03.06.46.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Feb 2016 06:46:19 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 3 Feb 2016 17:46:10 +0300 Message-Id: <1454510770-11548-2-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454510770-11548-1-git-send-email-maxim.uvarov@linaro.org> References: <1454510770-11548-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3 2/2] validation: system: make odp_cpu_hz_id conditional 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Maxim Uvarov --- test/validation/system/system.c | 31 +++++++++++++++++++++++++++++-- test/validation/system/system.h | 1 + 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/test/validation/system/system.c b/test/validation/system/system.c index 942905a..5b5a3f0 100644 --- a/test/validation/system/system.c +++ b/test/validation/system/system.c @@ -235,6 +235,29 @@ void system_test_odp_cpu_hz(void) CU_ASSERT(hz > 1 * KILO_HZ); } +int system_check_odp_cpu_hz_id(void) +{ + uint64_t hz; + odp_cpumask_t mask; + int i, num, cpu; + + num = odp_cpumask_all_available(&mask); + cpu = odp_cpumask_first(&mask); + + for (i = 0; i < num; i++) { + hz = odp_cpu_hz_id(cpu); + if (hz == 0) { + fprintf(stderr, "cpu %d does not support" + " odp_cpu_hz_id()," + "skip that test\n", cpu); + return -1; + } + cpu = odp_cpumask_next(&mask, cpu); + } + + return 0; +} + void system_test_odp_cpu_hz_id(void) { uint64_t hz; @@ -246,7 +269,10 @@ void system_test_odp_cpu_hz_id(void) for (i = 0; i < num; i++) { hz = odp_cpu_hz_id(cpu); - CU_ASSERT(0 < hz); + /* Test value sanity: less than 10GHz */ + CU_ASSERT(hz < 10 * GIGA_HZ); + /* larger than 1kHz */ + CU_ASSERT(hz > 1 * KILO_HZ); cpu = odp_cpumask_next(&mask, cpu); } } @@ -285,7 +311,8 @@ odp_testinfo_t system_suite[] = { ODP_TEST_INFO(system_test_odp_sys_huge_page_size), ODP_TEST_INFO_CONDITIONAL(system_test_odp_cpu_hz, system_check_odp_cpu_hz), - ODP_TEST_INFO(system_test_odp_cpu_hz_id), + ODP_TEST_INFO_CONDITIONAL(system_test_odp_cpu_hz_id, + system_check_odp_cpu_hz_id), ODP_TEST_INFO(system_test_odp_cpu_hz_max), ODP_TEST_INFO(system_test_odp_cpu_hz_max_id), ODP_TEST_INFO(system_test_odp_cpu_cycles), diff --git a/test/validation/system/system.h b/test/validation/system/system.h index a258933..cf585a7 100644 --- a/test/validation/system/system.h +++ b/test/validation/system/system.h @@ -22,6 +22,7 @@ void system_test_odp_sys_page_size(void); void system_test_odp_sys_huge_page_size(void); int system_check_odp_cpu_hz(void); void system_test_odp_cpu_hz(void); +int system_check_odp_cpu_hz_id(void); void system_test_odp_cpu_hz_id(void); void system_test_odp_cpu_hz_max(void); void system_test_odp_cpu_hz_max_id(void);