Skip to content

Commit

Permalink
virtio: enable packed virtqueues
Browse files Browse the repository at this point in the history
We need to add the VIRTIO_F_PACKED_RING feature bit to the user_feature_bits
(for vhost-user) and add the feature to the virtio device feature bits in
virtio_pci_pre_plugged.

Signed-off-by: Jens Freimann <jfreimann@redhat.com>
  • Loading branch information
jensfr committed Feb 6, 2018
1 parent 2b3805f commit 71b4013
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions hw/net/vhost_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ static const int user_feature_bits[] = {

VIRTIO_F_ANY_LAYOUT,
VIRTIO_F_VERSION_1,
VIRTIO_F_PACKED_RING,
VIRTIO_NET_F_CSUM,
VIRTIO_NET_F_GUEST_CSUM,
VIRTIO_NET_F_GSO,
Expand Down
1 change: 1 addition & 0 deletions hw/virtio/virtio-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,7 @@ static void virtio_pci_pre_plugged(DeviceState *d, Error **errp)

if (virtio_pci_modern(proxy)) {
virtio_add_feature(&vdev->host_features, VIRTIO_F_VERSION_1);
virtio_add_feature(&vdev->host_features, VIRTIO_F_PACKED_RING);
}

virtio_add_feature(&vdev->host_features, VIRTIO_F_BAD_FEATURE);
Expand Down
1 change: 1 addition & 0 deletions include/standard-headers/linux/virtio_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@
* this is for compatibility with legacy systems.
*/
#define VIRTIO_F_IOMMU_PLATFORM 33
#define VIRTIO_F_PACKED_RING 34
#endif /* _LINUX_VIRTIO_CONFIG_H */

0 comments on commit 71b4013

Please sign in to comment.