macvtap: fix tx_dropped counting error
Subsystems (2)
PATCH 1/1 macvtap: fix tx_dropped counting error
After commit 8ffab51b3dfc54876f145f15b351c41f3f703195
(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.
--- drivers/net/macvtap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/macvtap.c +1 -1
@@ -744,7 +744,7 @@ err:rcu_read_lock (); vlan =rcu_dereference (q->vlan);if (vlan) - vlan->dev->stats.tx_dropped++; +this_cpu_inc (vlan->pcpu_stats->tx_dropped);rcu_read_unlock ();return err;
Signature · 1 line
1.8.3.2
Quoted 9 lines · Jason Wang
After commit
8ffab51b3dfc54876f145f15b351c41f3f703195
(macvlan: lockless tx path), tx stat counter were converted to percpu stat structure. So we need use to this also fortx_droppedin macvtap. Otherwise, the management won't notice the dropping packet in macvtap tx path.Cc Michael S. Tsirkin <[email protected]>Cc Vlad Yasevich <[email protected]>Cc Eric Dumazet <[email protected]>Signed-off-by Jason Wang <[email protected]>
Quoted 19 lines
--- drivers/net/macvtap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/macvtap.c +1
-1@@ -744,7 +744,7 @@ err:rcu_read_lock (); vlan =rcu_dereference (q->vlan);if (vlan) - vlan->dev->stats.tx_dropped++; +this_cpu_inc (vlan->pcpu_stats->tx_dropped);rcu_read_unlock ();return err;Signature · 1 line
1.8.3.2
Quoted 7 lines · Jason Wang
After commit
8ffab51b3dfc54876f145f15b351c41f3f703195
(macvlan: lockless tx path), tx stat counter were converted to percpu stat structure. So we need use to this also fortx_droppedin macvtap. Otherwise, the management won't notice the dropping packet in macvtap tx path.Cc Michael S. Tsirkin <[email protected]>Cc Vlad Yasevich <[email protected]>
-vlad
Quoted 20 lines
Cc Eric Dumazet <[email protected]>Signed-off-by Jason Wang <[email protected]>--- drivers/net/macvtap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/macvtap.c +1
-1@@ -744,7 +744,7 @@ err:rcu_read_lock (); vlan =rcu_dereference (q->vlan);if (vlan) - vlan->dev->stats.tx_dropped++; +this_cpu_inc (vlan->pcpu_stats->tx_dropped);rcu_read_unlock ();return err;
From: Jason Wang <[email protected]>
Date: Mon, 25 Nov 2013 17:19:04 +0800
Quoted 9 lines
After commit
8ffab51b3dfc54876f145f15b351c41f3f703195
(macvlan: lockless tx path), tx stat counter were converted to percpu stat structure. So we need use to this also fortx_droppedin macvtap. Otherwise, the management won't notice the dropping packet in macvtap tx path.Cc Michael S. Tsirkin <[email protected]>Cc Vlad Yasevich <[email protected]>Cc Eric Dumazet <[email protected]>Signed-off-by Jason Wang <[email protected]>
Applied, thanks Jason.