aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vhost/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r--drivers/vhost/net.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index f0da2c32fbde..5c170100de9c 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -24,6 +24,7 @@
24#include <linux/if_arp.h> 24#include <linux/if_arp.h>
25#include <linux/if_tun.h> 25#include <linux/if_tun.h>
26#include <linux/if_macvlan.h> 26#include <linux/if_macvlan.h>
27#include <linux/if_vlan.h>
27 28
28#include <net/sock.h> 29#include <net/sock.h>
29 30
@@ -238,7 +239,7 @@ static void handle_tx(struct vhost_net *net)
238 239
239 vq->heads[vq->upend_idx].len = len; 240 vq->heads[vq->upend_idx].len = len;
240 ubuf->callback = vhost_zerocopy_callback; 241 ubuf->callback = vhost_zerocopy_callback;
241 ubuf->arg = vq->ubufs; 242 ubuf->ctx = vq->ubufs;
242 ubuf->desc = vq->upend_idx; 243 ubuf->desc = vq->upend_idx;
243 msg.msg_control = ubuf; 244 msg.msg_control = ubuf;
244 msg.msg_controllen = sizeof(ubuf); 245 msg.msg_controllen = sizeof(ubuf);
@@ -283,8 +284,12 @@ static int peek_head_len(struct sock *sk)
283 284
284 spin_lock_irqsave(&sk->sk_receive_queue.lock, flags); 285 spin_lock_irqsave(&sk->sk_receive_queue.lock, flags);
285 head = skb_peek(&sk->sk_receive_queue); 286 head = skb_peek(&sk->sk_receive_queue);
286 if (likely(head)) 287 if (likely(head)) {
287 len = head->len; 288 len = head->len;
289 if (vlan_tx_tag_present(head))
290 len += VLAN_HLEN;
291 }
292
288 spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags); 293 spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags);
289 return len; 294 return len;
290} 295}