feat(CpuUtils): Allow suites to forbid siblings 86/40886/4
authorVratko Polak <vrpolak@cisco.com>
Tue, 14 May 2024 13:07:58 +0000 (15:07 +0200)
committerVratko Polak <vrpolak@cisco.com>
Tue, 14 May 2024 13:07:58 +0000 (15:07 +0200)
Some perf suites use a single unidirectional flow of traffic.
On SMT-enabled machines, 1C tests create 2 workers by default.
But if there is only one stream/flow,
only one worker does useful work.
The other worker on the sibling logical core
does busy-wait, which provably lowers the peformance.

Some suites already set smt_used (as a suite variable)
to False for these purposes.
This change edits a lower-level L1 keyword to honor this value,
and adds the suite variable to single stream (and client) hoststack
suites, where the detrimental effect of busy siblings was observed.

Change-Id: I203f1a700d8e6cd84640b9c0b40487cb832908aa
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
resources/libraries/python/CpuUtils.py
tests/vpp/perf/hoststack/10ge2p1x710-eth-ip4tcpbase-ldpreload-iperf3-bps.robot
tests/vpp/perf/hoststack/10ge2p1x710-eth-ip4tcpbase-nsim-ldpreload-iperf3-bps.robot
tests/vpp/perf/hoststack/10ge2p1x710-eth-ip4udpbase-ldpreload-iperf3-bps.robot
tests/vpp/perf/hoststack/10ge2p1x710-eth-ip4udpquicbase-vppecho-bps.robot

index c77d0f8..518469b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2023 Cisco and/or its affiliates.
+# Copyright (c) 2024 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -247,6 +247,9 @@ class CpuUtils:
         """Return list of DUT node related list of CPU numbers. The main
         computing unit is physical core count.
 
+        On SMT enabled DUTs, both sibling logical cores are used,
+        unless Robot variable \${smt_used} is set to False.
+
         :param node: DUT node.
         :param cpu_node: Numa node number.
         :param nf_chains: Number of NF chains.
@@ -278,6 +281,7 @@ class CpuUtils:
             raise RuntimeError(u"NodeID is out of range!")
 
         smt_used = CpuUtils.is_smt_enabled(node[u"cpuinfo"])
+        smt_used = BuiltIn().get_variable_value("\${smt_used}", smt_used)
         cpu_list = CpuUtils.cpu_list_per_node(node, cpu_node, smt_used)
         # CPU thread sibling offset.
         sib = len(cpu_list) // CpuUtils.NR_OF_THREADS
index 3b8b5f7..fe1b16b 100644 (file)
@@ -48,6 +48,7 @@
 | ${nic_txq_size}= | 0
 | ${nic_pfs}= | 2
 | ${nic_vfs}= | 0
+| ${smt_used}= | ${False}
 | ${overhead}= | ${0}
 | ${frame_size}= | ${1518}
 | ${crypto_type}= | ${None}
index 0da0c2d..e60e7b0 100644 (file)
@@ -48,6 +48,7 @@
 | ${nic_txq_size}= | 0
 | ${nic_pfs}= | 2
 | ${nic_vfs}= | 0
+| ${smt_used}= | ${False}
 | ${overhead}= | ${0}
 | ${frame_size}= | ${1518}
 | ${crypto_type}= | ${None}
index 323d1a3..3eac654 100644 (file)
@@ -48,6 +48,7 @@
 | ${nic_txq_size}= | 0
 | ${nic_pfs}= | 2
 | ${nic_vfs}= | 0
+| ${smt_used}= | ${False}
 | ${overhead}= | ${0}
 | ${frame_size}= | ${1518}
 | ${crypto_type}= | ${None}
index d566356..70e6302 100644 (file)
@@ -47,6 +47,7 @@
 | ${nic_txq_size}= | 0
 | ${nic_pfs}= | 2
 | ${nic_vfs}= | 0
+| ${smt_used}= | ${False}
 | ${overhead}= | ${0}
 | ${frame_size}= | ${1518}
 | ${crypto_type}= | ${None}