From: "Michael S. Tsirkin" <mst@dev.mellanox.co.il>
To: "Michael S. Tsirkin" <mst@dev.mellanox.co.il>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
netdev@vger.kernel.org, general@lists.openfabrics.org,
Roland Dreier <rolandd@cisco.com>,
David Miller <davem@davemloft.net>
Subject: Re: dst_ifdown breaks infiniband?
Date: Mon, 19 Mar 2007 11:55:45 +0200 [thread overview]
Message-ID: <20070319095545.GF8386@mellanox.co.il> (raw)
In-Reply-To: <20070319093632.GB8386@mellanox.co.il>
> Quoting Michael S. Tsirkin <mst@dev.mellanox.co.il>:
> Subject: Re: dst_ifdown breaks infiniband?
>
> > > Any simpler ideas?
> >
> > Well, if inifiniband destructor really needs to take that lock... no.
> > Right now I do not see.
>
> OK, this is actually not hard to fix - for infiniband, we can just look at
> neighbour->dev->type or compare neighbour->dev and
> neighbour->parms->dev - if they are different, device is being unregistered,
> so we do not need to do anything in the destructor.
>
> I'll send a patch to openfabrics, shortly.
>
> However, after implementing this fix, I hit what could be use after
> free at module unloading. Dave, Alexey, Roland, could you take a look at
> the following please?
>
> Works fine for me (survived a couple of hours of crazy device
> loading/unloading/up/down/hotplug + link data and state activity)
> and seems to fix the issue.
>
> ---------
>
> If a device driver sets neigh_destructor in neigh_params, this could
> get called after the device has been unregistered and the driver module
> removed.
>
> This is an old bug, but apparently, started to get triggered more infiniband
> after recent multicast and connected mode changes.
>
> Fix this by delaying dev_put until the neigh_params object is removed.
>
> Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
The problem seems real enough but the fix seems no good -
device unregister gets blocked with
unregister_netdevice: waiting for ib0 to become free. Usage count = 1
It seems the parms object can survive indefinitely after device is removed.
How about creating a new parms object in dst_ifdown, and pointing neighbour
to this?
Would that work?
The advantage of this approach is that neigh->parms is already protected
by RCU.
--
MST
next prev parent reply other threads:[~2007-03-19 9:55 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-18 15:55 Michael S. Tsirkin
2007-03-18 19:12 ` Alexey Kuznetsov
2007-03-18 19:46 ` Michael S. Tsirkin
2007-03-18 19:55 ` Alexey Kuznetsov
2007-03-18 20:24 ` Michael S. Tsirkin
2007-03-18 19:53 ` Michael S. Tsirkin
2007-03-18 20:18 ` Alexey Kuznetsov
2007-03-18 20:29 ` Michael S. Tsirkin
2007-03-19 9:36 ` Michael S. Tsirkin
2007-03-19 9:55 ` Michael S. Tsirkin [this message]
2007-03-19 12:05 ` Alexey Kuznetsov
2007-03-19 12:12 ` Michael S. Tsirkin
2007-03-19 12:59 ` Alexey Kuznetsov
2007-03-19 15:13 ` Michael S. Tsirkin
2007-03-19 23:20 ` Alexey Kuznetsov
2007-03-20 16:02 ` Michael S. Tsirkin
2007-03-20 23:34 ` David Miller
2007-03-19 12:13 ` Michael S. Tsirkin
2007-03-18 20:25 ` Michael S. Tsirkin
2007-03-18 22:24 ` [ofa-general] " Eric W. Biederman
2007-03-18 22:36 ` Michael S. Tsirkin
2007-03-18 22:42 ` Michael S. Tsirkin
2007-03-19 0:13 ` David Miller
2007-03-19 5:19 ` Michael S. Tsirkin
2007-03-19 5:30 ` Eric W. Biederman
2007-03-19 6:13 ` David Miller
2007-03-19 9:34 ` Alexey Kuznetsov
2007-03-19 15:10 ` Eric W. Biederman
2007-03-19 9:24 ` Alexey Kuznetsov
2007-03-19 9:33 ` Michael S. Tsirkin
2007-03-19 9:20 ` Alexey Kuznetsov
2007-03-18 20:33 ` Michael S. Tsirkin
2007-03-18 21:06 ` Michael S. Tsirkin
2007-03-18 21:20 ` Michael S. Tsirkin
2007-03-19 5:15 ` Michael S. Tsirkin
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=20070319095545.GF8386@mellanox.co.il \
--to=mst@dev.mellanox.co.il \
--cc=davem@davemloft.net \
--cc=general@lists.openfabrics.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rolandd@cisco.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®