From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A5F8AA0A0A; Wed, 24 Mar 2021 04:11:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D49C40151; Wed, 24 Mar 2021 04:11:56 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 15B044014F for ; Wed, 24 Mar 2021 04:11:53 +0100 (CET) IronPort-SDR: GOPISLv/+ED+RyJSkj+PKnFcXVmsamXurQtzK4XMNInO9rDoAiAePe2bMbLS3E+aJwQ9EDho9c 8S0TtfnGepjg== X-IronPort-AV: E=McAfee;i="6000,8403,9932"; a="210710986" X-IronPort-AV: E=Sophos;i="5.81,272,1610438400"; d="scan'208";a="210710986" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 20:11:53 -0700 IronPort-SDR: KMPsWFEeiRo7fYOa+X2Sy7MJfzoCNYxbJhYdMLAiCwxxYaVrR7az/wvH3bKualyH5L/mphFUt3 A7IX6TxuOeXw== X-IronPort-AV: E=Sophos;i="5.81,272,1610438400"; d="scan'208";a="415276074" Received: from unknown (HELO localhost.localdomain.localdomain) ([10.240.183.111]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 20:11:51 -0700 From: Zhou Jun To: dts@dpdk.org Cc: Zhou Jun Date: Wed, 24 Mar 2021 11:08:37 +0800 Message-Id: <1616555317-21677-1-git-send-email-junx.w.zhou@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH V1] nics/system_info:adapt some environment memory echo unit is GB X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" The previous environment memory information unit is MB. At present, some new system memory information units are GB, and DTS needs to be modified for adaptation. Signed-off-by: Zhou Jun --- nics/system_info.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nics/system_info.py b/nics/system_info.py index da73b9f..70fdbf6 100644 --- a/nics/system_info.py +++ b/nics/system_info.py @@ -77,6 +77,7 @@ class SystemInfo(object): Size: 8192 MB Locator: DIMM_A1 Speed: 2133 MHz """ s_regex = r"(\s+)Size: (\d+) MB" + s1_regex = r"(\s+)Size: (\d+) GB" l_regex= r"(\s+)Locator: .*_(\w+)" speed_regex = r"(\s+)Speed: (.*)" size = "" @@ -88,8 +89,11 @@ class SystemInfo(object): total_size = 0 for line in lines: m = re.match(s_regex, line) + m1 = re.match(s1_regex, line) if m: size = m.group(2) + if m1: + size = int(m1.group(2)) * 1024 l_m = re.match(l_regex, line) if l_m: locate = l_m.group(2) -- 1.8.3.1