提交 006da7b0 编写于 作者: V Vlad Yasevich 提交者: David S. Miller

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: NVlad Yasevich <vyasevic@redhat.com>
Acked-by: NMichael S. Tsirkin <mst@redhat.com>
Acked-by: NJason Wang <jasowang@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 dff345c5
......@@ -767,7 +767,6 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
const struct sk_buff *skb,
const struct iovec *iv, int len)
{
struct macvlan_dev *vlan;
int ret;
int vnet_hdr_len = 0;
int vlan_offset = 0;
......@@ -821,15 +820,6 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
copied += len;
done:
rcu_read_lock();
vlan = rcu_dereference(q->vlan);
if (vlan) {
preempt_disable();
macvlan_count_rx(vlan, copied - vnet_hdr_len, ret == 0, 0);
preempt_enable();
}
rcu_read_unlock();
return ret ? ret : copied;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册