Subject: Re: [PATCH] bond_alb: do not disable BH under netpoll

From: Maxim Uvarov <[email-masked]>
Date: Wed, 04 Jan 2012 11:35:59 -0800

On 01/04/2012 10:25 AM, David Miller wrote:
> From: Maxim Uvarov<[email-masked]>
> Date: Wed, 04 Jan 2012 00:14:39 -0800
>
>> On 03.01.2012 18:49, David Miller wrote:
>>> From: Maxim Uvarov<[email-masked]>
>>> Date: Tue,  3 Jan 2012 18:20:18 -0800
>>>
>>>> Do not disable BH if interrupts are already disabled
>>>> (netpoll case).
>>>> Signed-off-by: Maxim Uvarov<[email-masked]>
>>> Barf...
>>>
>>> We should never use conditional locking like this.
>>
>>
>> How about change spin_lock_bh  to spin_lock_irqsave at this place?
>
> Then it's ambiguous whether it's a softirq safe lock or a hardirq
> safe one.
>
> It's just another way to make the locking inconsistent.

at bond_start_xmit() there is check if it's netpoll or not:

	/*
	 * If we risk deadlock from transmitting this in the
	 * netpoll path, tell netpoll to queue the frame for later tx
	 */
	if (is_netpoll_tx_blocked(dev))
		return NETDEV_TX_BUSY;

which is in the end:

static inline int netpoll_tx_running(struct net_device *dev)
{
	return irqs_disabled();
}

So the original patch was in the way as it already implemented.

BTW,
I'm trying to remove warning generated by local_bh_enable_ip:
http://marc.info/?l=linux-netdev&m=132528368523980&w=2

Maxim.