public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Viral Mehta <Viral.Mehta@lntinfotech.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: zero copy for relay server
Date: Mon, 28 Mar 2011 20:34:17 +0200	[thread overview]
Message-ID: <1301337257.2506.8.camel@edumazet-laptop> (raw)
In-Reply-To: <D69C90565D53114396BF743585AF5A09122E61E9E9@VSHINMSMBX01.vshodc.lntinfotech.com>

Le lundi 28 mars 2011 à 23:48 +0530, Viral Mehta a écrit :

> Still, these are two system calls.

Yes. Is it a problem ? What kind ?

> In addition to this, many things to handle,
> 1. if the incoming_fd is blocking, then it will block till 64K data read. Why so ?

I dont think so. Try it, like read() of recv().

> 2. I believe underlying PIPE that we are using will also have some size limit
>     (like in user space 4K or 64K, not sure)

What kind of socket is able to deliver more than 64K frames ?

> 
> So, all in all
> Why cant we have just one system call which really transfers "length"
> bytes of data form one socket to another ? Recv "length" bytes of data
> from socket A and send to socket B.
> 
> I wanted to understand if there are any limitations or concerns that we still do
> not have any such system call .... ?
> 

The answer is : Once you try to implement this, you'll discover it'll be
splice() based, using pipe as a buffer between the sockets.

sendfile() is based on top of splice(), but it's faster to use splice().




  reply	other threads:[~2011-03-28 18:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28 16:27 zero copy for relay server Viral Mehta
2011-03-28 16:52 ` Eric Dumazet
2011-03-28 18:18   ` Viral Mehta
2011-03-28 18:34     ` Eric Dumazet [this message]
2011-03-29  2:00       ` Changli Gao
2011-03-29  4:23         ` Eric Dumazet
2011-03-29 11:28           ` Changli Gao
2011-03-29 14:13             ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301337257.2506.8.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=Viral.Mehta@lntinfotech.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox