Eric Dumazet 355a901e6c tcp: make connect() mem charging friendly
While working on sk_forward_alloc problems reported by Denys
Fedoryshchenko, we found that tcp connect() (and fastopen) do not call
sk_wmem_schedule() for SYN packet (and/or SYN/DATA packet), so
sk_forward_alloc is negative while connect is in progress.

We can fix this by calling regular sk_stream_alloc_skb() both for the
SYN packet (in tcp_connect()) and the syn_data packet in
tcp_send_syn_data()

Then, tcp_send_syn_data() can avoid copying syn_data as we simply
can manipulate syn_data->cb[] to remove SYN flag (and increment seq)

Instead of open coding memcpy_fromiovecend(), simply use this helper.

This leaves in socket write queue clean fast clone skbs.

This was tested against our fastopen packetdrill tests.

Reported-by: Denys Fedoryshchenko <nuclearcat@nuclearcat.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-11-19 14:57:01 -05:00
..
2014-11-05 23:52:33 -08:00
2014-09-18 10:54:36 +02:00
2014-11-06 15:11:10 -05:00
2013-12-29 16:34:25 -05:00
2013-10-08 23:19:24 -04:00
2014-05-12 14:03:41 -04:00
2014-02-19 11:41:25 +01:00
2014-09-01 18:12:45 -07:00
2014-11-04 15:09:52 -05:00
2014-09-01 18:12:45 -07:00
2014-09-01 18:12:45 -07:00
2014-09-01 18:12:45 -07:00
2014-09-01 18:12:45 -07:00
2014-09-01 18:12:45 -07:00
2014-09-01 18:12:45 -07:00
2014-11-11 13:00:06 -05:00
2014-11-05 23:52:33 -08:00
2014-09-01 18:12:45 -07:00
2014-09-01 18:12:45 -07:00
2014-09-01 18:12:45 -07:00
2014-09-01 18:12:45 -07:00
2014-09-01 18:12:45 -07:00
2012-03-11 23:42:51 -07:00
2014-11-05 23:52:33 -08:00
2014-05-23 16:28:53 -04:00
2013-05-31 17:19:05 -07:00