Commit 560b50cf authored by Fabian Frederick's avatar Fabian Frederick Committed by David S. Miller

ipv4: use dev_sw_netstats_rx_add()

use new helper for netstats settings
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e40b3727
...@@ -360,7 +360,6 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, ...@@ -360,7 +360,6 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
const struct tnl_ptk_info *tpi, struct metadata_dst *tun_dst, const struct tnl_ptk_info *tpi, struct metadata_dst *tun_dst,
bool log_ecn_error) bool log_ecn_error)
{ {
struct pcpu_sw_netstats *tstats;
const struct iphdr *iph = ip_hdr(skb); const struct iphdr *iph = ip_hdr(skb);
int err; int err;
...@@ -402,12 +401,7 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, ...@@ -402,12 +401,7 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
} }
} }
tstats = this_cpu_ptr(tunnel->dev->tstats); dev_sw_netstats_rx_add(tunnel->dev, skb->len);
u64_stats_update_begin(&tstats->syncp);
tstats->rx_packets++;
tstats->rx_bytes += skb->len;
u64_stats_update_end(&tstats->syncp);
skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(tunnel->dev))); skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(tunnel->dev)));
if (tunnel->dev->type == ARPHRD_ETHER) { if (tunnel->dev->type == ARPHRD_ETHER) {
......
...@@ -95,7 +95,6 @@ static int vti_rcv_cb(struct sk_buff *skb, int err) ...@@ -95,7 +95,6 @@ static int vti_rcv_cb(struct sk_buff *skb, int err)
{ {
unsigned short family; unsigned short family;
struct net_device *dev; struct net_device *dev;
struct pcpu_sw_netstats *tstats;
struct xfrm_state *x; struct xfrm_state *x;
const struct xfrm_mode *inner_mode; const struct xfrm_mode *inner_mode;
struct ip_tunnel *tunnel = XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4; struct ip_tunnel *tunnel = XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4;
...@@ -138,13 +137,7 @@ static int vti_rcv_cb(struct sk_buff *skb, int err) ...@@ -138,13 +137,7 @@ static int vti_rcv_cb(struct sk_buff *skb, int err)
skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(skb->dev))); skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(skb->dev)));
skb->dev = dev; skb->dev = dev;
dev_sw_netstats_rx_add(dev, skb->len);
tstats = this_cpu_ptr(dev->tstats);
u64_stats_update_begin(&tstats->syncp);
tstats->rx_packets++;
tstats->rx_bytes += skb->len;
u64_stats_update_end(&tstats->syncp);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment