From patchwork Tue Sep 4 20:00:12 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: 145956 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4089029ljw; Tue, 4 Sep 2018 13:03:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ4Z5nvYNHNe5mD3eawfWO+kZRFnxLApqF13h174y/lF6GLRpnGCri5krraOOv7dAzq+su4 X-Received: by 2002:a37:3609:: with SMTP id d9-v6mr30217933qka.117.1536091405670; Tue, 04 Sep 2018 13:03:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536091405; cv=none; d=google.com; s=arc-20160816; b=0moBP4NBUfTOx5iaOeoI7zCMQwNtePJMw9CN9gQ9eBKB3h8rwgHE69aHAhK9fBXfOu eoBYcKDgHTMLpHUUNeAahfqIeZN5nLZCAiF37CGRWdjcg1Upb45UkVbHcO9Ygf9fUd15 zCqNgmHQj42w095063D/rqFMZiB3As+OsCp5Xhz7I1zy2+mhWYXcklB7+74I/bNWdkeU vdedYe/Ug/QdLy0MQh4FpeTsF6M1Kh6JABHu0Sv2TXjKlzQt8s5s+TZaUSBYfTEkE/25 naOu5ojppoBeWmcz8VFEaWY2LoApi1u3jdRIzTO9bwzl3BO++3cw8jKQMqNqMaFdPhsR SHUQ== 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=dyFpDKa+BHQ4cRfU1Q+N0Kryk7/fizHufnnSVJEYKtg=; b=CsDDPG+EIPtQysm0ReUFnGsSzO5X6kO4+LNDEE1yA7dL3gyIckv54dHt4GaAy/qddA aDov576xtdwYW6IrBhQXgoGtDRakcz6Fl12Q8NmwMCsR0AzQ/9ICkgWSvdISvOEWHTYj EBS03nV3xcNapzl86aK5O6Q676OJQRlAf1kV7WC0hjyonJJ9dDpL/IaFeC9ht7kU2P2G p0mP20pAwMfRUwVRC+ybHzfsARhG/sRKpKOhxm/jtM7210LzGC6hWhw/Z+BjrUDhEMRb YIMQfLaaItei7pDZK8t5MXTf8nJvykwSDzJkwwW6V64xNOlNOYWiejBu/HlqT9RuSmsM H+vg== 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 44-v6si4278008qvk.145.2018.09.04.13.03.25; Tue, 04 Sep 2018 13:03:25 -0700 (PDT) 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 589336863F; Tue, 4 Sep 2018 20:03:25 +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=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, 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 1669768623; Tue, 4 Sep 2018 20:01:10 +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 A97296865A; Tue, 4 Sep 2018 20:01:05 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id B89C06864A for ; Tue, 4 Sep 2018 20:00:17 +0000 (UTC) Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net [IPv6:2a02:6b8:0:1619::84]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 568252D879A7 for ; Tue, 4 Sep 2018 23:00:16 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id nAUh3vuqc5-0G2uoFDV; Tue, 04 Sep 2018 23:00:16 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IylVyLJbGm-0FnCGhYA; Tue, 04 Sep 2018 23:00:15 +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: Tue, 4 Sep 2018 20:00:12 +0000 Message-Id: <1536091214-8037-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536091214-8037-1-git-send-email-odpbot@yandex.ru> References: <1536091214-8037-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 693 Subject: [lng-odp] [PATCH v4 1/3] linux-gen: sysinfo: return 0 if hugepages are not supported 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: Dmitry Eremin-Solenikov Per API return 0 from odp_sys_huge_page_size_all() if hugepages are not supported/detected. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: e9faf7a05e0ad39aa6fc47d412584fd97d85c724 **/ platform/linux-generic/odp_system_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index bca02ba14..2ac8b32bb 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -443,7 +443,7 @@ int odp_sys_huge_page_size_all(uint64_t size[], int num) dir = opendir("/sys/kernel/mm/hugepages"); if (!dir) { ODP_ERR("Failed to open huge page directory\n"); - return -1; + return 0; } while ((entry = readdir(dir)) != NULL) { From patchwork Tue Sep 4 20:00:13 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: 145957 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4089074ljw; Tue, 4 Sep 2018 13:03:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZD3excAzkr5XM09z5dK0gf77jeVgPesBXbOjabrteqrJrodqat8O7Jbs9ILJcnmrceYBjX X-Received: by 2002:aed:3466:: with SMTP id w93-v6mr2204434qtd.342.1536091408769; Tue, 04 Sep 2018 13:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536091408; cv=none; d=google.com; s=arc-20160816; b=nbelnagRYBsL4nZ3YBcTDgQBfYCn7yap2kprOOoYQsaBCRI47akaCbAysxS63F08WX Dy9ok/q+XmuTsmPidEQ5SIbV1JqHy4+MOs+ReoTceApAwQ1vqg9AlQ69D52jO7KOIXJ0 hJqY3D2xlgPX6RuwZavKavTC2oqBXDR2zKqdambDP7ROfjfEPglft79YrhUebjpk5kWc IEcIlmsr0z2+VYKjUal70cU3LVW4zrM5DcA2NfJ2T03SVcro/cOCp8Kk8XGwLZhci0ej 8Ol/9mzREzkxNOlDvQFrpzVzCKusEaw/G00TIO6Q+27Hg3VaiU8/rFnRvU+nJxElnXLF 5ozQ== 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=17LlpQTQWMIQiJOY7m5hMWZl9X2wWNd8s7YfmoGIVow=; b=SCKEXwxQE2sOQFq65uIWRpeRJe+34/XoKTICN67s11Q+WQQGdGYHlM882sZtTz54sP TkPKfexi5wqgXN9Jq4kqwrcESc3I8WslYvtgJyL9qtIrlfcpI7ftRwcM9SuvatrOR3yH SypwQbCSuDF69DBdEYI9biHW+JATWkImPSNE2zDEibSqfM0P9ggRz+zYr1IBb75wE6F7 gyEVcWMtFGeewVCsuKbwfe408b1s0Vxikyxg7Ypb4YS+Hi4irQ9avnCoZjtOg7lg/n56 LIJOPBiDCabHZjpiJSr2yNNgZ/j/Shi3K3GSKVLazuXEJD2XKzghnyqQuIE0/lwAtcgm lNmQ== 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 z2-v6si4186481qvi.288.2018.09.04.13.03.28; Tue, 04 Sep 2018 13:03:28 -0700 (PDT) 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 6AF8F6863F; Tue, 4 Sep 2018 20:03:28 +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=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, 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 7AB0B68642; Tue, 4 Sep 2018 20:01:15 +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 1E5466865A; Tue, 4 Sep 2018 20:01:10 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id 2B1A568644 for ; Tue, 4 Sep 2018 20:00:18 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 1E32C2D87EC1 for ; Tue, 4 Sep 2018 23:00:17 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id tgfwQWKWkO-0H3e3Y57; Tue, 04 Sep 2018 23:00:17 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IylVyLJbGm-0GnCrdit; Tue, 04 Sep 2018 23:00:16 +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: Tue, 4 Sep 2018 20:00:13 +0000 Message-Id: <1536091214-8037-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536091214-8037-1-git-send-email-odpbot@yandex.ru> References: <1536091214-8037-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 693 Subject: [lng-odp] [PATCH v4 2/3] linux-gen: x86: as a last resort parse max cpu freq from bogomips value 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: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: e9faf7a05e0ad39aa6fc47d412584fd97d85c724 **/ .../arch/x86/odp_sysinfo_parse.c | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c index 504aa3efa..5084e6b5f 100644 --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c @@ -15,34 +15,54 @@ int cpuinfo_parser(FILE *file, system_info_t *sysinfo) char str[1024]; char *pos, *pos_end; double ghz = 0.0; + double mhz = 0.0; uint64_t hz; int id = 0; + bool freq_set = false; strcpy(sysinfo->cpu_arch_str, "x86"); while (fgets(str, sizeof(str), file) != NULL && id < CONFIG_NUM_CPU) { pos = strstr(str, "model name"); if (pos) { + freq_set = false; + /* Copy model name between : and @ characters */ pos = strchr(str, ':'); pos_end = strchr(str, '@'); - if (pos == NULL || pos_end == NULL) + if (pos == NULL) continue; - *(pos_end - 1) = '\0'; + if (pos_end != NULL) + *(pos_end - 1) = '\0'; + strncpy(sysinfo->model_str[id], pos + 2, MODEL_STR_SIZE - 1); if (sysinfo->cpu_hz_max[id]) { + freq_set = true; id++; continue; } /* max frequency needs to be set */ - if (sscanf(pos_end, "@ %lfGHz", &ghz) == 1) { + if (pos_end != NULL && + sscanf(pos_end, "@ %lfGHz", &ghz) == 1) { hz = (uint64_t)(ghz * 1000000000.0); - sysinfo->cpu_hz_max[id] = hz; + sysinfo->cpu_hz_max[id++] = hz; + freq_set = true; + } + } else if (!freq_set && + strstr(str, "bogomips") != NULL) { + pos = strchr(str, ':'); + if (pos == NULL) + continue; + + if (sscanf(pos + 2, "%lf", &mhz) == 1) { + /* On typical x86 BogoMIPS is freq * 2 */ + hz = (uint64_t)(mhz * 1000000.0 / 2); + sysinfo->cpu_hz_max[id++] = hz; + freq_set = true; } - id++; } } From patchwork Tue Sep 4 20:00:14 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: 145958 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4089530ljw; Tue, 4 Sep 2018 13:03:56 -0700 (PDT) X-Google-Smtp-Source: ANB0VdablaeS8tVlvBaiP7dZ4wK7CKRzk72ataOK5QCFS6g0Y1aiSTWPSc/6WYXiZq24cVwUwysc X-Received: by 2002:ac8:2f24:: with SMTP id j33-v6mr30535027qta.93.1536091436359; Tue, 04 Sep 2018 13:03:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536091436; cv=none; d=google.com; s=arc-20160816; b=BTm2QdKLqjsLWXob5ISoTRRGomaH4JKucl9yKH5Kwd6qO/tvW+xJyYviQCD5mwTjqg VkiSLBDjrL/r7riAF7Dn2oSKpyRLi9F4/N7KczLTXrgCWeKO8QX1stYPHy0rZYoZVz12 KyP+hllTxIFlQG5qmnrsRRoUCFi/lYNrKkxHvDZ+p0PnHh/ckds/l7avnrSlmelUmcPR mBm5KJ5n4GHnGhLsru+B3/qrQ6pTxWSYZFFkfXEWxXaBIOOvqXkvUZu7l+0rVColntiI nuIm2UckkJIfgjLmG16/QBquteKjc1qaCGjsjsueCAkyHuIBAt7vZS2bNom+Ttm3EZ7k YZAA== 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=LYzfdiJxUi3aJpFJ8brEVgz0Q0LaFDj6yYk/JBuUTEE=; b=uSPSNb7LGG80540Ruz3DfRT07H39RZl1tyreuMjgkVjDd9Wsqi9IqUM9ll1CEYJKOt 8f4nUoujCtmkvwnUuI7LggPApwHWg+8SGlQ35KJAq6oqaeRbnVUPBOKxqy3G/G/cho++ g8g0aQEzm2rPZd9j+jXfFpXH9ASeeIx+NktwKCFjTMjCGna24fKVVdIN1/qDNNJXRs1i Y2IetSMF7fV97cjeQXwnmhH7gjRxod8xKkefcYy6JvKYbO5L0nf8XvH3pFNcpRH3ynV3 M0UPNfgoT7b6bE2or82x+dflU976pfNqjH0jaQ7mRlAHBFfmhnFU3nXJVj7EfKxfDGMq 6Zzg== 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 w12-v6si3931234qkf.264.2018.09.04.13.03.56; Tue, 04 Sep 2018 13:03:56 -0700 (PDT) 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 123BB68642; Tue, 4 Sep 2018 20:03: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=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, 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 C939068639; Tue, 4 Sep 2018 20:01:22 +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 EDCDB6864C; Tue, 4 Sep 2018 20:01:17 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id 7672668639 for ; Tue, 4 Sep 2018 20:00:19 +0000 (UTC) Received: from mxback12j.mail.yandex.net (mxback12j.mail.yandex.net [IPv6:2a02:6b8:0:1619::87]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 1C7A12183CAA for ; Tue, 4 Sep 2018 23:00:18 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback12j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id P4LEtUMa2m-0HZGi0Ai; Tue, 04 Sep 2018 23:00:17 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IylVyLJbGm-0Hnmpi8E; Tue, 04 Sep 2018 23:00:17 +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: Tue, 4 Sep 2018 20:00:14 +0000 Message-Id: <1536091214-8037-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536091214-8037-1-git-send-email-odpbot@yandex.ru> References: <1536091214-8037-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 693 Subject: [lng-odp] [PATCH v4 3/3] validation: system: 0 is valid huge page size 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: Dmitry Eremin-Solenikov If system does not support huge pages, odp_sys_huge_page_size() will return 0, which should not be rejected by test. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: e9faf7a05e0ad39aa6fc47d412584fd97d85c724 **/ test/validation/api/system/system.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/validation/api/system/system.c b/test/validation/api/system/system.c index 75fd26f31..f016a2ded 100644 --- a/test/validation/api/system/system.c +++ b/test/validation/api/system/system.c @@ -216,7 +216,11 @@ static void system_test_odp_sys_huge_page_size(void) uint64_t page; page = odp_sys_huge_page_size(); - CU_ASSERT(0 < page); + if (page == 0) + /* Not an error, but just to be sure to hit logs */ + LOG_ERR("Huge pages do not seem to be supported\n"); + else + CU_ASSERT(page % ODP_PAGE_SIZE == 0); } static void system_test_odp_sys_huge_page_size_all(void)