diff options
author | Li RongQing <roy.qing.li@gmail.com> | 2014-01-04 00:57:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-04 20:10:24 -0500 |
commit | 8f84985fec10de64a6b4cdfea45f2b0ab8f07c78 (patch) | |
tree | 03d58e9d72384e8066a6232c793b3ee4242668f6 /drivers/net/vxlan.c | |
parent | 653864d9dd6ae26d884abfd53420e61e7383b1da (diff) |
net: unify the pcpu_tstats and br_cpu_netstats as one
They are same, so unify them as one, pcpu_sw_netstats.
Define pcpu_sw_netstat in netdevice.h, remove pcpu_tstats
from if_tunnel and remove br_cpu_netstats from br_private.h
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r-- | drivers/net/vxlan.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index aef44aa44fe3..474a99ed0222 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -1081,7 +1081,7 @@ static void vxlan_rcv(struct vxlan_sock *vs, | |||
1081 | struct iphdr *oip = NULL; | 1081 | struct iphdr *oip = NULL; |
1082 | struct ipv6hdr *oip6 = NULL; | 1082 | struct ipv6hdr *oip6 = NULL; |
1083 | struct vxlan_dev *vxlan; | 1083 | struct vxlan_dev *vxlan; |
1084 | struct pcpu_tstats *stats; | 1084 | struct pcpu_sw_netstats *stats; |
1085 | union vxlan_addr saddr; | 1085 | union vxlan_addr saddr; |
1086 | __u32 vni; | 1086 | __u32 vni; |
1087 | int err = 0; | 1087 | int err = 0; |
@@ -1587,11 +1587,12 @@ EXPORT_SYMBOL_GPL(vxlan_xmit_skb); | |||
1587 | static void vxlan_encap_bypass(struct sk_buff *skb, struct vxlan_dev *src_vxlan, | 1587 | static void vxlan_encap_bypass(struct sk_buff *skb, struct vxlan_dev *src_vxlan, |
1588 | struct vxlan_dev *dst_vxlan) | 1588 | struct vxlan_dev *dst_vxlan) |
1589 | { | 1589 | { |
1590 | struct pcpu_tstats *tx_stats = this_cpu_ptr(src_vxlan->dev->tstats); | 1590 | struct pcpu_sw_netstats *tx_stats, *rx_stats; |
1591 | struct pcpu_tstats *rx_stats = this_cpu_ptr(dst_vxlan->dev->tstats); | ||
1592 | union vxlan_addr loopback; | 1591 | union vxlan_addr loopback; |
1593 | union vxlan_addr *remote_ip = &dst_vxlan->default_dst.remote_ip; | 1592 | union vxlan_addr *remote_ip = &dst_vxlan->default_dst.remote_ip; |
1594 | 1593 | ||
1594 | tx_stats = this_cpu_ptr(src_vxlan->dev->tstats); | ||
1595 | rx_stats = this_cpu_ptr(dst_vxlan->dev->tstats); | ||
1595 | skb->pkt_type = PACKET_HOST; | 1596 | skb->pkt_type = PACKET_HOST; |
1596 | skb->encapsulation = 0; | 1597 | skb->encapsulation = 0; |
1597 | skb->dev = dst_vxlan->dev; | 1598 | skb->dev = dst_vxlan->dev; |
@@ -1897,12 +1898,12 @@ static int vxlan_init(struct net_device *dev) | |||
1897 | struct vxlan_sock *vs; | 1898 | struct vxlan_sock *vs; |
1898 | int i; | 1899 | int i; |
1899 | 1900 | ||
1900 | dev->tstats = alloc_percpu(struct pcpu_tstats); | 1901 | dev->tstats = alloc_percpu(struct pcpu_sw_netstats); |
1901 | if (!dev->tstats) | 1902 | if (!dev->tstats) |
1902 | return -ENOMEM; | 1903 | return -ENOMEM; |
1903 | 1904 | ||
1904 | for_each_possible_cpu(i) { | 1905 | for_each_possible_cpu(i) { |
1905 | struct pcpu_tstats *vxlan_stats; | 1906 | struct pcpu_sw_netstats *vxlan_stats; |
1906 | vxlan_stats = per_cpu_ptr(dev->tstats, i); | 1907 | vxlan_stats = per_cpu_ptr(dev->tstats, i); |
1907 | u64_stats_init(&vxlan_stats->syncp); | 1908 | u64_stats_init(&vxlan_stats->syncp); |
1908 | } | 1909 | } |