From owner-cvs-src@FreeBSD.ORG Mon Dec 5 09:53:56 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 69CE316A41F; Mon, 5 Dec 2005 09:53:56 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 955B443D78; Mon, 5 Dec 2005 09:53:53 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id A092946B91; Mon, 5 Dec 2005 04:53:51 -0500 (EST) Date: Mon, 5 Dec 2005 09:53:51 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Mike Silbersack In-Reply-To: <20051204233215.G43418@odysseus.silby.com> Message-ID: <20051205094734.P45634@fledge.watson.org> References: <200511281809.jASI93Rl006494@repoman.freebsd.org> <20051204233215.G43418@odysseus.silby.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern uipc_socket.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2005 09:53:56 -0000 On Sun, 4 Dec 2005, Mike Silbersack wrote: > On Mon, 28 Nov 2005, Robert Watson wrote: > >> Break out functionality in sosend() responsible for building mbuf >> chains and copying in mbufs from the body of the send logic, creating >> a new function sosend_copyin(). This changes makes sosend() almost >> readable, and will allow the same logic to be used by tailored socket >> send routines. > > Now for a followup, you can merge this with m_uiotombuf. :) > > Back when I wrote m_uiotombuf, I had intended to put it inside sosend, I > just didn't want to deal with the complexity of the zero copy sockets. Due to the risk of error and combining changes, I decided I'd break out sosend changes into several steps: (1) Break out copyin logic so that the code is no longer nearly as nested, and basically reads the same regardless of whether a uio or an mbuf chain is passed in. (2) Create sosend_dgram(), a reduced socket send routine for atomic datagram sockets, which is able to avoid a lot of work due to not having the additional work loop, avoiding some work with the send socket buffer, and so on. (3) Enhance m_uiotombuf() so that it can either be trivially wrapped by sosend_copyin(), or replace it. At the very least, this means adding zero-copy support to m_uiotombuf(), but I've not looked at this much. Of these, (1) is now committed and shaking out, and I have (2) in perforce waiting for (1) to settle. I hope to look at (3) once (2) is merged, but want to let (1) settle a bit longer. The sosend() logic is sufficiently convoluted that errors are easy to make. The new code is much better, but the extraction process for the copyin code was fairly painful and another mistake in there wouldn't surprise me. Robert N M Watson