From patchwork Thu Sep 17 13:10:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hongbo.zhang@freescale.com X-Patchwork-Id: 53813 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id 40C3C22E57 for ; Thu, 17 Sep 2015 13:36:44 +0000 (UTC) Received: by lagj9 with SMTP id j9sf7349569lag.0 for ; Thu, 17 Sep 2015 06:36:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:mime-version:spamdiagnosticoutput :spamdiagnosticmetadata:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=iwnvbQU5OWg6nb3pxERZC84RkZ98OjHajXStMWpZ3eY=; b=iNpKXBN6Qbswszs+po0dJyOnaTQZ9TBRx7SHQ7omQ33DEaHrkdLSvW9hzxNCIDJjnL Qls1RIrFIPyzQgwRrvmzLTNH2fNYraxmR6vEnR2qcW75f5k409uMBILTTNyv2kARUf7/ 7C+TDJ9QBDZ8spbJdFyJqdTeDNMaTiiEIeZv3U1ZGMXmty26lBmn4wiD9t1GDcMyB4ev X7Z2fopXUwGUtGrn2IVaHb2fvWzbtY0Lo4vGWFUiKCvQoEt0FPl1VYTvMzN2qLGXSkzC 5IcQ/ph5oXs9zfR/dOrMXq1BFCmJqJvGxg3754xz3VNMrXxT3aJACAIvqqM1ioFQnhSa FGlA== X-Gm-Message-State: ALoCoQniwyBe5gnwYSMsRpveXLNAG52r6GVumHfN5sZkqzuNmkYlv3sUEbDo8Vlk9ZdeyxktOnu9 X-Received: by 10.152.22.101 with SMTP id c5mr6079694laf.0.1442497003140; Thu, 17 Sep 2015 06:36:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.7 with SMTP id e7ls88497lab.70.gmail; Thu, 17 Sep 2015 06:36:43 -0700 (PDT) X-Received: by 10.152.6.34 with SMTP id x2mr15874900lax.120.1442497003011; Thu, 17 Sep 2015 06:36:43 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id 2si2318222lao.37.2015.09.17.06.36.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 06:36:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbcao8 with SMTP id ao8so9325346lbc.3 for ; Thu, 17 Sep 2015 06:36:42 -0700 (PDT) X-Received: by 10.112.146.104 with SMTP id tb8mr34751976lbb.35.1442497002859; Thu, 17 Sep 2015 06:36:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp3076346lbq; Thu, 17 Sep 2015 06:36:41 -0700 (PDT) X-Received: by 10.141.28.2 with SMTP id f2mr53328772qhe.59.1442497001731; Thu, 17 Sep 2015 06:36:41 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id s13si2641672qkl.23.2015.09.17.06.36.41; Thu, 17 Sep 2015 06:36:41 -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; Received: by lists.linaro.org (Postfix, from userid 109) id 4C1AD62D65; Thu, 17 Sep 2015 13:36: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=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 1ECAA62D95; Thu, 17 Sep 2015 13:26:32 +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 A21E462D5C; Thu, 17 Sep 2015 13:26:04 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0147.outbound.protection.outlook.com [157.56.111.147]) by lists.linaro.org (Postfix) with ESMTPS id 25F8E62D65 for ; Thu, 17 Sep 2015 13:24:54 +0000 (UTC) Received: from DM2PR03CA0035.namprd03.prod.outlook.com (10.141.96.34) by BN3PR0301MB1267.namprd03.prod.outlook.com (10.161.209.147) with Microsoft SMTP Server (TLS) id 15.1.268.17; Thu, 17 Sep 2015 13:24:53 +0000 Received: from BY2FFO11FD011.protection.gbl (2a01:111:f400:7c0c::122) by DM2PR03CA0035.outlook.office365.com (2a01:111:e400:2428::34) with Microsoft SMTP Server (TLS) id 15.1.274.16 via Frontend Transport; Thu, 17 Sep 2015 13:24:52 +0000 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD011.mail.protection.outlook.com (10.1.14.129) with Microsoft SMTP Server (TLS) id 15.1.274.4 via Frontend Transport; Thu, 17 Sep 2015 13:24:49 +0000 Received: from hongbo.ap.freescale.net (hongbo.ap.freescale.net [10.193.20.3]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t8HDOGbo005200; Thu, 17 Sep 2015 06:24:46 -0700 From: To: Date: Thu, 17 Sep 2015 21:10:08 +0800 Message-ID: <1442495411-12362-12-git-send-email-hongbo.zhang@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442495411-12362-1-git-send-email-hongbo.zhang@freescale.com> References: <1442495411-12362-1-git-send-email-hongbo.zhang@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD011; 1:KTg4Gdk2szbYmpU4WAacsIQMecjTeMnchl2+KoFerlxHBRuAmw0nwK4FL1xlf8PM3YqVeRyRY/Z+F1NTzUnkJ4dEGJ+3Cpn0V5mig1EYzmwpEiVrPsECrf5NIqdgmEBwdiAdJ70qVehfbLxd6PS4lA4awj8Da1kTVJD34dyZxYg8JrghAZHYAsADWLIJj5Vmj+E2DnWtpOaPKP+an2O9883DZ6ABVk/l1E6RyW5UFC1ugXYOoQiLemGKcMvAVpIcZcnGB0CeDo+ZPxngM+RskL+WJbxLXexesj2CiIfqlGxu7MNu8JcAuUFIQi2O23tY976VLBWrVPvhyqzp7cgC0UCdjTmUyc00AjoXlnz+mdxAvrdMd/Hz5LjlWh8BjFuZ9z5pG3LCeD/75mIx5FrrCQ== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(86152002)(189998001)(87936001)(62966003)(105606002)(19580395003)(77156002)(68736005)(19580405001)(104016003)(77096005)(5001960100002)(5007970100001)(5001860100001)(110136002)(85426001)(69596002)(50226001)(97736004)(47776003)(5001920100001)(229853001)(4001540100001)(81156007)(64706001)(6806004)(2351001)(48376002)(92566002)(50466002)(36756003)(50986999)(46102003)(76176999)(86362001)(2950100001)(106466001)(5003940100001)(33646002)(5001830100001)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR0301MB1267; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1267; 2:GEFNKb4WrobmYrSMN2gr44FHchZM4Ec6OdXFVXN2SjEHeEAyGJ3LaLM9cBNn0nissMQn+I3gbuHd97P/7Qzd4v3gTf0iI83e/Rt5D3c+Mka7gka94ZR18GYTF2jfhsTsCFZ0DG7MW1q7vkzfgZunPfJBal6pgR6PVTXJZdhqpew=; 3:qoBQiE2mlP+9twPvtaOccNdwN56WXo1MZVhUb7gCMAEH5EjrMMiS7G9SLsZhm1zsRSVPcdSwB0AtPbz2b77Re2keMjqHfJiPhuIcYTOcSR5sFlNxfNFAvxZF4GFAZFoUE40vQ/jVAfHW23cSf42eRxK+7M6RznKUzhvHj/HPUbdV2TevFZU/5IICA2LWhnZVGlhqjLG2GEUTkwu76JXKUXjaU1cewlG9bS6aKojRm54=; 25:uTGpABGgYLJqV8UHYhLBF91zKdTfm3WQOghwcguS17s33NSlYIoNHnURynoD/PjomF9vkzsswi6MoPXGAdhbjrI1ozNzQ641pWFpJ2pf1UYLUS0frSipEYAPv6S54nwbfDm9DML08MLPNwPxzalD3DcMx6uRIgJpbq1T9weVBx2J6AZv61Up2tdGXypW2H+FM19+mZ87AscxxkR8qjZYNgoaW2YFWS30Aa1KL4gyencrKTkFxoJCEMyFTo3ItUrI X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0301MB1267; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1267; 20:Kln5QYnjc38UDh1Cvfq+k7E9zZi0IuDiPJrNDofdGd0YMq1sO8wbOHXVx2SNoY/aRsRrwZK/EaOQI3HZgkDSFWz8QYv93Fmz71xMw5YycXZwVyxneUs4Em8bXRxjfPyRBd8ex97qQfjor9SG1EkTVJVBG+7w3KTomp/dvD34WlMvcviiyysRf6dBvZw1DprVQzpMAjBkkqDMhLeeWRtdWTlfJi9zEQKI44e8CLTgCWp0KtR0Gx0Q2zz5Ex/zbmotka82MpajANzlGOvrh/9ZCAtsBHUT1fCYI/BCC6vPVgeFOj/sWzhtSREdMko8clIuub6pnNa9VVevz71GD/6jVCHg5ra6JubJJfOG78Ui1i4=; 4:aRwL9lxVBX32XmjmAkEGUVQw7XSRTOCs9FErd6EcOe9D5t+t2nn1c43+lNmyV8LEOBcfnwEMeNHHN49M/r9iUEk43+56jQ1ZM97k/06aTtDpK3VHRiR0arjkTkIPPXnZx2vC0rnqCwDnqNNjBvjxm2P47hiBPFThj3XWrvhqdk//nJ58VmGcKQnUY/n1ig+ts0nQrp9yXAeqncCB/Izp8Dv0eLs9AjvIrS91Y23Seo1cJgSNAQjXldnDyJRrffGxfFUXo4JFS0EG6RGqnR/0IBbt2zQf4eeJ+LBvf0CzZQ8i8q0DDXgD8354+I9S3xrVVTktge2pFajMcgR98nAZy2qe4EjzUpUo23V2RR+aM8U= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(8121501046)(5005006)(520078)(520075)(3002001); SRVR:BN3PR0301MB1267; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0301MB1267; X-Forefront-PRVS: 07025866F6 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0301MB1267; 23:+nE3Sxktzd6VavrarfJTyQej6rUYUCCcIPCejNw?= =?us-ascii?Q?ish4vdx0s6NyH7bBLIBq1fzhqYKQxBwejCGMeQ4nVkUtoo2mwBMyqTARaZjB?= =?us-ascii?Q?/ISxteJddyUP1QD1u/CIlOtDCfCHW2tVLN/MeerEESnj6yA9VsH3YCcHbGNg?= =?us-ascii?Q?Ao45V1vnfeZepOHQ1IDX8PuX0yOxCkyoZQtIuncs06Pf5VMc/y+gpbu1KfVx?= =?us-ascii?Q?bNcjOOkmIjJ9GGQTMWFxABOvu4VWsJCkDqgvzNwmqFcc1ekHD3PeVMa5jV6n?= =?us-ascii?Q?Dqrw5r0Yqfhncs9W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ascii?Q?nmvaQI6nteUxBBRs4/feYM8+loCy+ZMm10bubu3Tnz7mUTdRjmAS649x7n5D?= =?us-ascii?Q?aE7+/g46xf/c/oBEqDpeRQmnPAwQhBt1Y0UBUP2wx?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1267; 5:HOdy6Gx8JZcoSIWojAboFdpxd7CIcPxO1AHd1c2ZKNGF8P06kA7911htDqALK8J+QhZTFCit4cnug5BQBEjn3aJkBsDO0ZlcdXWC8b8oEKTFtmJsL2nTVk2ux4kT0PyHCHHUB401gwAE9cuQaBYshQ==; 24:fkn38lxV322uHWCTySr42sSYq3CNC2+ffjkovx/Kfc2zF7UUWPnSAG5RTLi9quyNFy+Mjq+SzvfabInF+jUvsQrb9EfSV5npkoSWcdUImC0=; 20:8seEQC6k1mx6s/z61cCJDFeY2SSFwrfZPm78co+l3SkldSZCiiPMDxSTL1sH+d+M5Nxkbu1ZgXr9UA/ANsvmzA== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2015 13:24:49.3866 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0301MB1267 X-Topics: patch Cc: petri.savolainen@nokia.com, stuart.haslam@arm.com Subject: [lng-odp] [API NEXT PATCH v6 11/14] validation: system: add validation for new CPU APIs X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Hongbo Zhang This patch adds validation codes for newly added CPU APIs: odp_cpu_modle_str_id() odp_cpu_hz_id() odp_cpu_hz_max() odp_cpu_hz_max_id() and the new odp_cpumask_all_available() is verified too. Signed-off-by: Hongbo Zhang --- test/validation/system/system.c | 62 +++++++++++++++++++++++++++++++++++++++++ test/validation/system/system.h | 4 +++ 2 files changed, 66 insertions(+) diff --git a/test/validation/system/system.c b/test/validation/system/system.c index 7f751a3..eebeb52 100644 --- a/test/validation/system/system.c +++ b/test/validation/system/system.c @@ -6,6 +6,7 @@ #include #include +#include #include "odp_cunit_common.h" #include "test_debug.h" #include "system.h" @@ -58,6 +59,23 @@ void system_test_odp_cpu_model_str(void) CU_ASSERT(strlen(model) < 127); } +void system_test_odp_cpu_model_str_id(void) +{ + char model[128]; + 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++) { + snprintf(model, 128, "%s", odp_cpu_model_str_id(cpu)); + CU_ASSERT(strlen(model) > 0); + CU_ASSERT(strlen(model) < 127); + cpu = odp_cpumask_next(&mask, cpu); + } +} + void system_test_odp_sys_page_size(void) { uint64_t page; @@ -83,14 +101,58 @@ void system_test_odp_cpu_hz(void) CU_ASSERT(0 < hz); } +void system_test_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); + CU_ASSERT(0 < hz); + cpu = odp_cpumask_next(&mask, cpu); + } +} + +void system_test_odp_cpu_hz_max(void) +{ + uint64_t hz; + + hz = odp_cpu_hz_max(); + CU_ASSERT(0 < hz); +} + +void system_test_odp_cpu_hz_max_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_max_id(cpu); + CU_ASSERT(0 < hz); + cpu = odp_cpumask_next(&mask, cpu); + } +} + CU_TestInfo system_suite[] = { _CU_TEST_INFO(system_test_odp_version_numbers), _CU_TEST_INFO(system_test_odp_cpu_count), _CU_TEST_INFO(system_test_odp_sys_cache_line_size), _CU_TEST_INFO(system_test_odp_cpu_model_str), + _CU_TEST_INFO(system_test_odp_cpu_model_str_id), _CU_TEST_INFO(system_test_odp_sys_page_size), _CU_TEST_INFO(system_test_odp_sys_huge_page_size), _CU_TEST_INFO(system_test_odp_cpu_hz), + _CU_TEST_INFO(system_test_odp_cpu_hz_id), + _CU_TEST_INFO(system_test_odp_cpu_hz_max), + _CU_TEST_INFO(system_test_odp_cpu_hz_max_id), CU_TEST_INFO_NULL, }; diff --git a/test/validation/system/system.h b/test/validation/system/system.h index d05f104..97cc179 100644 --- a/test/validation/system/system.h +++ b/test/validation/system/system.h @@ -14,9 +14,13 @@ void system_test_odp_version_numbers(void); void system_test_odp_cpu_count(void); void system_test_odp_sys_cache_line_size(void); void system_test_odp_cpu_model_str(void); +void system_test_odp_cpu_model_str_id(void); void system_test_odp_sys_page_size(void); void system_test_odp_sys_huge_page_size(void); void system_test_odp_cpu_hz(void); +void system_test_odp_cpu_hz_id(void); +void system_test_odp_cpu_max(void); +void system_test_odp_cpu_max_id(void); /* test arrays: */ extern CU_TestInfo system_suite[];