diff options
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 43f6523c40be..c68808336c8c 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 | ||