aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/if_tunnel.h9
-rw-r--r--include/linux/netdevice.h11
-rw-r--r--include/net/ip6_tunnel.h2
-rw-r--r--include/net/ip_tunnels.h4
4 files changed, 13 insertions, 13 deletions
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index f4e56ecd0b1a..712710bc0580 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -13,13 +13,4 @@
13#define for_each_ip_tunnel_rcu(pos, start) \ 13#define for_each_ip_tunnel_rcu(pos, start) \
14 for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next)) 14 for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next))
15 15
16/* often modified stats are per cpu, other are shared (netdev->stats) */
17struct pcpu_tstats {
18 u64 rx_packets;
19 u64 rx_bytes;
20 u64 tx_packets;
21 u64 tx_bytes;
22 struct u64_stats_sync syncp;
23};
24
25#endif /* _IF_TUNNEL_H_ */ 16#endif /* _IF_TUNNEL_H_ */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index bec60c481966..51c0fe258163 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1409,7 +1409,7 @@ struct net_device {
1409 union { 1409 union {
1410 void *ml_priv; 1410 void *ml_priv;
1411 struct pcpu_lstats __percpu *lstats; /* loopback stats */ 1411 struct pcpu_lstats __percpu *lstats; /* loopback stats */
1412 struct pcpu_tstats __percpu *tstats; /* tunnel stats */ 1412 struct pcpu_sw_netstats __percpu *tstats;
1413 struct pcpu_dstats __percpu *dstats; /* dummy stats */ 1413 struct pcpu_dstats __percpu *dstats; /* dummy stats */
1414 struct pcpu_vstats __percpu *vstats; /* veth stats */ 1414 struct pcpu_vstats __percpu *vstats; /* veth stats */
1415 }; 1415 };
@@ -1685,6 +1685,15 @@ struct packet_offload {
1685 struct list_head list; 1685 struct list_head list;
1686}; 1686};
1687 1687
1688/* often modified stats are per cpu, other are shared (netdev->stats) */
1689struct pcpu_sw_netstats {
1690 u64 rx_packets;
1691 u64 rx_bytes;
1692 u64 tx_packets;
1693 u64 tx_bytes;
1694 struct u64_stats_sync syncp;
1695};
1696
1688#include <linux/notifier.h> 1697#include <linux/notifier.h>
1689 1698
1690/* netdevice notifier chain. Please remember to update the rtnetlink 1699/* netdevice notifier chain. Please remember to update the rtnetlink
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index 6d1549c4893c..a5593dab6af7 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -79,7 +79,7 @@ static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
79 err = ip6_local_out(skb); 79 err = ip6_local_out(skb);
80 80
81 if (net_xmit_eval(err) == 0) { 81 if (net_xmit_eval(err) == 0) {
82 struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats); 82 struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
83 u64_stats_update_begin(&tstats->syncp); 83 u64_stats_update_begin(&tstats->syncp);
84 tstats->tx_bytes += pkt_len; 84 tstats->tx_bytes += pkt_len;
85 tstats->tx_packets++; 85 tstats->tx_packets++;
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index 9e25b1bc31da..cd729becbb07 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -162,10 +162,10 @@ struct sk_buff *iptunnel_handle_offloads(struct sk_buff *skb, bool gre_csum,
162 162
163static inline void iptunnel_xmit_stats(int err, 163static inline void iptunnel_xmit_stats(int err,
164 struct net_device_stats *err_stats, 164 struct net_device_stats *err_stats,
165 struct pcpu_tstats __percpu *stats) 165 struct pcpu_sw_netstats __percpu *stats)
166{ 166{
167 if (err > 0) { 167 if (err > 0) {
168 struct pcpu_tstats *tstats = this_cpu_ptr(stats); 168 struct pcpu_sw_netstats *tstats = this_cpu_ptr(stats);
169 169
170 u64_stats_update_begin(&tstats->syncp); 170 u64_stats_update_begin(&tstats->syncp);
171 tstats->tx_bytes += err; 171 tstats->tx_bytes += err;