diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2007-04-29 00:04:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-04-29 00:04:03 -0400 |
commit | 5a1b5898ee9e0bf68a86609ecb9775457b1857a5 (patch) | |
tree | c51b0c34ba89472a2b5c59d735a7e1affaa0e244 /drivers/net/bonding | |
parent | d16bfd0c77b35a0a0f0e159b94b9921510bf7934 (diff) |
[NET]: Remove NETIF_F_INTERNAL_STATS, default to internal stats.
Herbert Xu conviced me that a new flag was overkill; every driver
currently overrides get_stats, so we might as well make the internal
one the default. If someone did fail to set get_stats, they would now
get all 0 stats instead of "No statistics available".
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 59 |
1 files changed, 25 insertions, 34 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index cea3783c92c5..724bce51f936 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1360,13 +1360,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1360 | goto err_undo_flags; | 1360 | goto err_undo_flags; |
1361 | } | 1361 | } |
1362 | 1362 | ||
1363 | if (slave_dev->get_stats == NULL) { | ||
1364 | printk(KERN_NOTICE DRV_NAME | ||
1365 | ": %s: the driver for slave device %s does not provide " | ||
1366 | "get_stats function, network statistics will be " | ||
1367 | "inaccurate.\n", bond_dev->name, slave_dev->name); | ||
1368 | } | ||
1369 | |||
1370 | new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL); | 1363 | new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL); |
1371 | if (!new_slave) { | 1364 | if (!new_slave) { |
1372 | res = -ENOMEM; | 1365 | res = -ENOMEM; |
@@ -3641,33 +3634,31 @@ static struct net_device_stats *bond_get_stats(struct net_device *bond_dev) | |||
3641 | 3634 | ||
3642 | bond_for_each_slave(bond, slave, i) { | 3635 | bond_for_each_slave(bond, slave, i) { |
3643 | sstats = slave->dev->get_stats(slave->dev); | 3636 | sstats = slave->dev->get_stats(slave->dev); |
3644 | if (sstats) { | 3637 | stats->rx_packets += sstats->rx_packets; |
3645 | stats->rx_packets += sstats->rx_packets; | 3638 | stats->rx_bytes += sstats->rx_bytes; |
3646 | stats->rx_bytes += sstats->rx_bytes; | 3639 | stats->rx_errors += sstats->rx_errors; |
3647 | stats->rx_errors += sstats->rx_errors; | 3640 | stats->rx_dropped += sstats->rx_dropped; |
3648 | stats->rx_dropped += sstats->rx_dropped; | 3641 | |
3649 | 3642 | stats->tx_packets += sstats->tx_packets; | |
3650 | stats->tx_packets += sstats->tx_packets; | 3643 | stats->tx_bytes += sstats->tx_bytes; |
3651 | stats->tx_bytes += sstats->tx_bytes; | 3644 | stats->tx_errors += sstats->tx_errors; |
3652 | stats->tx_errors += sstats->tx_errors; | 3645 | stats->tx_dropped += sstats->tx_dropped; |
3653 | stats->tx_dropped += sstats->tx_dropped; | 3646 | |
3654 | 3647 | stats->multicast += sstats->multicast; | |
3655 | stats->multicast += sstats->multicast; | 3648 | stats->collisions += sstats->collisions; |
3656 | stats->collisions += sstats->collisions; | 3649 | |
3657 | 3650 | stats->rx_length_errors += sstats->rx_length_errors; | |
3658 | stats->rx_length_errors += sstats->rx_length_errors; | 3651 | stats->rx_over_errors += sstats->rx_over_errors; |
3659 | stats->rx_over_errors += sstats->rx_over_errors; | 3652 | stats->rx_crc_errors += sstats->rx_crc_errors; |
3660 | stats->rx_crc_errors += sstats->rx_crc_errors; | 3653 | stats->rx_frame_errors += sstats->rx_frame_errors; |
3661 | stats->rx_frame_errors += sstats->rx_frame_errors; | 3654 | stats->rx_fifo_errors += sstats->rx_fifo_errors; |
3662 | stats->rx_fifo_errors += sstats->rx_fifo_errors; | 3655 | stats->rx_missed_errors += sstats->rx_missed_errors; |
3663 | stats->rx_missed_errors += sstats->rx_missed_errors; | 3656 | |
3664 | 3657 | stats->tx_aborted_errors += sstats->tx_aborted_errors; | |
3665 | stats->tx_aborted_errors += sstats->tx_aborted_errors; | 3658 | stats->tx_carrier_errors += sstats->tx_carrier_errors; |
3666 | stats->tx_carrier_errors += sstats->tx_carrier_errors; | 3659 | stats->tx_fifo_errors += sstats->tx_fifo_errors; |
3667 | stats->tx_fifo_errors += sstats->tx_fifo_errors; | 3660 | stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors; |
3668 | stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors; | 3661 | stats->tx_window_errors += sstats->tx_window_errors; |
3669 | stats->tx_window_errors += sstats->tx_window_errors; | ||
3670 | } | ||
3671 | } | 3662 | } |
3672 | 3663 | ||
3673 | read_unlock_bh(&bond->lock); | 3664 | read_unlock_bh(&bond->lock); |