Communications kernel -> userland

Adam Migus adam at migus.org
Tue Jul 22 12:57:01 PDT 2003


Robert Watson said:
>
> Well, the case I had particularly in mind was the rapid
> flow of packets
> form the kernel to the user process; Pawel's suggestion
> handles the flow
> of new data from the user process to the kernel well,
> and has substantial
> similarity to some of the IO Lite mechanisms I pointed
> at (and hopefully
> with many of the same performance benefits).  In the
> kernel-to-userspace
> case, we want to avoid the copy of what is originally
> kernel-owned memory
> (from the mbuf allocator) to the user process memory.
> If you didn't care
> about stuff like confidentiality of kernel memory, etc,
> the simplest
> approach would be to actually map the mbuf memory (and
> possibly cluster)
> into userspace, and then notify the user process in
> some form of the new
> mapping.  However, because mbufs and their meta-data
> aren't page aligned
> (etc, etc, etc), you really don't want to do it
> explicitly that way, I
> suspect.

Ok, I think I understand a little better.  The DMA
analogy combined with the somewhat obscure bracketed
requirements below it caused me to get a little
confused.  As for the page alignment issue have you
checked out the new MBUMA stuff Bosko's doing?  It uses
(and abstracts) mbuf allocation over uma.  Perhaps it
could be taylored to fit your requirements.

>
> By synchronization, I had in mind a mechanism by which
> the process and
> kernel would communicate about memory ownership in the
> shared memory
> space: "I'm done with this packet", "I'm done with
> these packets", "I want
> to continue delivery of that packet", "I modified this
> packet", "I'm
> inserting a new packet here", "I'm dropping this
> packet", all without
> extensive memory copying, and with a moderate amount of
> asynchrony (and
> possibly parallelism).  In terms of functionality, it
> might be similar to
> some of the current services that forward between
> IPDIVERT "in" and "out"
> (such as natd), or between BPF pseudo-devices.  This
> sounds like something
> that likely exists in a few commercial products
> already, so my question to
> Terry was to whether he knew of any in the literature.
> IOLite is the
> closest I know of, as it supports the zero-copy page
> and memory ownership
> bits, although I don't know if they allowed it to
> handle packets, perhaps
> just datagrams and streams.
>

Given my comments above would it not be possible to
offer this mechanism as an extension to the mbuf's own
meta-data?

-- 
Adam Migus - Research Scientist
Network Associates Laboratories (http://www.nailabs.com)


More information about the freebsd-hackers mailing list