aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndy Gospodarek <andy@greyhouse.net>2010-06-25 05:50:44 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-29 02:54:10 -0400
commitc22d7ac844f1cb9c6a5fd20f89ebadc2feef891b (patch)
tree63af10f1115dfdc5ec0c08765ba342b62809d808 /drivers
parente2f5b04563786d4b7d7648868de7e941a0649372 (diff)
bonding: prevent netpoll over bonded interfaces
Support for netpoll over bonded interfaces was added here: commit f6dc31a85cd46a959bdd987adad14c3b645e03c1 Author: WANG Cong <amwang@redhat.com> Date: Thu May 6 00:48:51 2010 -0700 bonding: make bonding support netpoll but it is bad enough that we should probably just disable netpoll over bonding until some of the locking logic in the bonding driver is changed or converted completely to RCU. Simple actions like changing the active slave in active-backup mode will hang the box if a high enough printk debugging level is enabled. Keeping the old code around will be good for anyone that wants to work on it (and for after the RCU conversion), so I propose this small patch rather than ripping it all out. Signed-off-by: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/bonding/bond_main.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5e12462a9d5e..c3d98dde2f86 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -168,7 +168,7 @@ static int arp_ip_count;
168static int bond_mode = BOND_MODE_ROUNDROBIN; 168static int bond_mode = BOND_MODE_ROUNDROBIN;
169static int xmit_hashtype = BOND_XMIT_POLICY_LAYER2; 169static int xmit_hashtype = BOND_XMIT_POLICY_LAYER2;
170static int lacp_fast; 170static int lacp_fast;
171 171static int disable_netpoll = 1;
172 172
173const struct bond_parm_tbl bond_lacp_tbl[] = { 173const struct bond_parm_tbl bond_lacp_tbl[] = {
174{ "slow", AD_LACP_SLOW}, 174{ "slow", AD_LACP_SLOW},
@@ -1742,15 +1742,23 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1742 bond_set_carrier(bond); 1742 bond_set_carrier(bond);
1743 1743
1744#ifdef CONFIG_NET_POLL_CONTROLLER 1744#ifdef CONFIG_NET_POLL_CONTROLLER
1745 if (slaves_support_netpoll(bond_dev)) { 1745 /*
1746 bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL; 1746 * Netpoll and bonding is broken, make sure it is not initialized
1747 if (bond_dev->npinfo) 1747 * until it is fixed.
1748 slave_dev->npinfo = bond_dev->npinfo; 1748 */
1749 } else if (!(bond_dev->priv_flags & IFF_DISABLE_NETPOLL)) { 1749 if (disable_netpoll) {
1750 bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; 1750 bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
1751 pr_info("New slave device %s does not support netpoll\n", 1751 } else {
1752 slave_dev->name); 1752 if (slaves_support_netpoll(bond_dev)) {
1753 pr_info("Disabling netpoll support for %s\n", bond_dev->name); 1753 bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL;
1754 if (bond_dev->npinfo)
1755 slave_dev->npinfo = bond_dev->npinfo;
1756 } else if (!(bond_dev->priv_flags & IFF_DISABLE_NETPOLL)) {
1757 bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
1758 pr_info("New slave device %s does not support netpoll\n",
1759 slave_dev->name);
1760 pr_info("Disabling netpoll support for %s\n", bond_dev->name);
1761 }
1754 } 1762 }
1755#endif 1763#endif
1756 read_unlock(&bond->lock); 1764 read_unlock(&bond->lock);
@@ -1950,8 +1958,11 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1950 1958
1951#ifdef CONFIG_NET_POLL_CONTROLLER 1959#ifdef CONFIG_NET_POLL_CONTROLLER
1952 read_lock_bh(&bond->lock); 1960 read_lock_bh(&bond->lock);
1953 if (slaves_support_netpoll(bond_dev)) 1961
1954 bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL; 1962 /* Make sure netpoll over stays disabled until fixed. */
1963 if (!disable_netpoll)
1964 if (slaves_support_netpoll(bond_dev))
1965 bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL;
1955 read_unlock_bh(&bond->lock); 1966 read_unlock_bh(&bond->lock);
1956 if (slave_dev->netdev_ops->ndo_netpoll_cleanup) 1967 if (slave_dev->netdev_ops->ndo_netpoll_cleanup)
1957 slave_dev->netdev_ops->ndo_netpoll_cleanup(slave_dev); 1968 slave_dev->netdev_ops->ndo_netpoll_cleanup(slave_dev);