[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55B12501.7070709@cumulusnetworks.com>
Date: Thu, 23 Jul 2015 19:31:45 +0200
From: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: netdev@...r.kernel.org, bridge@...ts.linux-foundation.org,
davem@...emloft.net, Satish Ashok <sashok@...ulusnetworks.com>
Subject: Re: [PATCH net] bridge: stp: when using userspace stp stop kernel
hello and hold timers
On 07/23/2015 07:13 PM, Stephen Hemminger wrote:
> On Thu, 23 Jul 2015 19:05:56 +0200
> Nikolay Aleksandrov <nikolay@...ulusnetworks.com> wrote:
>
>> On 07/23/2015 06:59 PM, Stephen Hemminger wrote:
>>> On Thu, 23 Jul 2015 09:07:37 -0700
>>> Nikolay Aleksandrov <nikolay@...ulusnetworks.com> wrote:
>>>
>>>> + /* Stop hello and hold timer */
>>>> + spin_lock_bh(&br->lock);
>>>> + del_timer(&br->hello_timer);
>>>> + list_for_each_entry(p, &br->port_list, list)
>>>> + del_timer(&p->hold_timer);
>>>> + spin_unlock_bh(&br->lock);
>>>
>>> Wouldn't it be easier to use del_timer_sync here?
>>>
>> I think it should work. Also I have an error in the commit message
>> about the kernel BPDU sending which I need to correct. I'll prepare
>> a v2 with your suggestion and fixed commit message.
>
> The one thing to watch out for with del_timer_sync is that
> the timer routine and the caller can't be using the same lock
> otherwise timer will be spinning waiting to get lock that
> is held by caller who is waiting for timer.
>
Actually I just noticed the locking was wrong in the patch, also we should use
del_timer() only because a spin_lock is acquired before that and cannot
use the blocking del_timer_sync() inside.
I'll fix it all up in the second version.
--
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