Bug 24959

Summary: [patch] proper TCP_NOPUSH/TCP_CORK compatibility
Product: Base System Reporter: Tony Finch <dot>
Component: kernAssignee: freebsd-net (Nobody) <net>
Status: Closed Feedback Timeout    
Severity: Affects Only Me CC: hiren
Priority: Normal    
Version: 4.2-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
file.diff none

Description Tony Finch 2001-02-08 22:30:01 UTC
Jonathan Lemon recently committed a fix to the implementation of
TCP_NOPUSH that expedites the output of the last packet in a sequence
(rev. 1.53 of tcp_usrreq.c). However there are a number of problems
with that commit, as follows:

  * the change hsan't been documented

  * although the new functionality is similar to Linux's
    TCP_CORK, the Linuxulator hasn't been updated to implement
    that support.

  * TCP_NOPUSH has additional T/TCP-related semantics that may be
    undesirable in an application that only wants the TCP_CORK
    semantics. If the option is set on a listening socket then it
    enables TAO.

This patch introduces a new TCP option called TCP_CORK which is
intended to be exactly the same as the Linux version. The old
tcp_output part of the TCP_NOPUSH functionality is renamed to use
TCP_CORK. TCP_NOPUSH is now implemented as a superset of TCP_CORK
that also includes the T/TCP functionality in tcp_input.

I've included two patches below, one against -STABLE and one against
-CURRENT. They're the same apart from the change in tcp_usrreq.c in
-CURRENT.

Fix: --------------------------------------------------------------------------------
This patch is against RELENG_4

--------------------------------------------------------------------------------
This patch is against HEAD
Comment 1 Garrett A. Wollman 2001-02-09 01:27:10 UTC
<<On Thu, 08 Feb 2001 22:27:25 +0000, Tony Finch <dot@dotat.at> said:

>   * TCP_NOPUSH has additional T/TCP-related semantics that may be
>     undesirable in an application that only wants the TCP_CORK
>     semantics. If the option is set on a listening socket then it
>     enables TAO.

I don't believe this is material, since Transaction TCP is disabled by
default.  

Furthermore, I would prefer to avoid introducing such a poorly-named
option.

-GAWollman
Comment 2 Tony Finch 2001-02-09 01:35:01 UTC
Garrett Wollman <wollman@khavrinen.lcs.mit.edu> wrote:
><<On Thu, 08 Feb 2001 22:27:25 +0000, Tony Finch <dot@dotat.at> said:
>
>>   * TCP_NOPUSH has additional T/TCP-related semantics that may be
>>     undesirable in an application that only wants the TCP_CORK
>>     semantics. If the option is set on a listening socket then it
>>     enables TAO.
>
>I don't believe this is material, since Transaction TCP is disabled by
>default.  

I still think it's a bad idea to mix the two features together like
this: applications should be able to get predictably non-T/TCP
behaviour if they so choose.

How about keeping the TCP_NOPUSH part of the functionality under that
name and making a TCP_ALLOWTAO option for the listen-side functionality?

Tony.
-- 
f.a.n.finch    fanf@covalent.net    dot@dotat.at
DOGGER FISHER GERMAN BIGHT HUMBER THAMES: NORTHERLY 4 OR 5, OCCASIONALLY 6 AT
FIRST IN GERMAN BIGHT HUMBER AND THAMES, BECOMING VARIABLE 3. WINTRY SHOWERS.
GOOD.
Comment 3 Garrett A. Wollman 2001-02-09 02:13:11 UTC
<<On Fri, 9 Feb 2001 01:35:01 +0000, Tony Finch <dot@dotat.at> said:

> I still think it's a bad idea to mix the two features together like
> this: applications should be able to get predictably non-T/TCP
> behaviour if they so choose.

I'm still puzzled as to what difference you think this makes to an
application.

-GAWollman
Comment 4 Tony Finch 2001-02-09 02:22:49 UTC
Garrett Wollman <wollman@khavrinen.lcs.mit.edu> wrote:
><<On Fri, 9 Feb 2001 01:35:01 +0000, Tony Finch <dot@dotat.at> said:
>
>> I still think it's a bad idea to mix the two features together like
>> this: applications should be able to get predictably non-T/TCP
>> behaviour if they so choose.
>
>I'm still puzzled as to what difference you think this makes to an
>application.

According to the CVS log the reason the test for TF_NOPUSH was added
to tcp_listen was so that applications would disallow T/TCP
connections by default even if net.inet.tcp.rfc1644 is turned on. Only
applications explicitly coded to accept T/TCP connections would do so.
I guess this is because T/TCP has a bad reputation. So if servers
start turning on TCP_NOPUSH for performance reasons then they also as
a side effect start accepting T/TCP TAO connections, which some people
would consider to be a bug.

Tony.
-- 
f.a.n.finch    fanf@covalent.net    dot@dotat.at
NORTH UTSIRE SOUTH UTSIRE FORTIES: NORTHWEST BACKING SOUTH OR SOUTHWEST 4 OR
5, DECREASING 3 FOR A TIME. SNOW SHOWERS. MAINLY GOOD.
Comment 5 Jesper Skriver freebsd_committer freebsd_triage 2001-05-28 22:49:06 UTC
Responsible Changed
From-To: freebsd-bugs->jesper

will work on this
Comment 6 Bruce M Simpson freebsd_committer freebsd_triage 2004-06-22 16:48:52 UTC
Responsible Changed
From-To: jesper->freebsd-net

Throw this one open to the -net list
Comment 7 Andre Oppermann freebsd_committer freebsd_triage 2004-12-06 11:35:38 UTC
Responsible Changed
From-To: freebsd-net->andre

Take over.
Comment 8 K. Macy freebsd_committer freebsd_triage 2007-11-16 08:47:15 UTC
State Changed
From-To: open->feedback


Is this change still needed? Or has the application issue been addressed in some other way? 


Comment 9 K. Macy freebsd_committer freebsd_triage 2007-11-16 08:47:15 UTC
Responsible Changed
From-To: andre->kmacy


Is this change still needed? Or has the application issue been addressed in some other way?
Comment 10 Gavin Atkinson freebsd_committer freebsd_triage 2011-05-29 23:21:34 UTC
Responsible Changed
From-To: kmacy->freebsd-net

kmacy has asked for all of his PRs to be reassigned back to the pool. 

To submitter: feedback on this was requested.  If you did provide feedback 
then it doesn't appear to have made it into the PR trail - could you please 
resend it?
Comment 11 Hiren Panchasara freebsd_committer freebsd_triage 2016-12-27 19:17:39 UTC
Please reopen if needed.