Messages in this thread | | | Subject | Re: Idea to make a kickass TCP read! | Date | Fri, 7 Aug 1998 12:04:01 +0200 (MEST) | From | (Rogier Wolff) |
| |
> Followup to: <199808061818.LAA25038@sun4.apsoft.com> > By author: Perry Harrington <pedward@sun4.apsoft.com> > In newsgroup: linux.dev.kernel > > > > Here's the thought. > > > > What if we created a read call that was identical in every way, except > > you passed it a SHM handle. It would directly write the data to the > > SHM segment rather than doing a NIC -> kernel -> user operation? > > > > This would make a one copy high performance, low-latency TCP read for > > the Cluster nuts. > >
Thinking about this, what you really need is a bus mastering card that can interrupt after it has gotten a certain amount (configurable!) of data. (For a router, you want to set the threshhold to "after the TCP destination address", for an applciation machine where you might want to DMA directly into userspace, you should set it to "after the header including TCP/IP port numbers")
At that moment the data that's come in so far, should be available through a memory mapped window. This allows the operating system to peek at the header. At that moment the OS gets to decide what to do with the packet: discard, DMA into main memory (Not always the whole packet!) or leave in buffer.
Discard is for broadcasts that we don't really want etc, or for packets where looking at the header means "we've seen enough". (e.g. a TCP SYN).
DMA into main memory for data that needs to go into a users buffer. Or you allocate a sk_buff, and put it there.
Leave in buffer is for packets that will need to go out on a different interface. You don't want to bother the main memory bus with packets that need to go out over a PCI bus a few microseconds later.
Neat things that will happen: You can do wormhole routing: you get a packet, examine the header, make the routing decision, and send it off to the destination, even before the whole packet is recieved. The OS needs to know that the sending line-speed is less-or-equal than the receiving speed.
Roger.
-- Actor asks a collegue: "To what do you owe your success in acting?" Answer: "Honesty. Once you've learned how to fake that, you've got it made." -------- Custom Linux device drivers for sale! Call for a quote. ---------- Email: R.E.Wolff@BitWizard.nl || Tel: +31-15-2137555 || FAX: +31-15-2138217
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html
| |