why zero-copy sockets(9) are not popular?
Alexander Bubnov
alexander.bubnov at gmail.com
Sun Mar 21 05:21:26 UTC 2010
Bruce, many thanks for comprehensive answer!
2010/3/20 Bruce Simpson <bms at incunabulum.net>
> On 03/20/10 10:06, Alexander Bubnov wrote:
>
>> Hello, all!
>> Anybody knows why zero copy is not popular although this technique allows
>> to increase performance of servers? It is very hard to find any examples
>> of
>> zero-copy for FreeBSD.
>>
>>
>
> Transmit is easy. Receive is hard.
>
> The whole concept of zero-copy revolves around being able to use
> page-flipping to map buffers in user and kernel space, to amortize the cost
> of copies across that system boundary.
>
> The compromise usually taken is to use the sendfile() API, or rely on TCP
> Segmentation Offload (TSO), much like Microsoft's Chimney stack does in
> Windows 7. Unfortunately, sendfile() only covers transmit. TSO only offloads
> up to the point where sockets hit the card; TSO can offload TCP stream
> reassembly, but you still have to copy from the kernel buffers into
> userland.
>
> True zero-copy sockets generally require scatter/gather DMA engine support,
> and TCP/IP header splitting, to do zero-copy recieve.
>
> S/G PCI DMA cores are often custom designed, and you tend not to find them
> in off-the-shelf VHDL libraries. That IP (as in intellectual property) still
> has cost.
>
> Historically the only cards in FreeBSD which supported this, were the
> Tigon-II, which got bought by Broadcom (bge is the Tigon-III). Modified
> firmware was required to do this.
>
>
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>
--
/BR, Alexander
More information about the freebsd-net
mailing list