From 8132273c12f1f6e5ce0bbd44cffc8bd642bcb706 Mon Sep 17 00:00:00 2001 From: Dino Madarang Date: Thu, 19 Oct 2017 20:41:05 +0000 Subject: NSB: Fix IndexError in pin_vcpu_for_perf This addresses the IndexError in Standalone SRIOV/OVSDPDK context. The correct sys_cpu number should be sys_cpu-1 Error: threads = "%s-%s" % (soc_cpu[socket][sys_cpu], soc_cpu[socket][-1]) IndexError: list index out of range Tested platform: (Hyper-Threading disabled) NUMA node0 CPU(s): 0-21 NUMA node1 CPU(s): 22-43 With socket equal to 0, sys_cpu value was 22 which resulted to IndexError. Change-Id: I36b045cacce4caff4b5ddafaa9b6737f1c6df0a1 Signed-off-by: Dino Simeon Madarang Reviewed-by: Alain Jebara Reviewed-by: Deepak S Reviewed-by: Ross Brattain Reviewed-by: Edward MacGillivray (cherry picked from commit 78fff64b00e255d7e4624bcc62faddc0d135e5a2) --- yardstick/benchmark/contexts/standalone/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yardstick/benchmark/contexts/standalone/model.py b/yardstick/benchmark/contexts/standalone/model.py index ffd8858d9..45ae3c18a 100644 --- a/yardstick/benchmark/contexts/standalone/model.py +++ b/yardstick/benchmark/contexts/standalone/model.py @@ -222,7 +222,7 @@ class Libvirt(object): soc_cpu = sys_obj.get_core_socket() sys_cpu = int(soc_cpu["cores_per_socket"]) cores = "%s-%s" % (soc_cpu[socket][0], soc_cpu[socket][sys_cpu - 1]) - if int(soc_cpu["thread_per_core"]): + if int(soc_cpu["thread_per_core"]) > 1: threads = "%s-%s" % (soc_cpu[socket][sys_cpu], soc_cpu[socket][-1]) cpuset = "%s,%s" % (cores, threads) return cpuset -- cgit 1.2.3-korg