From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 11 19:11:54 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F91AC1A; Mon, 11 Aug 2014 19:11:54 +0000 (UTC) Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [IPv6:2607:f8b0:400e:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54FBF25DF; Mon, 11 Aug 2014 19:11:54 +0000 (UTC) Received: by mail-pa0-f42.google.com with SMTP id lf10so11661478pab.1 for ; Mon, 11 Aug 2014 12:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=K9Deh/BJOzWHt/lejmly+350EqYV3dFNq9eHOgdQ9p0=; b=kNNtI5e4jxyjJzAoK162ML6AapY+hma5T53YZ9xozJ7gCV9IfQC+XscEEoZOgPB4CW kX9RhzvViEREbncaE1adlaf3mak5OBz83bWrbicimnOt8V8eG9EigaE6zy7+6G3R3yO/ LYKdNUkpN8CfhIQiG4FnRHQ00Bm/WMw1oPuBJGxLVjyI0NTbuVuYNC1mDtq7Et5wGMj6 9nOv7Rx4lRB+uI5qGUqvUDyG1+7HyF/sRbt6HnmlX4cwi+au2jCOVUuFaUkncA6ORC/l aqplVjg/urw2sUDUC/9drwho630NITxJfU44FYOmIHoGMmSaHBtiBZuY7jKnCE41npEB joKw== X-Received: by 10.68.164.4 with SMTP id ym4mr43778434pbb.53.1407784313998; Mon, 11 Aug 2014 12:11:53 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id qt2sm12198434pbb.29.2014.08.11.12.11.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Aug 2014 12:11:53 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <53E91578.3060209@FreeBSD.org> Date: Mon, 11 Aug 2014 12:11:52 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: alc@freebsd.org, Adrian Chadd Subject: Re: Support for zero copy sockets References: <1407171616.44440.YahooMailBasic@web181702.mail.ne1.yahoo.com> <20140811082610.GF7828@equilibrium.bsdes.net> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: Victor Balada Diaz , Sushanth Rai , "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2014 19:11:54 -0000 There is zero copy receive (aka Direct Data Placement -- DDP) in the TOE driver that accompanies cxgbe(4). I have a tx zero copy implementation for it as well (this is not in -current right now). But all this code is chip specific and applies only to TCP connections that are handled by the TOE driver. It doesn't rely on COW or page flipping. The reason I'm mentioning all of this here is that if anyone is thinking of working on proper zero copy awareness (and APIs) at the socket layer then count me in as an interested party. Regards, Navdeep On 08/11/14 11:34, Alan Cox wrote: > The send path used an ad hoc copy-on-write mechanism, i.e., it was not the > mechanism used by fork, etc. This mechanism was broken (and as I'll argue > in a few sentences not worth fixing). The receive path used page flipping > and required support from the NIC. Neither copy-on-write nor page flipping > are viable approaches on today's multicore machines because their > implementation entails interprocessor TLB shootdowns. Let them rest in > peace. > > > > > On Mon, Aug 11, 2014 at 1:04 PM, Adrian Chadd wrote: > >> On 11 August 2014 01:26, Victor Balada Diaz wrote: >>> On Mon, Aug 04, 2014 at 10:00:16AM -0700, Sushanth Rai via >> freebsd-hackers wrote: >>>> Hello, >>>> >>>> FreeBSD 10 release sources doesn't seem to have zero copy socket code >> anymore. What's is alternative to do zero_copy ? >>>> >>>> Thanks, >>>> Sushanth >>> >>> You need to use sendfile(2). In the man page is stated that the >> implementation in FreeBSD >>> is zero copy. >>> >>> You can also check: >>> >>> http://svnweb.freebsd.org/base?view=revision&revision=255608 >>> >> >> I'd like to reintroduce a zero copy socket IO method for at least >> write that doesn't rely on sendfile. >> >> The zero-copy socket page flipping thing was interesting because IIRC >> tried to work for both sending and receiving socket data. Doing that >> via an API would be nicer. >> >> So, if people have an idea for how it could be done / what the API >> looks like then I'm all ears. >> >> >> >> -a >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >> > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >