Commit d04302b3 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin

virtio_net: bigger header when VERSION_1 is set

With VERSION_1 virtio_net uses same header size
whether mergeable buffers are enabled or not.
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: default avatarJason Wang <jasowang@redhat.com>


parent bcff3162
...@@ -1805,7 +1805,8 @@ static int virtnet_probe(struct virtio_device *vdev) ...@@ -1805,7 +1805,8 @@ static int virtnet_probe(struct virtio_device *vdev)
if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF)) if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF))
vi->mergeable_rx_bufs = true; 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); vi->hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf);
else else
vi->hdr_len = sizeof(struct virtio_net_hdr); vi->hdr_len = sizeof(struct virtio_net_hdr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment