From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200602021740.k12Hetmb080366@gate.bitblocks.com> To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> From: Bakul Shah Subject: Re: [9fans] Van Jacobsen's network stack restructure In-reply-to: Your message of "Thu, 02 Feb 2006 13:37:09 GMT." <7b047d716a78747329b138188f13d428@terzarima.net> Date: Thu, 2 Feb 2006 09:40:55 -0800 Topicbox-Message-UUID: ef95b956-ead0-11e9-9d60-3106f5b1d025 > one disadvantage of the library approach in the unix environment is that > you're once again back having to know which `access method' to use, > to pass the file descriptor or handle to the right library. > i might easily have misunderstood something though. They already have the file descriptor (i.e. socket descr) in order to get at the data. All they have to do is to mmap some memory and have the network controller copy incoming tcp packets for this connection directly into this memory. By using this memory as a circular buffer one can avoid all locking (memory in the range [read ptr .. write ptr) is owned by the app, [write ptr .. read ptr) is owned by the driver). The driver will have to checksum the pkt and be able to map seq. # to a memory address within the buffer but one can do all the grotty protocol processing in the user code. A similar buffer can be used for outgoing data. I bet they do something along these lines. Hasn't this idea been used in various forms over the years?