Commit c22d7ac8 authored by Andy Gospodarek's avatar Andy Gospodarek Committed by David S. Miller

bonding: prevent netpoll over bonded interfaces

Support for netpoll over bonded interfaces was added here:

	commit f6dc31a8
	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: default avatarAndy Gospodarek <andy@greyhouse.net>
Signed-off-by: default avatarJay Vosburgh <fubar@us.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e2f5b045
...@@ -168,7 +168,7 @@ static int arp_ip_count; ...@@ -168,7 +168,7 @@ static int arp_ip_count;
static int bond_mode = BOND_MODE_ROUNDROBIN; static int bond_mode = BOND_MODE_ROUNDROBIN;
static int xmit_hashtype = BOND_XMIT_POLICY_LAYER2; static int xmit_hashtype = BOND_XMIT_POLICY_LAYER2;
static int lacp_fast; static int lacp_fast;
static int disable_netpoll = 1;
const struct bond_parm_tbl bond_lacp_tbl[] = { const struct bond_parm_tbl bond_lacp_tbl[] = {
{ "slow", AD_LACP_SLOW}, { "slow", AD_LACP_SLOW},
...@@ -1742,15 +1742,23 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1742,15 +1742,23 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
bond_set_carrier(bond); bond_set_carrier(bond);
#ifdef CONFIG_NET_POLL_CONTROLLER #ifdef CONFIG_NET_POLL_CONTROLLER
if (slaves_support_netpoll(bond_dev)) { /*
bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL; * Netpoll and bonding is broken, make sure it is not initialized
if (bond_dev->npinfo) * until it is fixed.
slave_dev->npinfo = bond_dev->npinfo; */
} else if (!(bond_dev->priv_flags & IFF_DISABLE_NETPOLL)) { if (disable_netpoll) {
bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
pr_info("New slave device %s does not support netpoll\n", } else {
slave_dev->name); if (slaves_support_netpoll(bond_dev)) {
pr_info("Disabling netpoll support for %s\n", bond_dev->name); bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL;
if (bond_dev->npinfo)
slave_dev->npinfo = bond_dev->npinfo;
} else if (!(bond_dev->priv_flags & IFF_DISABLE_NETPOLL)) {
bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
pr_info("New slave device %s does not support netpoll\n",
slave_dev->name);
pr_info("Disabling netpoll support for %s\n", bond_dev->name);
}
} }
#endif #endif
read_unlock(&bond->lock); read_unlock(&bond->lock);
...@@ -1950,8 +1958,11 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1950,8 +1958,11 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
#ifdef CONFIG_NET_POLL_CONTROLLER #ifdef CONFIG_NET_POLL_CONTROLLER
read_lock_bh(&bond->lock); read_lock_bh(&bond->lock);
if (slaves_support_netpoll(bond_dev))
bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL; /* Make sure netpoll over stays disabled until fixed. */
if (!disable_netpoll)
if (slaves_support_netpoll(bond_dev))
bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL;
read_unlock_bh(&bond->lock); read_unlock_bh(&bond->lock);
if (slave_dev->netdev_ops->ndo_netpoll_cleanup) if (slave_dev->netdev_ops->ndo_netpoll_cleanup)
slave_dev->netdev_ops->ndo_netpoll_cleanup(slave_dev); slave_dev->netdev_ops->ndo_netpoll_cleanup(slave_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment