aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-12-05 09:37:56 -0500
committerDavid Howells <dhowells@warthog.cambridge.redhat.com>2006-12-05 09:37:56 -0500
commit4c1ac1b49122b805adfa4efc620592f68dccf5db (patch)
tree87557f4bc2fd4fe65b7570489c2f610c45c0adcd /drivers/net/bonding
parentc4028958b6ecad064b1a6303a6a5906d4fe48d73 (diff)
parentd916faace3efc0bf19fe9a615a1ab8fa1a24cd93 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/infiniband/core/iwcm.c drivers/net/chelsio/cxgb2.c drivers/net/wireless/bcm43xx/bcm43xx_main.c drivers/net/wireless/prism54/islpci_eth.c drivers/usb/core/hub.h drivers/usb/input/hid-core.c net/core/netpoll.c Fix up merge failures with Linus's head and fix new compilation failures. Signed-Off-By: David Howells <dhowells@redhat.com>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c63
1 files changed, 36 insertions, 27 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 17a461152d39..488d8ed9e740 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1336,6 +1336,13 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1336 goto err_undo_flags; 1336 goto err_undo_flags;
1337 } 1337 }
1338 1338
1339 if (slave_dev->get_stats == NULL) {
1340 printk(KERN_NOTICE DRV_NAME
1341 ": %s: the driver for slave device %s does not provide "
1342 "get_stats function, network statistics will be "
1343 "inaccurate.\n", bond_dev->name, slave_dev->name);
1344 }
1345
1339 new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL); 1346 new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL);
1340 if (!new_slave) { 1347 if (!new_slave) {
1341 res = -ENOMEM; 1348 res = -ENOMEM;
@@ -3605,33 +3612,35 @@ static struct net_device_stats *bond_get_stats(struct net_device *bond_dev)
3605 read_lock_bh(&bond->lock); 3612 read_lock_bh(&bond->lock);
3606 3613
3607 bond_for_each_slave(bond, slave, i) { 3614 bond_for_each_slave(bond, slave, i) {
3608 sstats = slave->dev->get_stats(slave->dev); 3615 if (slave->dev->get_stats) {
3609 3616 sstats = slave->dev->get_stats(slave->dev);
3610 stats->rx_packets += sstats->rx_packets; 3617
3611 stats->rx_bytes += sstats->rx_bytes; 3618 stats->rx_packets += sstats->rx_packets;
3612 stats->rx_errors += sstats->rx_errors; 3619 stats->rx_bytes += sstats->rx_bytes;
3613 stats->rx_dropped += sstats->rx_dropped; 3620 stats->rx_errors += sstats->rx_errors;
3614 3621 stats->rx_dropped += sstats->rx_dropped;
3615 stats->tx_packets += sstats->tx_packets; 3622
3616 stats->tx_bytes += sstats->tx_bytes; 3623 stats->tx_packets += sstats->tx_packets;
3617 stats->tx_errors += sstats->tx_errors; 3624 stats->tx_bytes += sstats->tx_bytes;
3618 stats->tx_dropped += sstats->tx_dropped; 3625 stats->tx_errors += sstats->tx_errors;
3619 3626 stats->tx_dropped += sstats->tx_dropped;
3620 stats->multicast += sstats->multicast; 3627
3621 stats->collisions += sstats->collisions; 3628 stats->multicast += sstats->multicast;
3622 3629 stats->collisions += sstats->collisions;
3623 stats->rx_length_errors += sstats->rx_length_errors; 3630
3624 stats->rx_over_errors += sstats->rx_over_errors; 3631 stats->rx_length_errors += sstats->rx_length_errors;
3625 stats->rx_crc_errors += sstats->rx_crc_errors; 3632 stats->rx_over_errors += sstats->rx_over_errors;
3626 stats->rx_frame_errors += sstats->rx_frame_errors; 3633 stats->rx_crc_errors += sstats->rx_crc_errors;
3627 stats->rx_fifo_errors += sstats->rx_fifo_errors; 3634 stats->rx_frame_errors += sstats->rx_frame_errors;
3628 stats->rx_missed_errors += sstats->rx_missed_errors; 3635 stats->rx_fifo_errors += sstats->rx_fifo_errors;
3629 3636 stats->rx_missed_errors += sstats->rx_missed_errors;
3630 stats->tx_aborted_errors += sstats->tx_aborted_errors; 3637
3631 stats->tx_carrier_errors += sstats->tx_carrier_errors; 3638 stats->tx_aborted_errors += sstats->tx_aborted_errors;
3632 stats->tx_fifo_errors += sstats->tx_fifo_errors; 3639 stats->tx_carrier_errors += sstats->tx_carrier_errors;
3633 stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors; 3640 stats->tx_fifo_errors += sstats->tx_fifo_errors;
3634 stats->tx_window_errors += sstats->tx_window_errors; 3641 stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors;
3642 stats->tx_window_errors += sstats->tx_window_errors;
3643 }
3635 } 3644 }
3636 3645
3637 read_unlock_bh(&bond->lock); 3646 read_unlock_bh(&bond->lock);