Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Oct 2012 14:06:55 -0700
From:      Navdeep Parhar <np@FreeBSD.org>
To:        Andre Oppermann <andre@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r241703 - head/sys/kern
Message-ID:  <50806F6F.60109@FreeBSD.org>
In-Reply-To: <50806A10.4070703@freebsd.org>
References:  <201210182022.q9IKMHFa016360@svn.freebsd.org> <50806A10.4070703@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50806F6F.60109>