From: Andrew Morton <andrewm@uow.edu.au>
To: "Albert D. Cahalan" <acahalan@cs.uml.edu>
Cc: Marcus Meissner <Marcus.Meissner@caldera.de>,
linux-kernel@vger.kernel.org
Subject: Re: hotplug mopup
Date: Mon, 11 Dec 2000 18:04:09 +1100 [thread overview]
Message-ID: <3A347C69.9635C3B4@uow.edu.au> (raw)
In-Reply-To: <200012101510.QAA29551@ns.caldera.de> from "Marcus Meissner" at Dec 10, 2000 04:10:01 PM <200012110236.eBB2ar7216847@saturn.cs.uml.edu>
"Albert D. Cahalan" wrote:
>
> Marcus Meissner writes:
>
> >> - On the unregister/removal path, the netdevice layer ensures that
> >> the interface is removed from the kernel namespace prior to launching
> >> `/sbin/hotplug net unregister eth0'.
> >>
> >> This means that when handling netdevice unregistration
> >> /sbin/hotplug cannot and must not attempt to do anything with eth0!
> >> Generally it'll fail to find an interface with this name. If it does
> >> find eth0, it'll be the wrong one due to a race.
> >
> > I always thought I should have to do "/sbin/ifdown eth0" here.
> > (Just as I do /sbin/ifup eth0 on register.)
>
> Yes, definitely. Otherwise, how can one replace the eth0 hardware
> without messing up the network settings? This is supposed to be
> hot plug and all... to me that means I can rip out one network
> card and pop in another without breaking my ssh connections.
Let's see...
You pull the card (let's suppose it's Cardbus). That causes an
interrupt which eventually gets fed to the PCI layer's
pci_remove_device().
The PCI layer calls the netdevice's pci_driver.remove() method.
Typically, xxx_remove() calls unregister_netdevice().
unregister_netdevice() downs the interface, then removes the
netdevice from the kernel namespace and then runs
'/sbin/hotplug net unregister eth0' asynchronously.
When we return from unregister_netdevice() we can guarantee
that the driver's module refcount is zero if this was the
last matching device.
We then wind all the way back to the PCI layer, whizzing gaily
back through the driver whose module refcount is now zero. Sigh.
The PCI layer runs '/sbin/hotplug pci remove' asynchronously. The
driver can be unloaded.
So where in all of this can you read the interface's network
settings? Nowhere, I'm afraid. They're released in
unregister_netdevice().
Isn't this a userspace tool problem?
-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2000-12-11 7:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-10 12:31 hotplug mopup Andrew Morton
2000-12-10 12:58 ` Jeff Garzik
2000-12-10 13:25 ` Andrew Morton
2000-12-10 15:10 ` Marcus Meissner
2000-12-11 2:36 ` Albert D. Cahalan
2000-12-11 7:04 ` Andrew Morton [this message]
2000-12-10 16:35 ` David Brownell
-- strict thread matches above, loose matches on Subject: below --
2000-12-11 21:10 David Brownell
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=3A347C69.9635C3B4@uow.edu.au \
--to=andrewm@uow.edu.au \
--cc=Marcus.Meissner@caldera.de \
--cc=acahalan@cs.uml.edu \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox