Re: tux as ftp server question

Ingo Molnar <[email protected]>
Newsgroups gmane.network.tux
Message-ID <[email protected]>
On Tue, 2 Apr 2002, zhang li wrote:

> Tux reference says tux as FTP server is implemented
> totally in kernel(a C module of 900 lines). So I am
> wondering what's the use of zero-copy in it. It seems
> there is no copy between user-space and kernel-space
> at all, right?

correct. For sending files, TUX/FTP uses zero-copy, just
like TUX/HTTP does.

in fact TUX/FTP and TUX/HTTP share much code, it's mostly
the protocol decoding that needs to go into proto_ftp.c
and proto_http.c. Eg. the 'send file' logic is shared as
well.

> Even if we consider ftp server reads data from a file
> on the disk(when ftp client announce "get" command),
> the data will be put in kernel buffer directly after
> being read, right? So what's the use of zero-copy in
> Tux ftp server?

if the file is already cached (it's a frequently accessed
file) then TUX will send the file contents to the network
without doing any copying.

when reading the file contents into RAM from disk, then
TUX [well, the Linux kernel] will DMA it from disk into
RAM straight, without the CPU having to copy the data.

	Ingo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.