diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2009-05-19 18:16:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-19 18:36:15 -0400 |
commit | ab35cd4b8f42b5e4a9338949581a510e98503b28 (patch) | |
tree | 06b66cc8e2696f88e3ecf101863d8ed667eb4c1d /net/sched/sch_teql.c | |
parent | 0cefafadbbe3947fd97b7560a214eb486069faac (diff) |
sch_teql: Use net_device internal stats
We can slightly reduce size of teqlN structure, not duplicating stats
structure in teql_master but using stats field from net_device.stats
for tx_errors and from netdev_queue for tx_bytes/tx_packets/tx_dropped
values.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_teql.c')
-rw-r--r-- | net/sched/sch_teql.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index 3b6418297231..428a5ef5b944 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c | |||
@@ -58,7 +58,6 @@ struct teql_master | |||
58 | struct net_device *dev; | 58 | struct net_device *dev; |
59 | struct Qdisc *slaves; | 59 | struct Qdisc *slaves; |
60 | struct list_head master_list; | 60 | struct list_head master_list; |
61 | struct net_device_stats stats; | ||
62 | }; | 61 | }; |
63 | 62 | ||
64 | struct teql_sched_data | 63 | struct teql_sched_data |
@@ -272,6 +271,7 @@ static inline int teql_resolve(struct sk_buff *skb, | |||
272 | static int teql_master_xmit(struct sk_buff *skb, struct net_device *dev) | 271 | static int teql_master_xmit(struct sk_buff *skb, struct net_device *dev) |
273 | { | 272 | { |
274 | struct teql_master *master = netdev_priv(dev); | 273 | struct teql_master *master = netdev_priv(dev); |
274 | struct netdev_queue *txq = netdev_get_tx_queue(dev, 0); | ||
275 | struct Qdisc *start, *q; | 275 | struct Qdisc *start, *q; |
276 | int busy; | 276 | int busy; |
277 | int nores; | 277 | int nores; |
@@ -311,8 +311,8 @@ restart: | |||
311 | __netif_tx_unlock(slave_txq); | 311 | __netif_tx_unlock(slave_txq); |
312 | master->slaves = NEXT_SLAVE(q); | 312 | master->slaves = NEXT_SLAVE(q); |
313 | netif_wake_queue(dev); | 313 | netif_wake_queue(dev); |
314 | master->stats.tx_packets++; | 314 | txq->tx_packets++; |
315 | master->stats.tx_bytes += length; | 315 | txq->tx_bytes += length; |
316 | return 0; | 316 | return 0; |
317 | } | 317 | } |
318 | __netif_tx_unlock(slave_txq); | 318 | __netif_tx_unlock(slave_txq); |
@@ -339,10 +339,10 @@ restart: | |||
339 | netif_stop_queue(dev); | 339 | netif_stop_queue(dev); |
340 | return 1; | 340 | return 1; |
341 | } | 341 | } |
342 | master->stats.tx_errors++; | 342 | dev->stats.tx_errors++; |
343 | 343 | ||
344 | drop: | 344 | drop: |
345 | master->stats.tx_dropped++; | 345 | txq->tx_dropped++; |
346 | dev_kfree_skb(skb); | 346 | dev_kfree_skb(skb); |
347 | return 0; | 347 | return 0; |
348 | } | 348 | } |
@@ -395,12 +395,6 @@ static int teql_master_close(struct net_device *dev) | |||
395 | return 0; | 395 | return 0; |
396 | } | 396 | } |
397 | 397 | ||
398 | static struct net_device_stats *teql_master_stats(struct net_device *dev) | ||
399 | { | ||
400 | struct teql_master *m = netdev_priv(dev); | ||
401 | return &m->stats; | ||
402 | } | ||
403 | |||
404 | static int teql_master_mtu(struct net_device *dev, int new_mtu) | 398 | static int teql_master_mtu(struct net_device *dev, int new_mtu) |
405 | { | 399 | { |
406 | struct teql_master *m = netdev_priv(dev); | 400 | struct teql_master *m = netdev_priv(dev); |
@@ -425,7 +419,6 @@ static const struct net_device_ops teql_netdev_ops = { | |||
425 | .ndo_open = teql_master_open, | 419 | .ndo_open = teql_master_open, |
426 | .ndo_stop = teql_master_close, | 420 | .ndo_stop = teql_master_close, |
427 | .ndo_start_xmit = teql_master_xmit, | 421 | .ndo_start_xmit = teql_master_xmit, |
428 | .ndo_get_stats = teql_master_stats, | ||
429 | .ndo_change_mtu = teql_master_mtu, | 422 | .ndo_change_mtu = teql_master_mtu, |
430 | }; | 423 | }; |
431 | 424 | ||