Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Nov 2000 17:23:31 -0800
From:      David Greenman <dg@root.com>
To:        Jin Guojun (DSD staff) <jin@george.lbl.gov>
Cc:        bmilekic@dsuper.net, hackers@FreeBSD.ORG
Subject:   Re: sendfile for raw disk (was: zero copy TCP) 
Message-ID:  <200011190123.RAA06983@implode.root.com>
In-Reply-To: Your message of "Sat, 18 Nov 2000 16:31:11 PST." <200011190031.eAJ0VBo29408@portnoy.lbl.gov> 

next in thread | previous in thread | raw e-mail | index | archive | help
>> > Both, but I may do either way, depending on which way is easier.
>> > If we can directly DMA from a disk drive to a NIC, that will be great.
>> > If the current implementation requires preloaded buffer, that works.
>> > So, where can I look for the patch?
>> > 
>> 
>>         Please see sendfile(2).
>
>It seems that sendfile(2) can read only a regular file. I wiould like to
>modify it to send a raw disk block.
>Before going for it, I would like to know what was the reason for not doing
>this, and what may be the issus for doing this?

   The main issue is that sendfile() is very much VM-system centric in the
way that it implements zero-copy sends. In order for raw devices to work, you
would need to have a raw device vm_object to hold the pages. The problem with
this is that it creates cache coherency problems with any cached file data.

-DG

David Greenman
Co-founder, The FreeBSD Project - http://www.freebsd.org
President, TeraSolutions, Inc. - http://www.terasolutions.com
Pave the road of life with opportunities.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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