Subject: Re: Cardbus
To: Ken Hornstein <>
From: Bill Sommerfeld <>
List: tech-kern
Date: 12/23/1999 18:57:19
> The only person I do know that has tried tackling it recently is
> Bill Sommerfeld.  His comments about it are in the mailing list
> archives, but to paraphrase him (and correct me if I'm wrong, Bill),
> they were basically, "I tried using it, it was really dusty, obviously
> not maintained, and after looking at it closer, I'm not sure it was
> the right thing".

that's a pretty much correct summary of it.

> Bill had some suggestions on what he wanted to do; I thought they were
> reasonable, but not everyone agreed.

> Looking at other implementations, they don't do any reference counting;
> they either mark the interface in a special "dead" state (what FreeBSD
> did the last time I looked at it), or delete all of the routes from
> the route table and then delete the interface from the interface
> list (OpenBSD).

I think it's also worth looking at what BSDI did; I don't think it's
completely correct but it had certain useful behaivors..  for
instance, popping a card and reinserting it doesn't require you to
re-ifconfig the interface.

> I looked at the OpenBSD code, and it was fairly straightforward.  You
> call ether_detach() to detach the interface from the ether
> subsystem,

or the link-type-specific equivalent?

> and then you call if_detach() to remove the host routes, flush the
> interface queue, and finally delete the interface from the list.  This
> _seems_ like the right approach to me .... but I'd be interested in
> discussing it in greater detail.

You also have to worry about interface pointers in received mbufs.
Given how the pool allocator works, it shouldn't be too hard to write
a function which scans all the mbufs.

					- Bill