Subject: Re: hot plugging network cards
To: Jun-ichiro itojun Hagino <itojun@itojun.org>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: tech-net
Date: 06/02/1999 11:44:14
Sorry for the delay.
On Thu, 27 May 1999, Jun-ichiro itojun Hagino wrote:
>
> >Playing around with PCMCIA network cards, it appears that there is
> >currently no support (1.4) for actually _ejecting_ a card. Does
> >anyone have a set of patches I can try out or should I just hack
> >on this myself ? (As I recall, it's not very hard to make an interface
> >disappear as far as the kernel is concerned).
Actually it's REALLY hard to make the interface disappear cleanly. The
current netowrking code does NOT do reference counting, and you can get
dangling references.
> I would like to see that patch, but...
>
> From the source code it looks that direction is to reclaim
> struct ifnet completely. IMHO removing struct ifnet is very
> hard task as it is referenced from almost everywhere.
struct ifnet wasn't too bad. The real problem were the struct ifaddr's as
they: 1) have struct ifnet references, and 2) the current code only keeps
ifaddr references on long-term stored references. i.e. the ref count is
touched only when the pointer is stored in a struct. For removal to work,
even the held pointer needs to be refered to.
> From my experience with BSDI's pcmcia support (was done by
> shinoda@jaist.ac.jp and other voluntteers including me)
> I think it is better to:
> - separate card slot # and name of interface. bind name of interface
> (say ne2) to MAC address of the interface card.
> This gives you the following behavior:
> insert card A (macaddr=A) to slot 0. it will be ne2.
> insert card B (macaddr=B) to slot 1. it will be ne3.
> remove both cards. ne2 and ne3 are kept in the kernel,
> but all write operations will fail.
> insert card A (macaddr=A) to slot 2. it will be recognized
> as ne2 again.
> This is needed if you would like to make a router with notebook
> PC, run routing daemon, and run IPv6 on notebooks.
> (part of IPv6 address is taken from mac address so it is important
> to keep interfadce name - mac address mapping)
> - separate card power state and ifconfig up/down. we sometimes
> would like to remove cards with IFF_UP state
> (it is not high priority, though)
>
> I would like to know plans and direcitons, and would like to
> volunteer (of course).
A good place to start is the ifdetach branch which I handed off to Ken H.
It has the ifdetach patches I made, plus bug fixes from Ken to make it
actually work. :-) Unfortunatly I think it's about 6 months out of date.
Take care,
Bill