def get_affinity_vm(nodes, node, nf_chains=1, nf_nodes=1, nf_chain=1, nf_node=1,
- cpu_count_int=1):
+ cpu_count_int=1, vnf_count_int=1):
"""Get affinity of VM. Result will be used to compute the amount of
CPUs and also affinity.
:param nf_chain: Chain ID.
:param nf_node: Node ID.
:param cpu_count_int: Amount of Dataplane threads of vswitch.
+ :param vnf_count_int: Amount of Dataplane threads of vnf.
:type nodes: dict
:type node: dict
:type nf_chains: int
:type nf_chain: int
:type nf_node: int
:type cpu_count_int: int
+ :type vnf_count_int: int
:returns: List of CPUs allocated to VM.
:rtype: list
"""
dut_mc = 1
dut_dc = cpu_count_int
skip_cnt = sut_sc + dut_mc + dut_dc
- dtc = cpu_count_int
+ dtc = vnf_count_int
interface_list = []
interface_list.append(
nf_chains = int(kwargs['nf_chains'])
nf_nodes = int(kwargs['nf_nodes'])
queues = kwargs['rxq_count_int'] if kwargs['auto_scale'] else 1
- cpu_count_int = kwargs['cpu_count_int'] if kwargs['auto_scale'] else 1
+ cpu_count_int = kwargs['cpu_count_int']
+ vnf_count_int = kwargs['cpu_count_int'] if kwargs['auto_scale'] else 1
img = Constants.QEMU_PERF_VM_KERNEL
self.machines_affinity[name] = get_affinity_vm(
nodes=self.nodes, node=node, nf_chains=nf_chains,
nf_nodes=nf_nodes, nf_chain=nf_chain, nf_node=nf_node,
- cpu_count_int=cpu_count_int)
+ cpu_count_int=cpu_count_int, vnf_count_int=vnf_count_int)
self.machines[name] = QemuUtils(
node=self.nodes[node], qemu_id=qemu_id,
mac1='52:54:00:00:{id:02x}:01'.format(id=qemu_id),
mac2='52:54:00:00:{id:02x}:02'.format(id=qemu_id),
vif1_mac=vif1_mac,
- vif2_mac=vif2_mac)
+ vif2_mac=vif2_mac,
+ queues=queues,
+ jumbo_frames=kwargs['jumbo'])
self.machines[name].qemu_add_vhost_user_if(
sock1, jumbo_frames=kwargs['jumbo'], queues=queues,
queue_size=1024)