On Tue, Feb 19, 2019 at 03:32:19PM +0800, Jason Wang wrote: > > On 2019/2/14 下午12:26, w...@redhat.com wrote: > >From: Wei Xu <w...@redhat.com> > > > >Add userspace and vhost kernel/user support. > > > >Add CLI "ring_packed=true/false" to enable/disable packed ring provision. > >Usage: > > -device virtio-net-pci,netdev=xx,mac=xx:xx:xx:xx:xx:xx,ring_packed=false > > > >By default it is provided. > > > Please compat this for old machine types.
It is provided by default, how to make it compatible for old machine types? Hide or provide it? Wei > > Thanks > > > > > >Signed-off-by: Wei Xu <w...@redhat.com> > >--- > > hw/net/vhost_net.c | 2 ++ > > include/hw/virtio/virtio.h | 4 +++- > > 2 files changed, 5 insertions(+), 1 deletion(-) > > > >diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c > >index e037db6..f593086 100644 > >--- a/hw/net/vhost_net.c > >+++ b/hw/net/vhost_net.c > >@@ -53,6 +53,7 @@ static const int kernel_feature_bits[] = { > > VIRTIO_F_VERSION_1, > > VIRTIO_NET_F_MTU, > > VIRTIO_F_IOMMU_PLATFORM, > >+ VIRTIO_F_RING_PACKED, > > VHOST_INVALID_FEATURE_BIT > > }; > >@@ -78,6 +79,7 @@ static const int user_feature_bits[] = { > > VIRTIO_NET_F_MRG_RXBUF, > > VIRTIO_NET_F_MTU, > > VIRTIO_F_IOMMU_PLATFORM, > >+ VIRTIO_F_RING_PACKED, > > /* This bit implies RARP isn't sent by QEMU out of band */ > > VIRTIO_NET_F_GUEST_ANNOUNCE, > >diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h > >index 9c1fa07..2eb27d2 100644 > >--- a/include/hw/virtio/virtio.h > >+++ b/include/hw/virtio/virtio.h > >@@ -264,7 +264,9 @@ typedef struct VirtIORNGConf VirtIORNGConf; > > DEFINE_PROP_BIT64("any_layout", _state, _field, \ > > VIRTIO_F_ANY_LAYOUT, true), \ > > DEFINE_PROP_BIT64("iommu_platform", _state, _field, \ > >- VIRTIO_F_IOMMU_PLATFORM, false) > >+ VIRTIO_F_IOMMU_PLATFORM, false), \ > >+ DEFINE_PROP_BIT64("ring_packed", _state, _field, \ > >+ VIRTIO_F_RING_PACKED, true) > > hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n); > > hwaddr virtio_queue_get_avail_addr(VirtIODevice *vdev, int n); >