From patchwork Wed Sep 5 14:00:06 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: 145998 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4976372ljw; Wed, 5 Sep 2018 07:03:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYsnCroJuBgazeUyX7Zm0Z91h4HcxDihwHykDQI8KNv2o+O5XX1Na/HXbObeL6mpVBx4nLe X-Received: by 2002:a0c:d19b:: with SMTP id e27-v6mr32690437qvh.41.1536156204232; Wed, 05 Sep 2018 07:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536156204; cv=none; d=google.com; s=arc-20160816; b=r56zcfpr7M6Q57GfAYxvspX2aDR4b7GQiY9qgQ8ffiDyMZbDQCu1WyALSHrN03Q4E7 u1Hl4Qad43uM6aj0HmDE269F9+l8h1N4HPrFIqAz0hz0e3me1/S+hY6kP/XXiUyGoSJI By6pN2RtdFgsL9T8xcMAj3/v5pp9b51dAPmpStAlsa62ayJ9mu1N+vGbpnROsdAshHkR dA8YgA5SHvyLhF4GCfdkKz5ggqf8cTVIPqdgPcLG9Kfl7lN0vUkBv7h1WadkAVj5yyfy LFq+wNQ1a7aAlnNsjD2DIw9glFUe5wTgjBThp9QraJRRO/Qo8Sbd6ojh9u35muOiOFWn +hJg== 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; bh=2WvqMWUP20mNETAih7Zyu3Os3knwkObLr95motCqI50=; b=JPMuH25nwepydKzZlSSdS6Cl3DkyYr6HpYTm0zp5B7paRnwirtPydjaYQ+xVYt47H/ NrHiYQW7KC/tZ+YV+v5yMlhPd+DdlhXzs8/1YIUuupsIhOkqS68FIEC/6tv9F8PL2rEc bBQtGA7Wh9VlR2EX6uO2mtRM8u7TTZsCcfU1dxgzTLUq0bK5+7Z/8kpbbgyhVkugSESK 9Xq0Bsndkma3izdd0N6DWLx1xFGFg9Z0ci1UXieioXHMowfx+QdFJkK5DjL5fyq1AKs1 nvCQmKN91SrOx56IvA01g7fvjtyAOXQn2zPlmHWETWA+BqN9xI2807xRpZ5dJDzQnAVj N9pQ== 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 l31-v6si1537177qva.232.2018.09.05.07.03.23; Wed, 05 Sep 2018 07:03:24 -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 D2B336862B; Wed, 5 Sep 2018 14:03:23 +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 B8CE960949; Wed, 5 Sep 2018 14:03:12 +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 C942C685DF; Wed, 5 Sep 2018 14:03:08 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 878A268600 for ; Wed, 5 Sep 2018 14:00:12 +0000 (UTC) Received: from mxback10j.mail.yandex.net (mxback10j.mail.yandex.net [IPv6:2a02:6b8:0:1619::113]) by forward102p.mail.yandex.net (Yandex) with ESMTP id C171F43065A0 for ; Wed, 5 Sep 2018 17:00:10 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback10j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 95igWvgLkP-0AdS4Ieh; Wed, 05 Sep 2018 17:00:10 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id XcngjjK9pV-09Jq5IuS; Wed, 05 Sep 2018 17:00:09 +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, 5 Sep 2018 14:00:06 +0000 Message-Id: <1536156008-9721-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536156008-9721-1-git-send-email-odpbot@yandex.ru> References: <1536156008-9721-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 693 Subject: [lng-odp] [PATCH v5 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: a057d7593fa6375352a84ec9ce2c997b6581b790 **/ platform/linux-generic/odp_system_info.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index bca02ba14..608fa51e5 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -442,8 +442,9 @@ int odp_sys_huge_page_size_all(uint64_t size[], int num) /* See: kernel.org: hugetlbpage.txt */ dir = opendir("/sys/kernel/mm/hugepages"); if (!dir) { - ODP_ERR("Failed to open huge page directory\n"); - return -1; + ODP_PRINT("Failed to open /sys/kernel/mm/hugepages: %s\n", + strerror(errno)); + return 0; } while ((entry = readdir(dir)) != NULL) { From patchwork Wed Sep 5 14:00:07 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: 146000 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4978991ljw; Wed, 5 Sep 2018 07:05:13 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbxLxRukaayYkDAnb6EFuth3TpHimz4DmhlCzrvppU4IYtffy6rDl8xu/BHw6kJnKWERy99 X-Received: by 2002:a37:c511:: with SMTP id p17-v6mr28676626qki.136.1536156313720; Wed, 05 Sep 2018 07:05:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536156313; cv=none; d=google.com; s=arc-20160816; b=1CI+c2HoRmeQl4ljj2/AqmCpic1hnZJ9+k/J7Xqg5xyVyx/PiUQYU1JYdpyA0RFgeP Qk6524ORzbMO/J1RPpRFB8V26R9mvlnbVulLn1SCQr7Mbjy+kfidi2ybS+Hy1ErIWj9W cYB+wbQTEwFg5kjzjKmSTudYGtvDBERd+e8UP7R/+uzS6/qEuexPvZmNg6iViL7QKJsH zieK+VBmmRvsTQQINBtD2dw4F8IKkcqC3cGHEAsqzUXvSoFNIyRge0sho37EKgwVNVva TyKRyVB89Ffs9ypzVfXaDr3pIdci60feEsCp6i+cDPgrNaPdHmFwDId0cLn46bbaHFVR LqIw== 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; bh=YUAtHcrAR1L2jhruLyjVw9TqXbV48Qf98WIegqphh6g=; b=MLYIGLV+ykfXC24XXbdQwl+TztjCsoT3hsH8/3fJiet2N45OPuWHMvNztEpzWtjV7Q AYQWJTKRFH3JnK6Zzkj7KZuoV3/8QhKBGDnM8R4v+7/Oc+Jakea8Gh37k0nMSBzDc/6c sag0YhvRkYhWHZmUwJoJfWxGIYj+wTuYsDBlGrudmbBRnVaX3g35IAFjFWJbIZ8+uYqx Jtk3S+9Ihn3UckTQyGYMaNmo7VTeUd3eTcVBWQA4w8U8KajZSBIE25bE2slx4J59I+gM GLmA3QmrbE5ybLJDf8ERkS6EKsD+/CtDGKGRiuT06cIedBT5ijzZcBPg2h7OP5a0/fDA pgbw== 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 c16-v6si1472429qkb.72.2018.09.05.07.05.13; Wed, 05 Sep 2018 07:05:13 -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 3AC33685DF; Wed, 5 Sep 2018 14:05:13 +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 E2AB960949; Wed, 5 Sep 2018 14:03: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 0140968600; Wed, 5 Sep 2018 14:03:14 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id 2D88F68610 for ; Wed, 5 Sep 2018 14:00:13 +0000 (UTC) Received: from mxback6j.mail.yandex.net (mxback6j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10f]) by forward100o.mail.yandex.net (Yandex) with ESMTP id A24992A27480 for ; Wed, 5 Sep 2018 17:00:11 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback6j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id MhgkJBSXrj-0BiC2N6Y; Wed, 05 Sep 2018 17:00:11 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id XcngjjK9pV-0AJeO6PF; Wed, 05 Sep 2018 17:00:10 +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, 5 Sep 2018 14:00:07 +0000 Message-Id: <1536156008-9721-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536156008-9721-1-git-send-email-odpbot@yandex.ru> References: <1536156008-9721-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 693 Subject: [lng-odp] [PATCH v5 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: a057d7593fa6375352a84ec9ce2c997b6581b790 **/ .../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 Wed Sep 5 14:00:08 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: 145999 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4978296ljw; Wed, 5 Sep 2018 07:04:45 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaIvq/WbjBcaHVFtw3BLnhr1L4avMDg6+yxlwHpXUdAP1pqAlaejWW/9MoNKn5z4MvZCONx X-Received: by 2002:a37:a6ca:: with SMTP id p193-v6mr32636554qke.226.1536156284471; Wed, 05 Sep 2018 07:04:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536156284; cv=none; d=google.com; s=arc-20160816; b=fQkpdJaSTkAb50OGCPGKZd9gTi5glfhiZOJUcL7dCj4bKPXh3clJkhSFiNoyq4KaVe /22umVSuqiLJ5yySGk+AlKlD7zXK9SLT4+UjGEC4u5PT6QgA5H7Xy737I7Ev99X5Zpbw MxRFxJBT8SqbwBiMya9UDpEGLrNqo5HfwA2yxV1Kcv4deuiLV7xRfJyNdd07MfC0EjYS nMYNldpqwtMmRtMPrp+jReZh8x/KdEY6jUDuHQUOkCTJdjEh61vW07cVWuacjCIqHFjE +rc9Gh3lEMPzmmmqdBOXa+K212nssKH0hZPkg/ejkKhCCkYgkkT/nNGIaLQqmFgJPR9p qrew== 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; bh=FHvBDuQiXhYO/bTZLVL3qMgn5tnfUpAQplT2Pin6zmk=; b=CliKk87XsAR1/Ujds5ehqD7VVH6C36DpaqeEHKBUD835aYrk8iosvR59MZKGwY3Qtl kF2/5MfN2Yith23hEEuKmtHmbvxmB8p3gSxH+hnylghmW8ILUMQGuOOLvDqK6vm+W5hq bf4nFzT6Utt0nhQFi5eLGCGYILV9dxSClErSAKWB+MYvx9X8TKqjuiSTmCvg90O/RZ8v NGo4gjeXdEeEnicnlqa20KY8C8rluJZ0/lu0c84+19ySREiDO9dh21hDXc9FJRIYLQu6 +LzL2kSVU+l4HGxz+2mu+n9sEUrrCbR35SpNUQ4hCw9i8ykYpMZHxt+FCw6hjHY/yLgQ c0Pw== 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 q39-v6si1456521qvf.246.2018.09.05.07.04.42; Wed, 05 Sep 2018 07:04:44 -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 D199768600; Wed, 5 Sep 2018 14:04:42 +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 8F838685CD; Wed, 5 Sep 2018 14:03:21 +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 183A9685BD; Wed, 5 Sep 2018 14:03:12 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id DD65C68616 for ; Wed, 5 Sep 2018 14:00:13 +0000 (UTC) Received: from mxback15j.mail.yandex.net (mxback15j.mail.yandex.net [IPv6:2a02:6b8:0:1619::91]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 691815606DBE for ; Wed, 5 Sep 2018 17:00:12 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback15j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 2B7qE7qP8h-0Cg4Hv8I; Wed, 05 Sep 2018 17:00:12 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id XcngjjK9pV-0BJqP136; Wed, 05 Sep 2018 17:00:11 +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, 5 Sep 2018 14:00:08 +0000 Message-Id: <1536156008-9721-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536156008-9721-1-git-send-email-odpbot@yandex.ru> References: <1536156008-9721-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 693 Subject: [lng-odp] [PATCH v5 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: a057d7593fa6375352a84ec9ce2c997b6581b790 **/ 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)