Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bareudp: Use pcpu stats to update rx_dropped counter.

Use the core_stats rx_dropped counter to avoid the cost of atomic
increments.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Guillaume Nault and committed by
David S. Miller
788d5d65 03fc07a2

+6 -6
+6 -6
drivers/net/bareudp.c
··· 84 84 85 85 if (skb_copy_bits(skb, BAREUDP_BASE_HLEN, &ipversion, 86 86 sizeof(ipversion))) { 87 - DEV_STATS_INC(bareudp->dev, rx_dropped); 87 + dev_core_stats_rx_dropped_inc(bareudp->dev); 88 88 goto drop; 89 89 } 90 90 ipversion >>= 4; ··· 94 94 } else if (ipversion == 6 && bareudp->multi_proto_mode) { 95 95 proto = htons(ETH_P_IPV6); 96 96 } else { 97 - DEV_STATS_INC(bareudp->dev, rx_dropped); 97 + dev_core_stats_rx_dropped_inc(bareudp->dev); 98 98 goto drop; 99 99 } 100 100 } else if (bareudp->ethertype == htons(ETH_P_MPLS_UC)) { ··· 108 108 ipv4_is_multicast(tunnel_hdr->daddr)) { 109 109 proto = htons(ETH_P_MPLS_MC); 110 110 } else { 111 - DEV_STATS_INC(bareudp->dev, rx_dropped); 111 + dev_core_stats_rx_dropped_inc(bareudp->dev); 112 112 goto drop; 113 113 } 114 114 } else { ··· 124 124 (addr_type & IPV6_ADDR_MULTICAST)) { 125 125 proto = htons(ETH_P_MPLS_MC); 126 126 } else { 127 - DEV_STATS_INC(bareudp->dev, rx_dropped); 127 + dev_core_stats_rx_dropped_inc(bareudp->dev); 128 128 goto drop; 129 129 } 130 130 } ··· 136 136 proto, 137 137 !net_eq(bareudp->net, 138 138 dev_net(bareudp->dev)))) { 139 - DEV_STATS_INC(bareudp->dev, rx_dropped); 139 + dev_core_stats_rx_dropped_inc(bareudp->dev); 140 140 goto drop; 141 141 } 142 142 ··· 144 144 145 145 tun_dst = udp_tun_rx_dst(skb, family, key, 0, 0); 146 146 if (!tun_dst) { 147 - DEV_STATS_INC(bareudp->dev, rx_dropped); 147 + dev_core_stats_rx_dropped_inc(bareudp->dev); 148 148 goto drop; 149 149 } 150 150 skb_dst_set(skb, &tun_dst->dst);