From owner-freebsd-net@FreeBSD.ORG Mon Mar 22 09:03:22 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8187A1065676 for ; Mon, 22 Mar 2010 09:03:22 +0000 (UTC) (envelope-from alexander.bubnov@gmail.com) Received: from mail-fx0-f209.google.com (mail-fx0-f209.google.com [209.85.220.209]) by mx1.freebsd.org (Postfix) with ESMTP id 0981F8FC1B for ; Mon, 22 Mar 2010 09:03:21 +0000 (UTC) Received: by fxm1 with SMTP id 1so5075927fxm.33 for ; Mon, 22 Mar 2010 02:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=bj/ODyyGOHFC4HaWTtS+c5vZdNqnkO6caIfvX3wfGQQ=; b=IIF7gkEzAxs9ZC04Lm3HVtUbMJwdZQp48uH6xPp6asXyP4HBzOjXPk/Tz87vUIKNeB fCqqUwiW3lBMbvoZXI1xyvgVOucErp4D2z2BCjST8y9fq8LCkrsCUq6Zb78GUyKcEsYP jtmRuPR3FZzR6aYv0oQH+0rFE2HFafInrlRcY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=rseZpelUdPon5+dnMN+xc5hmjl7+/LNA7xjZgTDHJY2X7wiu+nSK1u1Ut0YQ3g3hQl xlkugxybWSGfkjRGfHlkctUjSBFgXfSnVAxQwvdu+DF8dJ0CH9l8iAHxGSCKbgJbEN1g y97bbiFU1ccwdpqU5eoE+ytiC7oNkOh09zg0A= MIME-Version: 1.0 Received: by 10.102.174.3 with SMTP id w3mr1098251mue.48.1269248601050; Mon, 22 Mar 2010 02:03:21 -0700 (PDT) In-Reply-To: References: <4BA50BA1.5060401@incunabulum.net> Date: Mon, 22 Mar 2010 12:03:21 +0300 Message-ID: From: Alexander Bubnov To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: why zero-copy sockets(9) are not popular? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 09:03:22 -0000 Hi, everybody! I have found some Intel NICs which supports "header splitting". Does FreeBSD support them for zero-copy receive? One more question please... is there a way to determine whether or not zero-copy receive is working, for example by kernel log or something else? Thank you in advance. 2010/3/21 Alexander Bubnov > Bruce, many thanks for comprehensive answer! > > 2010/3/20 Bruce Simpson > > 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@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >> > > > > -- > /BR, Alexander > -- /BR, Alexander