diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-10-03 20:41:50 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:51:16 -0400 |
commit | 09f75cd7bf13720738e6a196cc0107ce9a5bd5a0 (patch) | |
tree | 4c85b0b395abe7f88c87162fc22570e5de255cb1 /drivers/net/ifb.c | |
parent | ff8ac60948ba819b89e9c87083e8050fc2f89999 (diff) |
[NET] drivers/net: statistics cleanup #1 -- save memory and shrink code
We now have struct net_device_stats embedded in struct net_device,
and the default ->get_stats() hook does the obvious thing for us.
Run through drivers/net/* and remove the driver-local storage of
statistics, and driver-local ->get_stats() hook where applicable.
This was just the low-hanging fruit in drivers/net; plenty more drivers
remain to be updated.
[ Resolved conflicts with napi_struct changes and fix sunqe build
regression... -DaveM ]
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ifb.c')
-rw-r--r-- | drivers/net/ifb.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index 448e618b697..15949d3df17 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c | |||
@@ -40,7 +40,6 @@ | |||
40 | 40 | ||
41 | #define TX_Q_LIMIT 32 | 41 | #define TX_Q_LIMIT 32 |
42 | struct ifb_private { | 42 | struct ifb_private { |
43 | struct net_device_stats stats; | ||
44 | struct tasklet_struct ifb_tasklet; | 43 | struct tasklet_struct ifb_tasklet; |
45 | int tasklet_pending; | 44 | int tasklet_pending; |
46 | /* mostly debug stats leave in for now */ | 45 | /* mostly debug stats leave in for now */ |
@@ -61,7 +60,6 @@ static int numifbs = 2; | |||
61 | 60 | ||
62 | static void ri_tasklet(unsigned long dev); | 61 | static void ri_tasklet(unsigned long dev); |
63 | static int ifb_xmit(struct sk_buff *skb, struct net_device *dev); | 62 | static int ifb_xmit(struct sk_buff *skb, struct net_device *dev); |
64 | static struct net_device_stats *ifb_get_stats(struct net_device *dev); | ||
65 | static int ifb_open(struct net_device *dev); | 63 | static int ifb_open(struct net_device *dev); |
66 | static int ifb_close(struct net_device *dev); | 64 | static int ifb_close(struct net_device *dev); |
67 | 65 | ||
@@ -70,7 +68,7 @@ static void ri_tasklet(unsigned long dev) | |||
70 | 68 | ||
71 | struct net_device *_dev = (struct net_device *)dev; | 69 | struct net_device *_dev = (struct net_device *)dev; |
72 | struct ifb_private *dp = netdev_priv(_dev); | 70 | struct ifb_private *dp = netdev_priv(_dev); |
73 | struct net_device_stats *stats = &dp->stats; | 71 | struct net_device_stats *stats = &_dev->stats; |
74 | struct sk_buff *skb; | 72 | struct sk_buff *skb; |
75 | 73 | ||
76 | dp->st_task_enter++; | 74 | dp->st_task_enter++; |
@@ -140,7 +138,6 @@ resched: | |||
140 | static void ifb_setup(struct net_device *dev) | 138 | static void ifb_setup(struct net_device *dev) |
141 | { | 139 | { |
142 | /* Initialize the device structure. */ | 140 | /* Initialize the device structure. */ |
143 | dev->get_stats = ifb_get_stats; | ||
144 | dev->hard_start_xmit = ifb_xmit; | 141 | dev->hard_start_xmit = ifb_xmit; |
145 | dev->open = &ifb_open; | 142 | dev->open = &ifb_open; |
146 | dev->stop = &ifb_close; | 143 | dev->stop = &ifb_close; |
@@ -158,7 +155,7 @@ static void ifb_setup(struct net_device *dev) | |||
158 | static int ifb_xmit(struct sk_buff *skb, struct net_device *dev) | 155 | static int ifb_xmit(struct sk_buff *skb, struct net_device *dev) |
159 | { | 156 | { |
160 | struct ifb_private *dp = netdev_priv(dev); | 157 | struct ifb_private *dp = netdev_priv(dev); |
161 | struct net_device_stats *stats = &dp->stats; | 158 | struct net_device_stats *stats = &dev->stats; |
162 | int ret = 0; | 159 | int ret = 0; |
163 | u32 from = G_TC_FROM(skb->tc_verd); | 160 | u32 from = G_TC_FROM(skb->tc_verd); |
164 | 161 | ||
@@ -185,19 +182,6 @@ static int ifb_xmit(struct sk_buff *skb, struct net_device *dev) | |||
185 | return ret; | 182 | return ret; |
186 | } | 183 | } |
187 | 184 | ||
188 | static struct net_device_stats *ifb_get_stats(struct net_device *dev) | ||
189 | { | ||
190 | struct ifb_private *dp = netdev_priv(dev); | ||
191 | struct net_device_stats *stats = &dp->stats; | ||
192 | |||
193 | pr_debug("tasklets stats %ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld \n", | ||
194 | dp->st_task_enter, dp->st_txq_refl_try, dp->st_rxq_enter, | ||
195 | dp->st_rx2tx_tran, dp->st_rxq_notenter, dp->st_rx_frm_egr, | ||
196 | dp->st_rx_frm_ing, dp->st_rxq_check, dp->st_rxq_rsch); | ||
197 | |||
198 | return stats; | ||
199 | } | ||
200 | |||
201 | static int ifb_close(struct net_device *dev) | 185 | static int ifb_close(struct net_device *dev) |
202 | { | 186 | { |
203 | struct ifb_private *dp = netdev_priv(dev); | 187 | struct ifb_private *dp = netdev_priv(dev); |