aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2010-05-02 01:42:16 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-03 01:26:57 -0400
commitdee42870a423ad485129f43cddfe7275479f11d8 (patch)
treee30433d3b55ee248eb672765fe6705be160d882c /include/linux/netdevice.h
parent7ef527377b88ff05fb122a47619ea506c631c914 (diff)
net: fix softnet_stat
Per cpu variable softnet_data.total was shared between IRQ and SoftIRQ context without any protection. And enqueue_to_backlog should update the netdev_rx_stat of the target CPU. This patch renames softnet_data.total to softnet_data.processed: the number of packets processed in uppper levels(IP stacks). softnet_stat data is moved into softnet_data. Signed-off-by: Changli Gao <xiaosuo@gmail.com> ---- include/linux/netdevice.h | 17 +++++++---------- net/core/dev.c | 26 ++++++++++++-------------- net/sched/sch_generic.c | 2 +- 3 files changed, 20 insertions(+), 25 deletions(-) Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 40d4c20d034b..c39938f8a8d8 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -218,16 +218,6 @@ struct neighbour;
218struct neigh_parms; 218struct neigh_parms;
219struct sk_buff; 219struct sk_buff;
220 220
221struct netif_rx_stats {
222 unsigned total;
223 unsigned dropped;
224 unsigned time_squeeze;
225 unsigned cpu_collision;
226 unsigned received_rps;
227};
228
229DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat);
230
231struct netdev_hw_addr { 221struct netdev_hw_addr {
232 struct list_head list; 222 struct list_head list;
233 unsigned char addr[MAX_ADDR_LEN]; 223 unsigned char addr[MAX_ADDR_LEN];
@@ -1390,6 +1380,12 @@ struct softnet_data {
1390 struct sk_buff *completion_queue; 1380 struct sk_buff *completion_queue;
1391 struct sk_buff_head process_queue; 1381 struct sk_buff_head process_queue;
1392 1382
1383 /* stats */
1384 unsigned processed;
1385 unsigned time_squeeze;
1386 unsigned cpu_collision;
1387 unsigned received_rps;
1388
1393#ifdef CONFIG_RPS 1389#ifdef CONFIG_RPS
1394 struct softnet_data *rps_ipi_list; 1390 struct softnet_data *rps_ipi_list;
1395 1391
@@ -1399,6 +1395,7 @@ struct softnet_data {
1399 unsigned int cpu; 1395 unsigned int cpu;
1400 unsigned int input_queue_head; 1396 unsigned int input_queue_head;
1401#endif 1397#endif
1398 unsigned dropped;
1402 struct sk_buff_head input_pkt_queue; 1399 struct sk_buff_head input_pkt_queue;
1403 struct napi_struct backlog; 1400 struct napi_struct backlog;
1404}; 1401};