From patchwork Mon May 16 19:54:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 67916 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1710248qge; Mon, 16 May 2016 12:54:57 -0700 (PDT) X-Received: by 10.140.253.84 with SMTP id y81mr33034286qhc.56.1463428497010; Mon, 16 May 2016 12:54:57 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id r88si6673657qkh.116.2016.05.16.12.54.56; Mon, 16 May 2016 12:54:56 -0700 (PDT) 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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 37EB361757; Mon, 16 May 2016 19:54:56 +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, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 54AE86173D; Mon, 16 May 2016 19:54:51 +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 B0FDB61750; Mon, 16 May 2016 19:54:49 +0000 (UTC) Received: from mail-oi0-f47.google.com (mail-oi0-f47.google.com [209.85.218.47]) by lists.linaro.org (Postfix) with ESMTPS id E393361735 for ; Mon, 16 May 2016 19:54:48 +0000 (UTC) Received: by mail-oi0-f47.google.com with SMTP id v145so284783970oie.0 for ; Mon, 16 May 2016 12:54:48 -0700 (PDT) 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; bh=CU6O1OzranFY2rfoXewFErkcB7OnWXHIx5RE2xmV1qI=; b=G3d2nMU13svJpvbwcgsF0t66jorsuh6Q1fRjK6wE7Mr8XvNzlkh9qN5WNYmfFbsCAm jjBgUiopNX7C1461RlR33VKWsHXkPAp0qkU0WWb0GvsN+dM7Ctoloslk1tULXli6gIuu R2ZTQw/R0OntuJAkoSlDgLrzKeMzsYJac76TIvUMr+Cd2/tqPMYuSt2y/e+d3XeagrlK rVlVXtKDNvniNvQq0KsKqRMtJEbq82ygLSCu1xCa0U6q+c2+QWdPJlXyHeBlEIn/cLtI Dn87xlCJN3RFojVT3z19jqdilWpkyZfmTgfgi8YBdt0e/ouoOzohz0IDOeQBTLcihym5 vgDQ== X-Gm-Message-State: AOPr4FXA33xRXWogUgZQuVHJMNvu4Uj/s2olihwnHibsg2vmYx13ILA+gYhugHJyxlsiZ/wgqG8= X-Received: by 10.157.19.75 with SMTP id q11mr7554868otq.141.1463428488231; Mon, 16 May 2016 12:54:48 -0700 (PDT) Received: from localhost.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id u41sm10282365otd.37.2016.05.16.12.54.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 May 2016 12:54:47 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Mon, 16 May 2016 14:54:45 -0500 Message-Id: <1463428485-4613-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.7.4 X-Topics: patch Subject: [lng-odp] [PATCH] validation: tm: add checks for adequate cpu resources 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" The shaper and scheduler tests require a minimum of two CPUs to run reliably. Make these tests conditional and skip them with a warning to avoid spurious failures if test is run with only a single CPU. Signed-off-by: Bill Fischofer --- test/validation/traffic_mngr/traffic_mngr.c | 36 +++++++++++++++++++++++++++-- test/validation/traffic_mngr/traffic_mngr.h | 2 ++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/test/validation/traffic_mngr/traffic_mngr.c b/test/validation/traffic_mngr/traffic_mngr.c index 305b91a..5ff58f9 100644 --- a/test/validation/traffic_mngr/traffic_mngr.c +++ b/test/validation/traffic_mngr/traffic_mngr.c @@ -3652,6 +3652,21 @@ void traffic_mngr_test_tm_create(void) dump_tm_tree(0); } +int traffic_mngr_check_shaper(void) +{ + odp_cpumask_t cpumask; + int cpucount = odp_cpumask_all_available(&cpumask); + + if (cpucount < 2) { + LOG_DBG("\nSkipping shaper test because cpucount = %d " + "is less then min number 2 required\n", cpucount); + LOG_DBG("Rerun with more cpu resources\n"); + return ODP_TEST_INACTIVE; + } + + return ODP_TEST_ACTIVE; +} + void traffic_mngr_test_shaper(void) { CU_ASSERT(test_shaper_bw("bw1", "node_1_1_1", 0, 1 * MBPS) == 0); @@ -3661,6 +3676,21 @@ void traffic_mngr_test_shaper(void) CU_ASSERT(test_shaper_bw("bw100", "node_1_1_2", 0, 100 * MBPS) == 0); } +int traffic_mngr_check_scheduler(void) +{ + odp_cpumask_t cpumask; + int cpucount = odp_cpumask_all_available(&cpumask); + + if (cpucount < 2) { + LOG_DBG("\nSkipping scheduler test because cpucount = %d " + "is less then min number 2 required\n", cpucount); + LOG_DBG("Rerun with more cpu resources\n"); + return ODP_TEST_INACTIVE; + } + + return ODP_TEST_ACTIVE; +} + void traffic_mngr_test_scheduler(void) { CU_ASSERT(test_sched_queue_priority("que_prio", "node_1_1_3", 10) == 0); @@ -3818,8 +3848,10 @@ odp_testinfo_t traffic_mngr_suite[] = { ODP_TEST_INFO(traffic_mngr_test_sched_profile), ODP_TEST_INFO(traffic_mngr_test_threshold_profile), ODP_TEST_INFO(traffic_mngr_test_wred_profile), - ODP_TEST_INFO(traffic_mngr_test_shaper), - ODP_TEST_INFO(traffic_mngr_test_scheduler), + ODP_TEST_INFO_CONDITIONAL(traffic_mngr_test_shaper, + traffic_mngr_check_shaper), + ODP_TEST_INFO_CONDITIONAL(traffic_mngr_test_scheduler, + traffic_mngr_check_scheduler), ODP_TEST_INFO(traffic_mngr_test_thresholds), ODP_TEST_INFO(traffic_mngr_test_byte_wred), ODP_TEST_INFO(traffic_mngr_test_pkt_wred), diff --git a/test/validation/traffic_mngr/traffic_mngr.h b/test/validation/traffic_mngr/traffic_mngr.h index 0d50751..bdac221 100644 --- a/test/validation/traffic_mngr/traffic_mngr.h +++ b/test/validation/traffic_mngr/traffic_mngr.h @@ -17,7 +17,9 @@ void traffic_mngr_test_sched_profile(void); void traffic_mngr_test_threshold_profile(void); void traffic_mngr_test_wred_profile(void); void traffic_mngr_test_shaper(void); +int traffic_mngr_check_shaper(void); void traffic_mngr_test_scheduler(void); +int traffic_mngr_check_scheduler(void); void traffic_mngr_test_thresholds(void); void traffic_mngr_test_byte_wred(void); void traffic_mngr_test_pkt_wred(void);