From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 21:07:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3838E5E3; Thu, 18 Oct 2012 21:07:00 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id E58138FC0A; Thu, 18 Oct 2012 21:06:59 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so9359796pad.13 for ; Thu, 18 Oct 2012 14:06:59 -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=zg2TMwREQXPfreK/8ma6cRbZe6Zah0kwhFBj7qX62SY=; b=ntwSq7rFM9pi4i1Jn1UND1KcaRgA2Qq6N9ITp1kmHjIeNijRkvCNk36m8XM+PHHlub yqjB+2egVSiYtDK6yuzajmX5XkEf/gA9Jd1uEUVwel7RSOvZOim2u3Jh7QV6A5+L0EMM Y/qLzkLtMdqoecSrux7bgRWR8lEW51CUJlcJf8ynM/ebrcGZnKCpEhvGeqnqj+pRxQqA XX/7aCR4SvJ/j0eLR9w4yi+31pnpOzN2UoFbas5Qwz+9WyyKIfNfNqjqlu6BU3Z63auH eRpKVIg3hgj6BKdyOA80SET6S0Ajbdp4+n9hVlpNHQmhtGJIHxpH6YXipyCuOgLxvEVb E+uw== Received: by 10.66.76.231 with SMTP id n7mr62913237paw.68.1350594419385; Thu, 18 Oct 2012 14:06:59 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPS id nm2sm35686pbc.43.2012.10.18.14.06.57 (version=SSLv3 cipher=OTHER); Thu, 18 Oct 2012 14:06:58 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <50806F6F.60109@FreeBSD.org> Date: Thu, 18 Oct 2012 14:06:55 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121012 Thunderbird/16.0.1 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r241703 - head/sys/kern References: <201210182022.q9IKMHFa016360@svn.freebsd.org> <50806A10.4070703@freebsd.org> In-Reply-To: <50806A10.4070703@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 21:07:00 -0000 Hello Andre, A couple of things if you're poking around in this area... On 10/18/12 13:44, Andre Oppermann wrote: > On 18.10.2012 22:22, Andre Oppermann wrote: >> Author: andre >> Date: Thu Oct 18 20:22:17 2012 >> New Revision: 241703 >> URL: http://svn.freebsd.org/changeset/base/241703 >> >> Log: >> Remove double-wrapping of #ifdef ZERO_COPY_SOCKETS within >> zero copy specialized sosend_copyin() helper function. > > Note that I'm not saying zero copy should be used or is even > more performant than the optimized m_uiotombuf() function. Some time back I played around with a modified m_uiotombuf() that was aware of the mbuf_jumbo_16K zone (instead of limiting itself to 4K mbufs). In some cases it performed better than the stock m_uiotombuf. I suspect this change would also help drivers that are unable to deal with long gather lists when doing TSO. But my testing wasn't rigorous enough (I was merely playing around), and the drivers I work with can mostly cope with whatever the kernel throws at them. So nothing came out of it. > Actually there may be some real bit-rot to zero copy sockets. > I've just started looking into it. I have a cxgbe(4)-specific true zero-copy implementation. The rx side is in head, the tx side works only for blocking sockets (the "easy" case) and I haven't checked it in anywhere. Take a look at t4_soreceive_ddp() and m_mbuftouio_ddp() in sys/dev/cxgbe/t4_ddp.c. They're mostly identical to the kernel routines they're based on (read: copy-pasted from). You may find them of some interest if you're working in this area and are thinking of adding zero-copy hooks to the socket implementation. Regards, Navdeep