Skip to contentSkip to conversation

vlan: fix u64_stats

PATCH In review Changli Gao 1 participant 2 messages Jul 28, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vlan: fix u64_stats

rx_stats->rx_errors should be under the protection of rx_stats->syncp.

----

 net/8021q/vlan_dev.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/8021q/vlan_dev.c +2 -1
index 3d59c9b..d70d31a 100644
@@ -211,7 +211,6 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
 		default:
 			break;
 		}
-		u64_stats_update_end(&rx_stats->syncp);
 	}
 
 	skb_pull_rcsum(skb, VLAN_HLEN);
@@ -221,8 +220,10 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
 		skb = vlan_check_reorder_header(skb);
 		if (!skb) {
 			rx_stats->rx_errors++;
+			u64_stats_update_end(&rx_stats->syncp);
 			goto err_unlock;
 		}
+		u64_stats_update_end(&rx_stats->syncp);
 	}
 
 	netif_rx(skb);
#1 lore raw
Quoted 2 lines · Changli Gao

rx_stats->rx_errors should be under the protection of rx_stats->syncp.

I checked the code again. rx_errors is unsigned long, so need no protection. Sorry for the noise.

Signature · 2 lines
Regards,
Changli Gao([email protected])