[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 13 Oct 2010 10:44:55 +0800
From: Cong Wang <amwang@...hat.com>
To: nhorman@...driver.com
CC: netdev@...r.kernel.org, bonding-devel@...ts.sourceforge.net,
fubar@...ibm.com, davem@...emloft.net, andy@...yhouse.net
Subject: Re: [PATCH 2/5] Fix deadlock in bonding driver resulting from internal
locking when using netpoll
On 10/13/10 05:55, nhorman@...driver.com wrote:
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -76,6 +76,7 @@
> #include<linux/if_vlan.h>
> #include<linux/if_bonding.h>
> #include<linux/jiffies.h>
> +#include<linux/preempt.h>
> #include<net/route.h>
> #include<net/net_namespace.h>
> #include<net/netns/generic.h>
> @@ -169,6 +170,35 @@ MODULE_PARM_DESC(resend_igmp, "Number of IGMP membership reports to send on link
>
> /*----------------------------- Global variables ----------------------------*/
>
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +static cpumask_var_t netpoll_block_tx;
> +
> +static inline void block_netpoll_tx(void
> +{
> + preempt_disable();
> + BUG_ON(cpumask_test_and_set_cpu(smp_processor_id(),
> + netpoll_block_tx));
> +}
> +
> +static inline void unblock_netpoll_tx(void)
> +{
> + BUG_ON(!cpumask_test_and_clear_cpu(smp_processor_id(),
> + netpoll_block_tx));
> + preempt_enable();
> +}
> +
> +static inline int is_netpoll_tx_blocked(struct net_device *dev)
> +{
> + if (unlikely(dev->priv_flags& IFF_IN_NETPOLL))
> + return cpumask_test_cpu(smp_processor_id(), netpoll_block_tx);
> + return 0;
> +}
> +#else
> +#define block_netpoll_tx()
> +#define unblock_netpoll_tx()
> +#define is_netpoll_tx_blocked(dev)
> +#endif
> +
These should go to netpoll.h, IMHO.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists