Skip to contentSkip to conversation

Network hotplug semantics

DISCUSSION Matthew Dharm 5 participants 6 messages Feb 8, 2001 – Feb 10, 2001

lore
Share & tools
lore
#0 lore raw

Given the nature of 10BaseT (being stateless on the wire), I would say that the interface should be signalled at the presence of hardware, not at the presence of link.

Another way to look at this is the following: I can't see if my wire is connected to a switch. I _can_ see that the KLSI unit is attached to my computer.

Matt

Quoted 12 lines · Brad Hards

Situation: USB ethernet adapter (in my case, a KLSI one).

Should the interface (e.g. ethX) be signalled when the device is plugged in to the USB port, or when the electrical connection of the 10BaseT wire is made? What counts as "plugged" in this case?

Brad

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

Signature · 6 lines
Matthew Dharm                              Home: [email protected] 
Maintainer, Linux USB Mass Storage Driver

I'm just trying to think of a way to say "up yours" without getting fired.
					-- Stef
User Friendly, 10/8/1998
#2 lore raw
In reply to Matthew Dharm
Quoted 5 lines · Brad Hards

Situation: USB ethernet adapter (in my case, a KLSI one).

Should the interface (e.g. ethX) be signalled when the device is plugged in to the USB port, or when the electrical connection of the 10BaseT wire is made? What counts as "plugged" in this case?

Quite a lot of ethernet controllers can't tell you whether a wire is connected. For other things like wireless networking the destinction is hard to make. Thus to keep things unified, as soon as the card is up.

Regards
Oliver

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Matthew Dharm

Today, hotplug events basically involve namespace update activities:
for network hotplug events it's just "register" or "unregister". No event corresponds to "plugged".

However, I think in general it'd be good to assume that network interfaces may not be "ready for use" right away. For example, there's no sense in even trying to figure out how to route (much less start advertising a route!) until the link is really usable. And when the interface isn't statically configured, the same issue is true for DHCP setup even earlier than that.

There are two network API calls that seem like they're intended to be used in such cases: netif_device_attach(), and its sibling netif_device_detach() in linux/netdevice.h ... but they seem to just be queue block/unblock primitives, despite what their names imply. The way 3c59x.c and xirc2ps_cs.c use them seems to relate to handling hotplug and suspend/resume events.

- Dave

----- Original Message -----
From: "Oliver Neukum" <[email protected]>
To: "Brad Hards" <[email protected]>; <[email protected]>
Sent: Thursday, February 08, 2001 12:32 AM
Subject: Re: Network hotplug semantics

Quoted 11 lines · Brad Hards
Quoted 5 lines

Situation: USB ethernet adapter (in my case, a KLSI one).

Should the interface (e.g. ethX) be signalled when the device is plugged in to the USB port, or when the electrical connection of the 10BaseT wire is made? What counts as "plugged" in this case?

Quite a lot of ethernet controllers can't tell you whether a wire is connected. For other things like wireless networking the destinction is hard to make. Thus to keep things unified, as soon as the card is up.

Quoted 7 lines

Regards
Oliver

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Matthew Dharm
Quoted 4 lines · David Brownell

Today, hotplug events basically involve namespace update activities:
for network hotplug events it's just "register" or "unregister". No event corresponds to "plugged".

There's netif_carrier_on and _off. Practically no drivers use this at present. Better netdevice manageability is on the 2.5 dartboard somewhere.

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#5 lore raw
In reply to Matthew Dharm
Quoted 11 lines · Oliver Neukum
Quoted 5 lines · Brad Hards

Situation: USB ethernet adapter (in my case, a KLSI one).

Should the interface (e.g. ethX) be signalled when the device is plugged in to the USB port, or when the electrical connection of the 10BaseT wire is made? What counts as "plugged" in this case?

Quite a lot of ethernet controllers can't tell you whether a wire is connected. For other things like wireless networking the destinction is hard to make. Thus to keep things unified, as soon as the card is up.

I am not sure that the device doesn't know - my wireless card (PrismII based)
certainly has a visual indication (led goes from blinking to on solid).

There is also a potential problem on the unplug side:

I go to my favourite linux conference, in the 'net room, and am quietly working away reading my email. In comes a great hulking linux kernel coder
(who for the purpose of this hypothetical story we'll call "davem"). davem
sees that I am using Netscape to read my email and immediately knows that
I am a luser. So he grabs the back of my shirt, and throws me and my netscape
running laptop out the door. He then takes over my port on the switch and
gets down to a few CVS commits.

In the mean time, I recover from my copious injuries and eventually find a script kiddie in the corner trying to break into some site or another, and using IE38.92.beta.4crashme to download pr0n. A quick backhander to the script kiddie, a little bit of crying (over the bruising to my hand),
and I get to plug my laptop back in to the switch. But in the mean time, the DHCP server has given my IP to someone else (who for the purposes of this story we'll call "nina"). So when I plug my laptop in, it gets messy. And when davem realises that it is me screwing up the switch, it'll get really messy.

Fundamentally, what is the difference between disconnecting the cable on one side of the adapter (the USB socket) or the other (the 10BaseT socket)?

Brad

N.B. Any resemblence to actual people is purely for amusement value. Please don't sue me or beat me up.

N.B. Any violence implied or expressed in this email is hypothetical. Unless you are the script kiddie running nmap on my server. side of my adapter (plugged into USB port) and
back in, it works, but

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel