[V1] nics/system_info:adapt some environment memory echo unit is GB
Commit Message
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 <junx.w.zhou@intel.com>
---
nics/system_info.py | 4 ++++
1 file changed, 4 insertions(+)
Comments
>-----Original Message-----
>From: Zhou, JunX W
>Sent: Wednesday, March 24, 2021 11:09 AM
>To: dts@dpdk.org
>Cc: Zhou, JunX W <junx.w.zhou@intel.com>
>Subject: [dts][PATCH V1] nics/system_info:adapt some environment memory echo unit is GB
>
>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 <junx.w.zhou@intel.com>
Tested-by: Zhou, Jun <junx.w.zhou@intel.com>
> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Zhou, JunX W
> Sent: 2021年3月24日 11:14
> To: dts@dpdk.org
> Subject: Re: [dts] [PATCH V1] nics/system_info:adapt some environment
> memory echo unit is GB
>
> >-----Original Message-----
> >From: Zhou, JunX W
> >Sent: Wednesday, March 24, 2021 11:09 AM
> >To: dts@dpdk.org
> >Cc: Zhou, JunX W <junx.w.zhou@intel.com>
> >Subject: [dts][PATCH V1] nics/system_info:adapt some environment memory
> echo unit is GB
> >
> >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 <junx.w.zhou@intel.com>
>
> Tested-by: Zhou, Jun <junx.w.zhou@intel.com>
Applied, thaks
@@ -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)