aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorVlad Yasevich <vyasevic@redhat.com>2013-11-26 12:37:12 -0500
committerDavid S. Miller <davem@davemloft.net>2013-11-29 16:07:08 -0500
commit006da7b07bc4d3a7ffabad17cf639eec6849c9dc (patch)
tree05d54631c14c7b6d3c02acc0e6296145949c88cb /drivers/net
parentdff345c5c85df3c5853491b007f6b1b578dc28a4 (diff)
macvtap: Do not double-count received packets
Currently macvlan will count received packets after calling each vlans receive handler. Macvtap attempts to count the packet yet again when the user reads the packet from the tap socket. This code doesn't do this consistently either. Remove the counting from macvtap and let only macvlan count received packets. Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/macvtap.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 0605da8e25f5..9093004f9b63 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -767,7 +767,6 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
767 const struct sk_buff *skb, 767 const struct sk_buff *skb,
768 const struct iovec *iv, int len) 768 const struct iovec *iv, int len)
769{ 769{
770 struct macvlan_dev *vlan;
771 int ret; 770 int ret;
772 int vnet_hdr_len = 0; 771 int vnet_hdr_len = 0;
773 int vlan_offset = 0; 772 int vlan_offset = 0;
@@ -821,15 +820,6 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
821 copied += len; 820 copied += len;
822 821
823done: 822done:
824 rcu_read_lock();
825 vlan = rcu_dereference(q->vlan);
826 if (vlan) {
827 preempt_disable();
828 macvlan_count_rx(vlan, copied - vnet_hdr_len, ret == 0, 0);
829 preempt_enable();
830 }
831 rcu_read_unlock();
832
833 return ret ? ret : copied; 823 return ret ? ret : copied;
834} 824}
835 825