Skip to content

Commit cd3e22b

Browse files
Jason Wangdavem330
authored andcommitted
macvtap: fix tx_dropped counting error
After commit 8ffab51 (macvlan: lockless tx path), tx stat counter were converted to percpu stat structure. So we need use to this also for tx_dropped in macvtap. Otherwise, the management won't notice the dropping packet in macvtap tx path. Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Vlad Yasevich <vyasevic@redhat.com> Cc: Eric Dumazet <edumazet@google.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Vlad Yasevich <vyasevic@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 167f76a commit cd3e22b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/net/macvtap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
744744
rcu_read_lock();
745745
vlan = rcu_dereference(q->vlan);
746746
if (vlan)
747-
vlan->dev->stats.tx_dropped++;
747+
this_cpu_inc(vlan->pcpu_stats->tx_dropped);
748748
rcu_read_unlock();
749749

750750
return err;

0 commit comments

Comments
 (0)