From owner-freebsd-net@FreeBSD.ORG Wed Mar 17 16:46:37 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 D2EAF106566B for ; Wed, 17 Mar 2010 16:46:37 +0000 (UTC) (envelope-from vasily.kirin@gmail.com) Received: from mail-fx0-f224.google.com (mail-fx0-f224.google.com [209.85.220.224]) by mx1.freebsd.org (Postfix) with ESMTP id 69B578FC1E for ; Wed, 17 Mar 2010 16:46:37 +0000 (UTC) Received: by fxm24 with SMTP id 24so718353fxm.3 for ; Wed, 17 Mar 2010 09:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=Fcg5HuKVsZ8IVqIVlCliArP3gzOE4zJmQwU6RdcZ9LY=; b=Xo7TqYhqoJn5pmWfZuZan1MO+2GwrK6TmEmd3oLbUAEH4P3PMx6MFDMy0toGRixK1Y j0AUUS5QJg6xnJXRm9qomT9VzNhIT1JfIr0GnaXA96K86gW6wgE4S+G6Fdz8//B9k/OJ Ly3dI8rfYyLmMly58QU3V/dIx9Laxww1debLM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=tsoX9LBGOJ4QXJs4/MOLnXnUBUP1loFAx1Y3mFCXCKdF6DzzGP4GkotWFPWDoLNYlg rnQHIUmVvLVfUVf1vwzFkUavGF/+6VTeZtLzb0jfIWl+KHKxJCNYeWu2OeLbJ+LCdA2b vU2Yz0Sd3832SrTHm9hGyEL1axhwgQzK1ui0k= MIME-Version: 1.0 Received: by 10.223.2.198 with SMTP id 6mr2294565fak.100.1268842811837; Wed, 17 Mar 2010 09:20:11 -0700 (PDT) Date: Wed, 17 Mar 2010 19:20:11 +0300 Message-ID: From: Vasily Kirin To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: zero copy HTTP server 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: Wed, 17 Mar 2010 16:46:38 -0000 Hi. As I can read here: http://www.freebsd.org/cgi/man.cgi?query=zero_copy&apropos=0&sektion=0&manpath=FreeBSD+8.0-RELEASE&format=html(man 9 zero_copy) FreeBSD can deliver received TCP data from the kernel to userspace without any copy ("DMAed from the NIC to a buffer that will then be given to the user" - from `man 9 zero_copy`) Further, TCP content cannot be copied to continuous buffer without NIC with "header splitting" feature. (Achieving page aligned payloads requires a NIC that can split an incoming packet into multiple buffers. It also generally requires some sort of intelligence on the NIC to make sure that the payload starts in its own buffer. This is called ``header splitting``''. - from `man 9 zero_copy`) I've found several Intel cards with this feature, but still can't find any example or using this technique. Is there any example or comprehensive manual of receiving TCP stream in continuous buffer and passing this buffer to userspace without copy? Best Regards, Vasily