From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: ncardwell@google.com, netdev@vger.kernel.org,
therbert@google.com, maze@google.com, ilpo.jarvinen@helsinki.fi
Subject: Re: [PATCH net-next] tcp: introduce tcp_try_coalesce
Date: Tue, 24 Apr 2012 04:59:32 +0200 [thread overview]
Message-ID: <1335236372.5205.106.camel@edumazet-glaptop> (raw)
In-Reply-To: <20120423.224602.594997774992725103.davem@davemloft.net>
On Mon, 2012-04-23 at 22:46 -0400, David Miller wrote:
> Applied, thanks Eric.
>
> Although I'd like to ask you to clean up tcp_try_coalesce() a bit.
>
> It effectively returns a boolean, but you've clouded this up by
> returning an int and defining it in the comment to return "> 0" or
> not.
>
> Just make it return a real bool.
>
> I know why you did this, it makes the "eaten" code somewhat simpler in
> tcp_data_queue(), but overall it's more confusing how it is now.
>
> People look at how the tcp_try_coalesce() return value is interpreted
> and say "in what cases can it return a negative value?" We both know
> it can't, but you have to read the entire function to figure that out.
>
> And that's by definition not intuitive.
>
> Thanks.
Sure I'll do the cleanup. You guessed correctly why I did that ;)
In the beginning I did a "return len;" instead of "return 1;" and felt a
bit uncomfortable in case we merged a zero length message.
Then I added the !th->fin test inside tcp_try_coalesce()
(my initial patch allowed the fin being set for the tcp_data_queue()
case since tcp_fin() was called anyway)
Thanks
next prev parent reply other threads:[~2012-04-24 2:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-23 17:11 [PATCH net-next] tcp: introduce tcp_try_coalesce Eric Dumazet
2012-04-24 1:13 ` Neal Cardwell
2012-04-24 2:13 ` Eric Dumazet
2012-04-24 2:29 ` Eric Dumazet
2012-04-24 2:39 ` Neal Cardwell
2012-04-24 2:46 ` David Miller
2012-04-24 2:59 ` Eric Dumazet [this message]
2012-04-24 3:34 ` [PATCH net-next] tcp: tcp_try_coalesce returns a boolean Eric Dumazet
2012-04-24 3:37 ` 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=1335236372.5205.106.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=ilpo.jarvinen@helsinki.fi \
--cc=maze@google.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.com \
/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