aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2009-05-17 23:55:16 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-17 23:55:16 -0400
commit9d21493b4beb8f918ba248032fefa393074a5e2b (patch)
tree653590f3e325da5c4c1fc7d2c00bc196a3167f9d /drivers/net/bonding
parent0a305720ee597aad41af61e6b6844321d3e24251 (diff)
net: tx scalability works : trans_start
struct net_device trans_start field is a hot spot on SMP and high performance devices, particularly multi queues ones, because every transmitter dirties it. Is main use is tx watchdog and bonding alive checks. But as most devices dont use NETIF_F_LLTX, we have to lock a netdev_queue before calling their ndo_start_xmit(). So it makes sense to move trans_start from net_device to netdev_queue. Its update will occur on a already present (and in exclusive state) cache line, for free. We can do this transition smoothly. An old driver continue to update dev->trans_start, while an updated one updates txq->trans_start. Further patches could also put tx_bytes/tx_packets counters in netdev_queue to avoid dirtying dev->stats (vlan device comes to mind) Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 815191dd03c3..30b9ea6d62b0 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2795,7 +2795,7 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
2795 */ 2795 */
2796 bond_for_each_slave(bond, slave, i) { 2796 bond_for_each_slave(bond, slave, i) {
2797 if (slave->link != BOND_LINK_UP) { 2797 if (slave->link != BOND_LINK_UP) {
2798 if (time_before_eq(jiffies, slave->dev->trans_start + delta_in_ticks) && 2798 if (time_before_eq(jiffies, dev_trans_start(slave->dev) + delta_in_ticks) &&
2799 time_before_eq(jiffies, slave->dev->last_rx + delta_in_ticks)) { 2799 time_before_eq(jiffies, slave->dev->last_rx + delta_in_ticks)) {
2800 2800
2801 slave->link = BOND_LINK_UP; 2801 slave->link = BOND_LINK_UP;
@@ -2827,7 +2827,7 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
2827 * when the source ip is 0, so don't take the link down 2827 * when the source ip is 0, so don't take the link down
2828 * if we don't know our ip yet 2828 * if we don't know our ip yet
2829 */ 2829 */
2830 if (time_after_eq(jiffies, slave->dev->trans_start + 2*delta_in_ticks) || 2830 if (time_after_eq(jiffies, dev_trans_start(slave->dev) + 2*delta_in_ticks) ||
2831 (time_after_eq(jiffies, slave->dev->last_rx + 2*delta_in_ticks))) { 2831 (time_after_eq(jiffies, slave->dev->last_rx + 2*delta_in_ticks))) {
2832 2832
2833 slave->link = BOND_LINK_DOWN; 2833 slave->link = BOND_LINK_DOWN;
@@ -2938,7 +2938,7 @@ static int bond_ab_arp_inspect(struct bonding *bond, int delta_in_ticks)
2938 * the bond has an IP address) 2938 * the bond has an IP address)
2939 */ 2939 */
2940 if ((slave->state == BOND_STATE_ACTIVE) && 2940 if ((slave->state == BOND_STATE_ACTIVE) &&
2941 (time_after_eq(jiffies, slave->dev->trans_start + 2941 (time_after_eq(jiffies, dev_trans_start(slave->dev) +
2942 2 * delta_in_ticks) || 2942 2 * delta_in_ticks) ||
2943 (time_after_eq(jiffies, slave_last_rx(bond, slave) 2943 (time_after_eq(jiffies, slave_last_rx(bond, slave)
2944 + 2 * delta_in_ticks)))) { 2944 + 2 * delta_in_ticks)))) {
@@ -2982,7 +2982,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
2982 write_lock_bh(&bond->curr_slave_lock); 2982 write_lock_bh(&bond->curr_slave_lock);
2983 2983
2984 if (!bond->curr_active_slave && 2984 if (!bond->curr_active_slave &&
2985 time_before_eq(jiffies, slave->dev->trans_start + 2985 time_before_eq(jiffies, dev_trans_start(slave->dev) +
2986 delta_in_ticks)) { 2986 delta_in_ticks)) {
2987 slave->link = BOND_LINK_UP; 2987 slave->link = BOND_LINK_UP;
2988 bond_change_active_slave(bond, slave); 2988 bond_change_active_slave(bond, slave);