cvs commit: src/sys/sys protosw.h src/sys/kern
brooks at one-eyed-alien.net
Tue Oct 19 15:37:11 PDT 2004
On Tue, Oct 19, 2004 at 06:19:10PM -0400, Robert Watson wrote:
> On Tue, 19 Oct 2004, Julian Elischer wrote:
> > >>Another point: If you really want to keep the possibility to remove a
> > >>protocol, you have to introduce some busy counter that pervents removal while
> > >>the kernel is inside a protocol function. This has to be handled by the
> > >>protocol itself, but it has to be taken care of somehow.
> > each protocol array entry could have either a mutex or a refcount or
> > both..
> The trick here is to get just enough synchronization to not break, but not
> enough to hurt. That's one of the reasons why I feel like the heavier
> weight approaches taken elsewhere may not be appropriate here. I guess no
> one is talking about loading UDP, but at the same time if we're going to
> have generic loadable protocol support, it would be nice to get a pretty
> clean API that would meet the requirements of higher volume protocols. As
> I mentioned in a previous e-mail, it might almost be desirable to say "no
> unloading" and simply avoid the hard problems, since atomic add is easy
> whereas atomic remove is hard.
One of the things I've been looking at with interfaces is trying to
squash the really big races (mostly dummynet) by avoiding holding a
pointer to an interface any longer then necessicary. Instead I'm
planning to hold interface indexes instead. I'm planning to introduce a
"struct ifnet dead_if" to return when the index is no longer valid. It
will attempt to have sane no-op values so when the big races are lost it
doesn't matter. At least with interface removals, the small races don't
seem to actually happen much in practice so ignoring them may well be a
better solution then requiring a refcount every time you need to touch
Once I get ipfw6 working, I'm planning to take a look at this some more.
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-all/attachments/20041019/b38d343f/attachment.bin
More information about the cvs-all