]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.4.77/macvtap-do-not-double-count-received-packets.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.4.77 / macvtap-do-not-double-count-received-packets.patch
1 From foo@baz Mon Jan 13 09:28:30 PST 2014
2 From: Vlad Yasevich <vyasevic@redhat.com>
3 Date: Tue, 26 Nov 2013 12:37:12 -0500
4 Subject: macvtap: Do not double-count received packets
5
6 From: Vlad Yasevich <vyasevic@redhat.com>
7
8 [ Upstream commit 006da7b07bc4d3a7ffabad17cf639eec6849c9dc ]
9
10 Currently macvlan will count received packets after calling each
11 vlans receive handler. Macvtap attempts to count the packet
12 yet again when the user reads the packet from the tap socket.
13 This code doesn't do this consistently either. Remove the
14 counting from macvtap and let only macvlan count received
15 packets.
16
17 Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
18 Acked-by: Michael S. Tsirkin <mst@redhat.com>
19 Acked-by: Jason Wang <jasowang@redhat.com>
20 Signed-off-by: David S. Miller <davem@davemloft.net>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 ---
23 drivers/net/macvtap.c | 7 -------
24 1 file changed, 7 deletions(-)
25
26 --- a/drivers/net/macvtap.c
27 +++ b/drivers/net/macvtap.c
28 @@ -797,7 +797,6 @@ static ssize_t macvtap_put_user(struct m
29 const struct sk_buff *skb,
30 const struct iovec *iv, int len)
31 {
32 - struct macvlan_dev *vlan;
33 int ret;
34 int vnet_hdr_len = 0;
35 int vlan_offset = 0;
36 @@ -851,12 +850,6 @@ static ssize_t macvtap_put_user(struct m
37 copied += len;
38
39 done:
40 - rcu_read_lock_bh();
41 - vlan = rcu_dereference_bh(q->vlan);
42 - if (vlan)
43 - macvlan_count_rx(vlan, copied - vnet_hdr_len, ret == 0, 0);
44 - rcu_read_unlock_bh();
45 -
46 return ret ? ret : copied;
47 }
48