diff options
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 43f6523c40be..e67d16c2e5f3 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/virtio.h> | 24 | #include <linux/virtio.h> |
25 | #include <linux/virtio_net.h> | 25 | #include <linux/virtio_net.h> |
26 | #include <linux/scatterlist.h> | 26 | #include <linux/scatterlist.h> |
27 | #include <linux/if_vlan.h> | ||
27 | 28 | ||
28 | static int napi_weight = 128; | 29 | static int napi_weight = 128; |
29 | module_param(napi_weight, int, 0444); | 30 | module_param(napi_weight, int, 0444); |
@@ -33,7 +34,7 @@ module_param(csum, bool, 0444); | |||
33 | module_param(gso, bool, 0444); | 34 | module_param(gso, bool, 0444); |
34 | 35 | ||
35 | /* FIXME: MTU in config. */ | 36 | /* FIXME: MTU in config. */ |
36 | #define MAX_PACKET_LEN (ETH_HLEN+ETH_DATA_LEN) | 37 | #define MAX_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) |
37 | #define GOOD_COPY_LEN 128 | 38 | #define GOOD_COPY_LEN 128 |
38 | 39 | ||
39 | struct virtnet_info | 40 | struct virtnet_info |
@@ -286,7 +287,7 @@ static void try_fill_recv_maxbufs(struct virtnet_info *vi) | |||
286 | skb_put(skb, MAX_PACKET_LEN); | 287 | skb_put(skb, MAX_PACKET_LEN); |
287 | 288 | ||
288 | hdr = skb_vnet_hdr(skb); | 289 | hdr = skb_vnet_hdr(skb); |
289 | sg_init_one(sg, hdr, sizeof(*hdr)); | 290 | sg_set_buf(sg, hdr, sizeof(*hdr)); |
290 | 291 | ||
291 | if (vi->big_packets) { | 292 | if (vi->big_packets) { |
292 | for (i = 0; i < MAX_SKB_FRAGS; i++) { | 293 | for (i = 0; i < MAX_SKB_FRAGS; i++) { |
@@ -487,9 +488,9 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb) | |||
487 | 488 | ||
488 | /* Encode metadata header at front. */ | 489 | /* Encode metadata header at front. */ |
489 | if (vi->mergeable_rx_bufs) | 490 | if (vi->mergeable_rx_bufs) |
490 | sg_init_one(sg, mhdr, sizeof(*mhdr)); | 491 | sg_set_buf(sg, mhdr, sizeof(*mhdr)); |
491 | else | 492 | else |
492 | sg_init_one(sg, hdr, sizeof(*hdr)); | 493 | sg_set_buf(sg, hdr, sizeof(*hdr)); |
493 | 494 | ||
494 | num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1; | 495 | num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1; |
495 | 496 | ||
@@ -611,6 +612,7 @@ static struct ethtool_ops virtnet_ethtool_ops = { | |||
611 | .set_tx_csum = virtnet_set_tx_csum, | 612 | .set_tx_csum = virtnet_set_tx_csum, |
612 | .set_sg = ethtool_op_set_sg, | 613 | .set_sg = ethtool_op_set_sg, |
613 | .set_tso = ethtool_op_set_tso, | 614 | .set_tso = ethtool_op_set_tso, |
615 | .get_link = ethtool_op_get_link, | ||
614 | }; | 616 | }; |
615 | 617 | ||
616 | #define MIN_MTU 68 | 618 | #define MIN_MTU 68 |
@@ -738,6 +740,8 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
738 | goto unregister; | 740 | goto unregister; |
739 | } | 741 | } |
740 | 742 | ||
743 | netif_carrier_on(dev); | ||
744 | |||
741 | pr_debug("virtnet: registered device %s\n", dev->name); | 745 | pr_debug("virtnet: registered device %s\n", dev->name); |
742 | return 0; | 746 | return 0; |
743 | 747 | ||