mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
conf: Add page_per_vq for driver element
Signed-off-by: Han Han <hhan@redhat.com> Signed-off-by: Gavi Teitz <gavi@nvidia.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
61cb54e3cb
commit
388cdd11f3
@ -3577,6 +3577,15 @@ virtqueues are actually used depends on the feature negotiation between QEMU,
|
|||||||
vhost backends and guest drivers. Possible values are ``on`` or ``off``.
|
vhost backends and guest drivers. Possible values are ``on`` or ``off``.
|
||||||
:since:`Since 6.3.0 (QEMU and KVM only)`
|
:since:`Since 6.3.0 (QEMU and KVM only)`
|
||||||
|
|
||||||
|
This optional attribute ``page_per_vq`` controls the layout of the notification
|
||||||
|
capabilities exposed to the guest. When enabled, each virtio queue will have a
|
||||||
|
dedicated page on the device BAR exposed to the guest. It is recommended to be
|
||||||
|
used when vDPA is enabled on the hypervisor, as it enables mapping the
|
||||||
|
notification area to the physical device, which is only supported in page
|
||||||
|
granularity. The default is determined by QEMU. :since:`Since 7.8.0 (QEMU 2.8)`
|
||||||
|
Note: In general you should leave this option alone, unless you are very certain
|
||||||
|
you know what you are doing.
|
||||||
|
|
||||||
:anchor:`<a id="elementsVirtioTransitional"/>`
|
:anchor:`<a id="elementsVirtioTransitional"/>`
|
||||||
|
|
||||||
Virtio transitional devices
|
Virtio transitional devices
|
||||||
|
@ -6825,6 +6825,11 @@
|
|||||||
<ref name="virOnOff"/>
|
<ref name="virOnOff"/>
|
||||||
</attribute>
|
</attribute>
|
||||||
</optional>
|
</optional>
|
||||||
|
<optional>
|
||||||
|
<attribute name="page_per_vq">
|
||||||
|
<ref name="virOnOff"/>
|
||||||
|
</attribute>
|
||||||
|
</optional>
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
<define name="usbmaster">
|
<define name="usbmaster">
|
||||||
|
@ -1636,6 +1636,10 @@ virDomainVirtioOptionsParseXML(xmlNodePtr driver,
|
|||||||
&(*virtio)->packed) < 0)
|
&(*virtio)->packed) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (virXMLPropTristateSwitch(driver, "page_per_vq", VIR_XML_PROP_NONE,
|
||||||
|
&(*virtio)->page_per_vq) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6321,6 +6325,10 @@ virDomainVirtioOptionsFormat(virBuffer *buf,
|
|||||||
virBufferAsprintf(buf, " packed='%s'",
|
virBufferAsprintf(buf, " packed='%s'",
|
||||||
virTristateSwitchTypeToString(virtio->packed));
|
virTristateSwitchTypeToString(virtio->packed));
|
||||||
}
|
}
|
||||||
|
if (virtio->page_per_vq != VIR_TRISTATE_SWITCH_ABSENT) {
|
||||||
|
virBufferAsprintf(buf, " page_per_vq='%s'",
|
||||||
|
virTristateSwitchTypeToString(virtio->page_per_vq));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -20816,6 +20824,14 @@ virDomainVirtioOptionsCheckABIStability(virDomainVirtioOptions *src,
|
|||||||
virTristateSwitchTypeToString(src->packed));
|
virTristateSwitchTypeToString(src->packed));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (src->page_per_vq != dst->page_per_vq) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("Target device page_per_vq option '%s' does not "
|
||||||
|
"match source '%s'"),
|
||||||
|
virTristateSwitchTypeToString(dst->page_per_vq),
|
||||||
|
virTristateSwitchTypeToString(src->page_per_vq));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2740,6 +2740,7 @@ struct _virDomainVirtioOptions {
|
|||||||
virTristateSwitch iommu;
|
virTristateSwitch iommu;
|
||||||
virTristateSwitch ats;
|
virTristateSwitch ats;
|
||||||
virTristateSwitch packed;
|
virTristateSwitch packed;
|
||||||
|
virTristateSwitch page_per_vq;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -135,6 +135,12 @@ virDomainCheckVirtioOptionsAreAbsent(virDomainVirtioOptions *virtio)
|
|||||||
"for virtio devices"));
|
"for virtio devices"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (virtio->page_per_vq != VIR_TRISTATE_SWITCH_ABSENT) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("page_per_vq option is only supported for virtio devices"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user