From 02dde08c1b6f318d2a9ca8dbd1c6ecf679947a33 Mon Sep 17 00:00:00 2001 From: Yulong Pei Date: Wed, 5 Sep 2018 23:19:42 +0800 Subject: [PATCH] fix CSIT broken issue when numa_node value is -1 on single Socket platform Single Socket platform e.g. Intel Atom cpu based SOC platform with Ubuntu 16.04.4(kernel 4.13.0-36-generic) or Centos 7.5 (kernel 3.10.0-862.el7), value of /sys/bus/pci/devices//numa_node is -1, this will break CSIT performance test running, but for this kind of SOC platform, it can consider that is not NUMA based platform, numa_node=-1 is reasonable, so fix it at CSIT side, when numa_node=1 and the system's NUMA node count is 1, set numa_node=0. DPDK also did it as this way. Change-Id: I9ac23d3cece2f1489e38f05b50a462bb2ad9f661 Signed-off-by: Yulong Pei --- resources/libraries/python/InterfaceUtil.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py index 878edd6fc2..290db1db67 100644 --- a/resources/libraries/python/InterfaceUtil.py +++ b/resources/libraries/python/InterfaceUtil.py @@ -26,7 +26,7 @@ from resources.libraries.python.VatExecutor import VatExecutor, VatTerminal from resources.libraries.python.VatJsonUtil import VatJsonUtil from resources.libraries.python.VPPUtil import VPPUtil from resources.libraries.python.parsers.JsonParser import JsonParser - +from resources.libraries.python.CpuUtils import CpuUtils class InterfaceUtil(object): """General utilities for managing interfaces""" @@ -582,7 +582,10 @@ class InterfaceUtil(object): try: numa_node = int(out) if numa_node < 0: - raise ValueError + if CpuUtils.cpu_node_count(node) == 1: + numa_node = 0 + else: + raise ValueError except ValueError: logger.trace('Reading numa location failed for: {0}'\ .format(if_pci)) -- 2.16.6