aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/contexts/standalone/ovs_dpdk.py
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/benchmark/contexts/standalone/ovs_dpdk.py')
-rw-r--r--yardstick/benchmark/contexts/standalone/ovs_dpdk.py25
1 files changed, 19 insertions, 6 deletions
diff --git a/yardstick/benchmark/contexts/standalone/ovs_dpdk.py b/yardstick/benchmark/contexts/standalone/ovs_dpdk.py
index 3ad1097b0..42a275455 100644
--- a/yardstick/benchmark/contexts/standalone/ovs_dpdk.py
+++ b/yardstick/benchmark/contexts/standalone/ovs_dpdk.py
@@ -24,6 +24,7 @@ from yardstick.benchmark import contexts
from yardstick.benchmark.contexts import base
from yardstick.benchmark.contexts.standalone import model
from yardstick.common import exceptions
+from yardstick.common import utils as common_utils
from yardstick.network_services import utils
from yardstick.network_services.utils import get_nsb_option
@@ -143,16 +144,21 @@ class OvsDpdkContext(base.Context):
if lcore_mask:
lcore_mask = ovs_other_config.format("--no-wait ", "dpdk-lcore-mask='%s'" % lcore_mask)
+ max_idle = self.ovs_properties.get("max_idle", '')
+ if max_idle:
+ max_idle = ovs_other_config.format("", "max-idle=%s" % max_idle)
+
cmd_list = [
"mkdir -p /usr/local/var/run/openvswitch",
"mkdir -p {}".format(os.path.dirname(log_path)),
- "ovsdb-server --remote=punix:/{0}/{1} --pidfile --detach".format(vpath,
- ovs_sock_path),
+ ("ovsdb-server --remote=punix:/{0}/{1} --remote=ptcp:6640"
+ " --pidfile --detach").format(vpath, ovs_sock_path),
ovs_other_config.format("--no-wait ", "dpdk-init=true"),
ovs_other_config.format("--no-wait ", "dpdk-socket-mem='%s,%s'" % (socket0, socket1)),
lcore_mask,
detach_cmd.format(vpath, ovs_sock_path, log_path),
ovs_other_config.format("", "pmd-cpu-mask=%s" % pmd_mask),
+ max_idle,
]
for cmd in cmd_list:
@@ -176,8 +182,10 @@ class OvsDpdkContext(base.Context):
'ovs-vsctl add-br {0} -- set bridge {0} datapath_type=netdev'.
format(MAIN_BRIDGE)
]
- dpdk_rxq = " options:n_rxq={queue}".format(
- queue=self.ovs_properties.get("queues", 1))
+ dpdk_rxq = ""
+ queues = self.ovs_properties.get("queues")
+ if queues:
+ dpdk_rxq = " options:n_rxq={queue}".format(queue=queues)
ordered_network = collections.OrderedDict(self.networks)
for index, vnf in enumerate(ordered_network.values()):
@@ -235,7 +243,6 @@ class OvsDpdkContext(base.Context):
def check_ovs_dpdk_env(self):
self.cleanup_ovs_dpdk_env()
- self._check_hugepages()
version = self.ovs_properties.get("version", {})
ovs_ver = version.get("ovs", self.DEFAULT_OVS)
@@ -375,6 +382,7 @@ class OvsDpdkContext(base.Context):
def _enable_interfaces(self, index, vfs, xml_str):
vpath = self.ovs_properties.get("vpath", "/usr/local")
+ queue = self.ovs_properties.get("queues", 1)
vf = self.networks[vfs[0]]
port_num = vf.get('port_num', 0)
vpci = utils.PciAddress(vf['vpci'].strip())
@@ -383,13 +391,18 @@ class OvsDpdkContext(base.Context):
vf['vpci'] = \
"{}:{}:{:02x}.{}".format(vpci.domain, vpci.bus, slot, vpci.function)
return model.Libvirt.add_ovs_interface(
- vpath, port_num, vf['vpci'], vf['mac'], xml_str)
+ vpath, port_num, vf['vpci'], vf['mac'], xml_str, queue)
def setup_ovs_dpdk_context(self):
nodes = []
self.configure_nics_for_ovs_dpdk()
+ hp_total_mb = int(self.vm_flavor.get('ram', '4096')) * len(self.servers)
+ common_utils.setup_hugepages(self.connection, hp_total_mb * 1024)
+
+ self._check_hugepages()
+
for index, (key, vnf) in enumerate(collections.OrderedDict(
self.servers).items()):
cfg = '/tmp/vm_ovs_%d.xml' % index