Porting network protocol from NetBSD
Matthew Dillon
dillon at apollo.backplane.com
Sun Sep 21 13:12:02 PDT 2008
:Hi,
:
:I want to port a network protocol implemented on NetBSD to DragonFly
:2.0. Since I am new to this systems engineering work particularly
:source code porting at the kernel/network level so I need your ideas
:and inputs about this matter. I need to know what considerations do I
:need to take in order to effectively
:and efficiently do the porting? Initially, while reviewing the source
:code, I have found out that some portions of the NetBSD codes are
:using splsoftnet()/splx(s) functions while with DragonFly AFAIK uses
:critical sections crit_enter()/crit_exit() functions. Aside from that,
:some part of this network code is using kernel malloc() whereas I
:haven't found kernel malloc() in DragonFly but only memory slab
:allocator as its replacement. From here, there might be more other
:things that I need to know about porting. So, your inputs and ideas
:are highly appreciated.
:
:Thanks in advance.
:
:Archimedes
DragonFly's kernel malloc is kmalloc(), it works the same as the
other BSD's kernel malloc().
DragonFly has no spl*()'s and is moving away from critical sections.
There's a bit of glue which can be defaulted out in an initial port,
some of the pru_*() functions have changed (and will continue to
change through the end of this year), and numerous other differences.
For DragonFly, all major protocol operations are messaged to a
protocol thread and then single-threaded within that thread. This
means that protocols for the most part do not have to worry about
locking, spls, critical sections, or anything else other then doing
their job.
The general structure of a network protocol is still very similar to
the other BSDs, though, but if you don't have much kernel programming
experience you will be spending most of your time learning the ropes
of kernel programming rather then doing the actual port.
-Matt
Matthew Dillon
<dillon at backplane.com>
More information about the Users
mailing list