diff options
-rw-r--r-- | testcases/testcase.py | 8 | ||||
-rw-r--r-- | tools/hugepages.py | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/testcases/testcase.py b/testcases/testcase.py index d88840d7..0123b305 100644 --- a/testcases/testcase.py +++ b/testcases/testcase.py @@ -439,8 +439,8 @@ class TestCase(object): '-socket-mem\s+(\d+),(\d+)', ''.join(S.getValue('VSWITCHD_DPDK_ARGS'))) if match: - sock0_mem, sock1_mem = (int(match.group(1)) / 1024, - int(match.group(2)) / 1024) + sock0_mem, sock1_mem = (int(match.group(1)) * 1024 / hugepage_size, + int(match.group(2)) * 1024 / hugepage_size) else: logging.info( 'Could not parse socket memory config in dpdk params.') @@ -448,8 +448,8 @@ class TestCase(object): sock0_mem, sock1_mem = ( S.getValue( 'VSWITCHD_DPDK_CONFIG')['dpdk-socket-mem'].split(',')) - sock0_mem, sock1_mem = (int(sock0_mem) / 1024, - int(sock1_mem) / 1024) + sock0_mem, sock1_mem = (int(sock0_mem) * 1024 / hugepage_size, + int(sock1_mem) * 1024 / hugepage_size) # If hugepages needed, verify the amounts are free if any([hugepages_needed, sock0_mem, sock1_mem]): diff --git a/tools/hugepages.py b/tools/hugepages.py index bba40122..d233f04d 100644 --- a/tools/hugepages.py +++ b/tools/hugepages.py @@ -42,7 +42,7 @@ def get_hugepage_size(): for line in data: match = hugepage_size_re.search(line) if match: - _LOGGER.info('Hugepages size: %s', match.group('size_hp')) + _LOGGER.info('Hugepages size: %s kb', match.group('size_hp')) return int(match.group('size_hp')) else: _LOGGER.error('Could not parse for hugepage size') |