All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brice Goglin <brice@myri.com>
To: Andi Kleen <ak@suse.de>
Cc: Arnd Bergmann <arnd@arndb.de>,
	netdev@vger.kernel.org, gallatin@myri.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] myri10ge - Driver core
Date: Sat, 20 May 2006 09:58:45 +0200	[thread overview]
Message-ID: <446ECC35.5050707@myri.com> (raw)
In-Reply-To: <446DE8CF.7050603@myri.com>

Brice Goglin wrote:
> Andi Kleen wrote:
>   
>> On Friday 19 May 2006 12:00, Arnd Bergmann wrote:
>>   
>>     
>>> On Friday 19 May 2006 04:25, Brice Goglin wrote:
>>>     
>>>       
>>>> dev_mc_upload() from net/core/dev_mcast.c does
>>>>
>>>> spin_lock_bh(&dev->xmit_lock);
>>>> __dev_mc_upload(dev);
>>>>
>>>> which calls dev->set_multicast_list(), which is
>>>> myri10ge_set_multicast_list()
>>>>
>>>> which calls myri10ge_change_promisc
>>>>
>>>> which calls myri10ge_send_cmd
>>>>       
>>>>         
>>> Hmm, if that is the only path where you call it, it may be
>>> helpful to change myri10ge_change_promisc to call a special
>>> atomic version of myri10ge_send_cmd then, while all others
>>> use the regular version, which you can then convert to
>>> do msleep as well.
>>>     
>>>       
>> Or just drop the xmit lock while you do that. As long as you
>> handle races with ->start_xmit yourself it's ok
>>   
>>     
>
> Looks like we can do that.
>   

Forget what I said. It's not that simple. __dev_mc_upload() is also
called from igmp6_group_added() (through dev_mc_add()). In this path,
there are two spin_lock_bh that are held:

igmp6_group_added(...)
    [...]
    spin_lock_bh(&mc->mca_lock);
    [...]
    dev_mc_add(...)

dev_mv_add(..)
    [...]
    spin_lock_bh(&dev->xmit_lock);
    [...]
    __dev_mc_upload(...)

We have actually seen this path being taken by adding a
    if (in_interrupt()) {
       printk("bad bad bad\n");
       dump_stack();
    }
in our myri10ge_send_cmd(...).

We are going to add a "sleepable" parameter to myri10ge_send_cmd() so
that only set_multicast_list() will use it with our previous udelay loop.

Brice


  reply	other threads:[~2006-05-20  7:59 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-17 22:02 [PATCH 0/4] myri10ge - Myri-10G Ethernet driver - v2 Brice Goglin
2006-05-17 22:03 ` [PATCH 1/4] myri10ge - Revive pci_find_ext_capability Brice Goglin
2006-05-17 22:04 ` [PATCH 2/4] myri10ge - Driver header files Brice Goglin
2006-05-17 22:28   ` Randy.Dunlap
2006-05-18 23:36     ` Brice Goglin
2006-05-17 22:06 ` [PATCH 3/4] myri10ge - Driver core Brice Goglin
2006-05-17 22:36   ` Roland Dreier
2006-05-18 23:38     ` Brice Goglin
2006-05-17 23:08   ` Arnd Bergmann
2006-05-18 23:56     ` Brice Goglin
2006-05-19  1:55       ` Arnd Bergmann
2006-05-19  2:25         ` Brice Goglin
2006-05-19 10:00           ` Arnd Bergmann
2006-05-19 11:09             ` Andi Kleen
2006-05-19 15:48               ` Brice Goglin
2006-05-20  7:58                 ` Brice Goglin [this message]
2006-05-19 14:39     ` Brice Goglin
2006-05-19 23:15     ` Brice Goglin
2006-05-20  0:01       ` Andi Kleen
2006-05-23 15:39   ` Anton Blanchard
2006-05-24  8:04     ` Brice Goglin
2006-05-24 21:21       ` Anton Blanchard
2006-05-25  7:59       ` Benjamin Herrenschmidt
2006-05-25  9:07         ` Brice Goglin
2006-05-25  7:56     ` Benjamin Herrenschmidt
2006-05-26  9:49       ` Ingo Oeser
2006-05-26 10:02         ` Benjamin Herrenschmidt
2006-05-26 10:30           ` Jeff Garzik
2006-05-26 10:56             ` Benjamin Herrenschmidt
2006-05-17 22:07 ` [PATCH 4/4] myri10ge - Kconfig and Makefile Brice Goglin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=446ECC35.5050707@myri.com \
    --to=brice@myri.com \
    --cc=ak@suse.de \
    --cc=arnd@arndb.de \
    --cc=gallatin@myri.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.