From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 11 18:04:20 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE36BEDF for ; Mon, 11 Aug 2014 18:04:20 +0000 (UTC) Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com [IPv6:2607:f8b0:400d:c04::231]) (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 8F1FB2BA1 for ; Mon, 11 Aug 2014 18:04:20 +0000 (UTC) Received: by mail-qg0-f49.google.com with SMTP id j107so8720275qga.22 for ; Mon, 11 Aug 2014 11:04:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=RMau9ToBIh0n0TtSs2hnemOGmyZLzLmBLb8EqqTSlWA=; b=AAqfapP+2hgiUMm1TLUlUS4n6LAoIBCsTMHzlrW+DDSlHXMDimtYBLbkDobw/HI/iQ CWrnr8M2fOY4AdPdrPMlH6bYhcyGYzIpG6hlSTndsvo/lv9mv3bAbT9Yrfjy9quD1zHx D6qzUv+FmCIDEXdw1fiAyhYXVuTlYyo3VUPVkHvANZNvb/v+3KL8rN3/ZHmQsN74WyLZ w3AKLF5BDa6BkSO4cEnl2Gv94XBRSWA7u7iibyebr9utQjIDhvQ1Ys/Igq074/noXRQX sNO3bmSgU0L2nw+a3r/apa750GKjhQo9DN/huBVrq+KhWxN3pd25qYpIhWbVgBI4P2dU CKBw== MIME-Version: 1.0 X-Received: by 10.224.71.198 with SMTP id i6mr67911737qaj.76.1407780259662; Mon, 11 Aug 2014 11:04:19 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.41.6 with HTTP; Mon, 11 Aug 2014 11:04:19 -0700 (PDT) In-Reply-To: <20140811082610.GF7828@equilibrium.bsdes.net> References: <1407171616.44440.YahooMailBasic@web181702.mail.ne1.yahoo.com> <20140811082610.GF7828@equilibrium.bsdes.net> Date: Mon, 11 Aug 2014 11:04:19 -0700 X-Google-Sender-Auth: 5rmN6imqkj3SXIM-CGzCPwXmMsQ Message-ID: Subject: Re: Support for zero copy sockets From: Adrian Chadd To: Victor Balada Diaz Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-hackers@freebsd.org" , Sushanth Rai 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 18:04:20 -0000 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