mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Марк Коренберг" <socketpair@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: splice between non-pipe (tcp socket) fds
Date: Tue, 22 Sep 2009 12:23:11 +0600	[thread overview]
Message-ID: <b8f627e0909212323mbeb0fd1yba25aafb58ef686b@mail.gmail.com> (raw)

I want splice() to work with two tcp sockets().I think to implement
this. Two questions:

1. Is any work in this direction?
2. Why this functionality does not implemented now? any difficulties?

I think API should consist of 2 main functions:
1. detach available buffers from fd1 (and save info in some struct)
2. attach buffers to fd2 (from this struct)
this functions should be called under some lock to guarantee
atomicity. if something happen, return buffers back to original file.

I mean, that, for example, skb_splice_bits should not splice into
pipe..... it should splice skb into list of kernel buffers independent
from the "type" of fd (socket, file, and so on...)


At now, I think that the most quick way to acheive my results,  is to
create intermediate temporary pipe inside kernel and splice from
non-pipe fd to pipe, and than from pipe to second non-pipe fd.

Is this method appropriate, as you think ?

             reply	other threads:[~2009-09-22  6:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-22  6:23 Марк Коренберг [this message]
2009-09-22  6:24 ` Марк Коренберг
2009-09-23  7:33 ` Enrik Berkhan

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=b8f627e0909212323mbeb0fd1yba25aafb58ef686b@mail.gmail.com \
    --to=socketpair@gmail.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®