diff options
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 8a852b5f215f..7d9f84a91f37 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -1646,7 +1646,7 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
1646 | dev->netdev_ops = &virtnet_netdev; | 1646 | dev->netdev_ops = &virtnet_netdev; |
1647 | dev->features = NETIF_F_HIGHDMA; | 1647 | dev->features = NETIF_F_HIGHDMA; |
1648 | 1648 | ||
1649 | SET_ETHTOOL_OPS(dev, &virtnet_ethtool_ops); | 1649 | dev->ethtool_ops = &virtnet_ethtool_ops; |
1650 | SET_NETDEV_DEV(dev, &vdev->dev); | 1650 | SET_NETDEV_DEV(dev, &vdev->dev); |
1651 | 1651 | ||
1652 | /* Do we support "hardware" checksums? */ | 1652 | /* Do we support "hardware" checksums? */ |
@@ -1724,6 +1724,13 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
1724 | if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ)) | 1724 | if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ)) |
1725 | vi->has_cvq = true; | 1725 | vi->has_cvq = true; |
1726 | 1726 | ||
1727 | if (vi->any_header_sg) { | ||
1728 | if (vi->mergeable_rx_bufs) | ||
1729 | dev->needed_headroom = sizeof(struct virtio_net_hdr_mrg_rxbuf); | ||
1730 | else | ||
1731 | dev->needed_headroom = sizeof(struct virtio_net_hdr); | ||
1732 | } | ||
1733 | |||
1727 | /* Use single tx/rx queue pair as default */ | 1734 | /* Use single tx/rx queue pair as default */ |
1728 | vi->curr_queue_pairs = 1; | 1735 | vi->curr_queue_pairs = 1; |
1729 | vi->max_queue_pairs = max_queue_pairs; | 1736 | vi->max_queue_pairs = max_queue_pairs; |