tcp: allow splice() to build full TSO packets
tcp: allow splice() to build full TSO packets

vmsplice()/splice(pipe, socket) call do_tcp_sendpages() one page at a
time, adding at most 4096 bytes to an skb. (assuming PAGE_SIZE=4096)

The call to tcp_push() at the end of do_tcp_sendpages() forces an
immediate xmit when pipe is not already filled, and tso_fragment() try
to split these skb to MSS multiples.

4096 bytes are usually split in a skb with 2 MSS, and a remaining
sub-mss skb (assuming MTU=1500)

This makes slow start suboptimal because many small frames are sent to
qdisc/driver layers instead of big ones (constrained by cwnd and packets
in flight of course)

In fact, applications using sendmsg() (adding an additional memory copy)
instead of vmsplice()/splice()/sendfile() are a bit faster because of
this anomaly, especially if serving small files in environments with
large initial [c]wnd.

Call tcp_push() only if MSG_MORE is not set in the flags parameter.

This bit is automatically provided by splice() internals but for the
last page, or on all pages if user specified SPLICE_F_MORE splice()
flag.

In some workloads, this can reduce number of sent logical packets by an
order of magnitude, making zero-copy TCP actually faster than
one-copy :)

Reported-by: Tom Herbert <0786393240831fc3b5d6ed63658cfb1f3b1e6c40@google.com>
Cc: Nandita Dukkipati <c885339f99dffe2a5f7eb16e264b2978fb0befe2@google.com>
Cc: Neal Cardwell <58d301c70203188c35d379474c26c9cc0636a189@google.com>
Cc: Tom Herbert <0786393240831fc3b5d6ed63658cfb1f3b1e6c40@google.com>
Cc: Yuchung Cheng <5b5a0a360fa35167ac197fe6359c229fde284cf2@google.com>
Cc: H.K. Jerry Chu <029109f918fd79983f4074d68beabccb17fb66a9@google.com>
Cc: Maciej Żenczykowski <bcc4d4f0381c74919db335641dc13b085bf1d0fd@google.com>
Cc: Mahesh Bandewar <e1eb0c20b48013d29bfb9c87ceffd3fac35d1e96@google.com>
Cc: Ilpo Järvinen <5801dcaebe162b451612454667e6a167cf0222c1@helsinki.fi>
Signed-off-by: Eric Dumazet <a0baddf32b28d2f9429941ed4af2fe636e210591@gmail>com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas