提交 4f588a1b 编写于 作者: M Michal Privoznik

qemuBuildNicDevStr: Set vectors= on Multiqueue

Yet another advice appeared on the Multiqueue wiki page:

http://www.linux-kvm.org/page/Multiqueue#Enable_MQ_feature

We should add vectors=N onto the qemu command line, where
N = 2 * (number of queues) + 1.
上级 097c9b52
......@@ -4980,7 +4980,7 @@ qemuBuildNicDevStr(virDomainDefPtr def,
virDomainNetDefPtr net,
int vlan,
int bootindex,
bool multiqueue,
int vhostfdSize,
virQEMUCapsPtr qemuCaps)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
......@@ -5035,8 +5035,11 @@ qemuBuildNicDevStr(virDomainDefPtr def,
virDomainVirtioEventIdxTypeToString(net->driver.virtio.event_idx));
}
}
if (usingVirtio && multiqueue)
virBufferAddLit(&buf, ",mq=on");
if (usingVirtio && vhostfdSize > 1) {
/* As advised at http://www.linux-kvm.org/page/Multiqueue
* we should add vectors=2*N+1 where N is the vhostfdSize */
virBufferAsprintf(&buf, ",mq=on,vectors=%d", 2 * vhostfdSize + 1);
}
if (vlan == -1)
virBufferAsprintf(&buf, ",netdev=host%s", net->info.alias);
else
......@@ -7591,10 +7594,8 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
virCommandAddArgList(cmd, "-netdev", host, NULL);
}
if (qemuDomainSupportsNicdev(def, qemuCaps, net)) {
bool multiqueue = tapfdSize > 1 || vhostfdSize > 1;
if (!(nic = qemuBuildNicDevStr(def, net, vlan, bootindex,
multiqueue, qemuCaps)))
vhostfdSize, qemuCaps)))
goto cleanup;
virCommandAddArgList(cmd, "-device", nic, NULL);
} else {
......
......@@ -105,7 +105,7 @@ char * qemuBuildNicDevStr(virDomainDefPtr def,
virDomainNetDefPtr net,
int vlan,
int bootindex,
bool multiqueue,
int vhostfdSize,
virQEMUCapsPtr qemuCaps);
char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk,
......
......@@ -998,10 +998,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
}
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
bool multiqueue = tapfdSize > 1 || vhostfdSize > 1;
if (!(nicstr = qemuBuildNicDevStr(vm->def, net, vlan, 0,
multiqueue, priv->qemuCaps)))
vhostfdSize, priv->qemuCaps)))
goto try_remove;
} else {
if (!(nicstr = qemuBuildNicStr(net, NULL, vlan)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册