From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: David Miller <davem@davemloft.net>
Cc: johaahn@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH] sendfile() and UDP socket
Date: Mon, 22 Sep 2008 11:04:25 +0400 [thread overview]
Message-ID: <20080922070425.GA14572@2ka.mipt.ru> (raw)
In-Reply-To: <20080921.235444.156373854.davem@davemloft.net>
On Sun, Sep 21, 2008 at 11:54:44PM -0700, David Miller (davem@davemloft.net) wrote:
> > So effectively you are saying, that sendfile() is just a pure send(),
> > but with diferent arguments? I.e. it is not supposed to send the whole
> > data it points to, but as much as possible according to send() standard?
>
> It already makes this, guess what happens when socket error occurs
> midstream during sendfile(), even for TCP?
>
> First, we return length successfully sent.
>
> User has to retry sendfile() call with remaining length, and at this
> point they will immediately get the socket error return value.
>
> This was broken at one point and I remember applying the fix for this
> several years ago :-)
Well, still tcp errors are completely different from udp ones: the
former ony result in a real problem or interrupt/timeout in the simple
case. UDP adds 'it is too big to be transferred' one. And instead of
just send the previous frame and start new one, we return error so that
user could do the same with additional syscall.
> > Well, it may be a right or wrong decision, and in my opinion sendfile()
> > is very diferent than send() since it should require the whole data to
> > be sent, i.e. being like a loop of send()s, but since sendfile() is
> > effectively a very new approach, it could have different behaviour
> > rules.
>
> It is in fact exactly and precisely like send(). It must even give
> the same error return semantics as other socket data transfer calls
> do. See above.
That's the main difference on how you and me look at sendfile().
> The user has to have a resending loop _anyways_, in order to do
> correct error handling.
>
> Nothing is gained from the proposal, really. It can only harm application
> developers into thinking that segmentation over datagram sockets is not
> their responsibility, when it absolutely is.
Which basically means that sendfile() for udp is exactly send() of the
mapped data. And it is not about segmentation, since packets are
correctly segmented with this proposal: packet is rounded to the
submitted page. This is about optimization compared to send() of the
data. You basically draw a line, that with UDP it is impossible to do.
--
Evgeniy Polyakov
next prev parent reply other threads:[~2008-09-22 7:05 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-14 10:25 [PATCH] sendfile() and UDP socket Johann Baudy
2008-09-16 4:17 ` Simon Horman
2008-09-16 4:24 ` Simon Horman
2008-09-16 12:01 ` Hirokazu Takahashi
2008-09-18 17:31 ` Rémi Denis-Courmont
2008-09-19 12:28 ` Hirokazu Takahashi
2008-09-19 13:14 ` Rémi Denis-Courmont
2008-09-21 8:04 ` David Miller
2008-09-22 0:21 ` Evgeniy Polyakov
2008-09-22 0:44 ` David Miller
2008-09-22 1:08 ` Evgeniy Polyakov
2008-09-22 2:07 ` David Miller
2008-09-22 4:19 ` Evgeniy Polyakov
2008-09-22 4:27 ` David Miller
2008-09-22 4:40 ` Evgeniy Polyakov
2008-09-22 5:06 ` David Miller
2008-09-22 5:49 ` Evgeniy Polyakov
2008-09-22 6:54 ` David Miller
2008-09-22 7:04 ` Evgeniy Polyakov [this message]
2008-09-23 4:54 ` Herbert Xu
2008-09-23 6:27 ` Evgeniy Polyakov
2008-09-23 7:01 ` Herbert Xu
2008-09-23 7:07 ` Evgeniy Polyakov
2008-09-24 4:53 ` Bill Fink
[not found] ` <7e0dd21a0810140009k49c8876ax66f744d0a3a4931b@mail.gmail.com>
2008-10-14 7:10 ` Johann Baudy
2008-09-25 13:03 ` Using skb_get() to recycle skbs Ram.Natarajan
2008-09-25 14:28 ` Evgeniy Polyakov
-- strict thread matches above, loose matches on Subject: below --
2008-09-10 12:39 [PATCH] sendfile() and UDP socket Johann Baudy
2008-09-10 20:16 ` David Miller
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=20080922070425.GA14572@2ka.mipt.ru \
--to=johnpol@2ka.mipt.ru \
--cc=davem@davemloft.net \
--cc=johaahn@gmail.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;
as well as URLs for NNTP newsgroup(s).