[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 24 Apr 2012 04:59:32 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: ncardwell@...gle.com, netdev@...r.kernel.org, therbert@...gle.com,
maze@...gle.com, ilpo.jarvinen@...sinki.fi
Subject: Re: [PATCH net-next] tcp: introduce tcp_try_coalesce
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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists