Revert "ipv6/sit: use DEV_STATS_INC() to avoid data-races"
This reverts commit 222cc04356 which is
commit cb34b7cf17ecf33499c9298943f85af247abc1e9 upstream.
The DEV_STATS_INC() macro is going away in a follow-on fix as
implementing it broke the abi. If this is needed, please add it back
after DEV_STATS_INC() is added to the tree.
Bug: 161946584
Change-Id: I1c7cb7a20eaf4db4fef47af3cccd37d80168f5b3
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -696,7 +696,7 @@ static int ipip6_rcv(struct sk_buff *skb)
|
||||
skb->dev = tunnel->dev;
|
||||
|
||||
if (packet_is_spoofed(skb, iph, tunnel)) {
|
||||
DEV_STATS_INC(tunnel->dev, rx_errors);
|
||||
tunnel->dev->stats.rx_errors++;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -716,8 +716,8 @@ static int ipip6_rcv(struct sk_buff *skb)
|
||||
net_info_ratelimited("non-ECT from %pI4 with TOS=%#x\n",
|
||||
&iph->saddr, iph->tos);
|
||||
if (err > 1) {
|
||||
DEV_STATS_INC(tunnel->dev, rx_frame_errors);
|
||||
DEV_STATS_INC(tunnel->dev, rx_errors);
|
||||
++tunnel->dev->stats.rx_frame_errors;
|
||||
++tunnel->dev->stats.rx_errors;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -948,7 +948,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
|
||||
if (!rt) {
|
||||
rt = ip_route_output_flow(tunnel->net, &fl4, NULL);
|
||||
if (IS_ERR(rt)) {
|
||||
DEV_STATS_INC(dev, tx_carrier_errors);
|
||||
dev->stats.tx_carrier_errors++;
|
||||
goto tx_error_icmp;
|
||||
}
|
||||
dst_cache_set_ip4(&tunnel->dst_cache, &rt->dst, fl4.saddr);
|
||||
@@ -956,14 +956,14 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
|
||||
|
||||
if (rt->rt_type != RTN_UNICAST) {
|
||||
ip_rt_put(rt);
|
||||
DEV_STATS_INC(dev, tx_carrier_errors);
|
||||
dev->stats.tx_carrier_errors++;
|
||||
goto tx_error_icmp;
|
||||
}
|
||||
tdev = rt->dst.dev;
|
||||
|
||||
if (tdev == dev) {
|
||||
ip_rt_put(rt);
|
||||
DEV_STATS_INC(dev, collisions);
|
||||
dev->stats.collisions++;
|
||||
goto tx_error;
|
||||
}
|
||||
|
||||
@@ -976,7 +976,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
|
||||
mtu = dst_mtu(&rt->dst) - t_hlen;
|
||||
|
||||
if (mtu < IPV4_MIN_MTU) {
|
||||
DEV_STATS_INC(dev, collisions);
|
||||
dev->stats.collisions++;
|
||||
ip_rt_put(rt);
|
||||
goto tx_error;
|
||||
}
|
||||
@@ -1015,7 +1015,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
|
||||
struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom);
|
||||
if (!new_skb) {
|
||||
ip_rt_put(rt);
|
||||
DEV_STATS_INC(dev, tx_dropped);
|
||||
dev->stats.tx_dropped++;
|
||||
kfree_skb(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
@@ -1045,7 +1045,7 @@ tx_error_icmp:
|
||||
dst_link_failure(skb);
|
||||
tx_error:
|
||||
kfree_skb(skb);
|
||||
DEV_STATS_INC(dev, tx_errors);
|
||||
dev->stats.tx_errors++;
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
@@ -1064,7 +1064,7 @@ static netdev_tx_t sit_tunnel_xmit__(struct sk_buff *skb,
|
||||
return NETDEV_TX_OK;
|
||||
tx_error:
|
||||
kfree_skb(skb);
|
||||
DEV_STATS_INC(dev, tx_errors);
|
||||
dev->stats.tx_errors++;
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
@@ -1093,7 +1093,7 @@ static netdev_tx_t sit_tunnel_xmit(struct sk_buff *skb,
|
||||
return NETDEV_TX_OK;
|
||||
|
||||
tx_err:
|
||||
DEV_STATS_INC(dev, tx_errors);
|
||||
dev->stats.tx_errors++;
|
||||
kfree_skb(skb);
|
||||
return NETDEV_TX_OK;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user