From owner-freebsd-net@FreeBSD.ORG Sun Mar 21 05:21:26 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 BA52C106566B for ; Sun, 21 Mar 2010 05:21:26 +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 4BEC48FC12 for ; Sun, 21 Mar 2010 05:21:26 +0000 (UTC) Received: by fxm1 with SMTP id 1so4721983fxm.13 for ; Sat, 20 Mar 2010 22:21:25 -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:cc:content-type; bh=+cCTsYy6onqwyx3m5vTQZ3xhFAUvtTj1FKdaEcoEFSk=; b=YCuNk27cVJ8FDFv25gR+ca3eZTSdYFCfmggrW91aQLUARVg4MWLPBSt9A9C7KG4xvm oB9lwtMLp9ZRz79eS8DBVkJw+DbQbnesoDE7LjqkEHguzgCIRKtXc3bQHf+0OWCZ5nev UgBmBDcH0CHyoInDCsfigXDBl0YQntk7iYFW4= 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 :cc:content-type; b=sbFjJAHdR137S6rOMXFoK9/Juc2t4/XTCB/bWFJFNyTti7Lb5XeB+AEY6/2m4cqisM xmenKyMYz9tiMjEs9dCaHwWcfiy3jOTPZJiLk4U5tBhP0E/z3TDuKCULAG9cC4IH/IdV oUL5euOpoT+Cv4ahrN+an7WdEqoNrjNPgbufA= MIME-Version: 1.0 Received: by 10.102.164.10 with SMTP id m10mr5849337mue.52.1269148885159; Sat, 20 Mar 2010 22:21:25 -0700 (PDT) In-Reply-To: <4BA50BA1.5060401@incunabulum.net> References: <4BA50BA1.5060401@incunabulum.net> Date: Sun, 21 Mar 2010 08:21:25 +0300 Message-ID: From: Alexander Bubnov To: Bruce Simpson Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-net@freebsd.org 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: Sun, 21 Mar 2010 05:21:26 -0000 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