aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/QemuManager.py
diff options
context:
space:
mode:
authorpmikus <pmikus@cisco.com>2020-10-02 05:48:34 +0000
committerPeter Mikus <pmikus@cisco.com>2021-01-04 10:30:50 +0000
commit44dcb3113c8ade2e44543746abca861a89362c9b (patch)
tree4800a2f9dcf106c5f5222f4be256c9a488f1b85b /resources/libraries/python/QemuManager.py
parente813695b481b745d5136f8cbd0152e62a4ec990c (diff)
GSO: TAP/VHOST use case
Signed-off-by: pmikus <pmikus@cisco.com> Change-Id: Ibafaaca4438587284d1e255c764f0701002941e8
Diffstat (limited to 'resources/libraries/python/QemuManager.py')
-rw-r--r--resources/libraries/python/QemuManager.py42
1 files changed, 39 insertions, 3 deletions
diff --git a/resources/libraries/python/QemuManager.py b/resources/libraries/python/QemuManager.py
index 6436f69aec..766372ad9c 100644
--- a/resources/libraries/python/QemuManager.py
+++ b/resources/libraries/python/QemuManager.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2020 Cisco and/or its affiliates.
+# Copyright (c) 2021 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:
@@ -51,8 +51,9 @@ class QemuManager:
nf_nodes = int(kwargs[u"nf_nodes"])
queues = kwargs[u"rxq_count_int"] if kwargs[u"auto_scale"] else 1
vs_dtc = kwargs[u"vs_dtc"]
- nf_dtc = kwargs[u"vs_dtc"] if kwargs[u"auto_scale"] \
- else kwargs[u"nf_dtc"]
+ nf_dtc = kwargs[u"nf_dtc"]
+ if kwargs[u"auto_scale"] and not kwargs[u"fixed_auto_scale"]:
+ nf_dtc = kwargs[u"vs_dtc"]
nf_dtcr = kwargs[u"nf_dtcr"] \
if isinstance(kwargs[u"nf_dtcr"], int) else 2
@@ -419,3 +420,38 @@ class QemuManager:
pci=Topology.get_interface_pci_addr(
self.nodes[kwargs[u"node"]], kwargs[u"if1"])
)
+
+ def _c_iperf3(self, **kwargs):
+ """Instantiate one VM with iperf3 configuration.
+
+ :param kwargs: Named parameters.
+ :type kwargs: dict
+ """
+ qemu_id = kwargs[u"qemu_id"]
+ name = kwargs[u"name"]
+ virtio_feature_mask = kwargs[u"virtio_feature_mask"] \
+ if u"virtio_feature_mask" in kwargs else None
+
+ self.machines[name] = QemuUtils(
+ node=self.nodes[kwargs[u"node"]],
+ qemu_id=qemu_id,
+ smp=len(self.machines_affinity[name]),
+ mem=4096,
+ vnf=kwargs[u"vnf"],
+ img=Constants.QEMU_VM_KERNEL
+ )
+ self.machines[name].add_default_params()
+ self.machines[name].add_kernelvm_params()
+ self.machines[name].configure_kernelvm_vnf(
+ queues=kwargs[u"queues"],
+ jumbo_frames=kwargs[u"jumbo"]
+ )
+ self.machines[name].add_net_user()
+ self.machines[name].add_vhost_user_if(
+ f"/run/vpp/sock-{qemu_id}-1",
+ server=False,
+ jumbo_frames=kwargs[u"jumbo"],
+ queues=kwargs[u"queues"],
+ queue_size=kwargs[u"perf_qemu_qsz"],
+ virtio_feature_mask=virtio_feature_mask
+ )