virtio_net: bigger header when VERSION_1 is set
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 23 Oct 2014 21:24:03 +0000 (00:24 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 9 Dec 2014 10:05:28 +0000 (12:05 +0200)
With VERSION_1 virtio_net uses same header size
whether mergeable buffers are enabled or not.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Jason Wang <jasowang@redhat.com>
drivers/net/virtio_net.c

index 098f4432afa1b101cd050d45b5bbc5c2a0e81e83..a0e64cfdbc244dbc63dba309a37fdeedf0bebd83 100644 (file)
@@ -1805,7 +1805,8 @@ static int virtnet_probe(struct virtio_device *vdev)
        if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF))
                vi->mergeable_rx_bufs = true;
 
-       if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF))
+       if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF) ||
+           virtio_has_feature(vdev, VIRTIO_F_VERSION_1))
                vi->hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf);
        else
                vi->hdr_len = sizeof(struct virtio_net_hdr);