Neal Cardwell 5b35e1e6e9 tcp: fix tcp_trim_head() to adjust segment count with skb MSS
This commit fixes tcp_trim_head() to recalculate the number of
segments in the skb with the skb's existing MSS, so trimming the head
causes the skb segment count to be monotonically non-increasing - it
should stay the same or go down, but not increase.

Previously tcp_trim_head() used the current MSS of the connection. But
if there was a decrease in MSS between original transmission and ACK
(e.g. due to PMTUD), this could cause tcp_trim_head() to
counter-intuitively increase the segment count when trimming bytes off
the head of an skb. This violated assumptions in tcp_tso_acked() that
tcp_trim_head() only decreases the packet count, so that packets_acked
in tcp_tso_acked() could underflow, leading tcp_clean_rtx_queue() to
pass u32 pkts_acked values as large as 0xffffffff to
ca_ops->pkts_acked().

As an aside, if tcp_trim_head() had really wanted the skb to reflect
the current MSS, it should have called tcp_set_skb_tso_segs()
unconditionally, since a decrease in MSS would mean that a
single-packet skb should now be sliced into multiple segments.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Nandita Dukkipati <nanditad@google.com>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-30 12:42:58 -05:00
..
2011-12-12 19:04:11 -05:00
2011-11-12 18:13:32 -05:00
2011-12-28 15:06:58 -05:00
2011-04-22 11:04:14 -07:00
2011-10-13 16:05:07 -04:00
2011-10-19 03:10:46 -04:00
2012-01-26 16:34:08 -05:00
2011-12-11 18:25:16 -05:00
2012-01-17 10:31:12 -05:00
2011-12-12 19:04:10 -05:00
2012-01-17 10:31:12 -05:00
2012-01-20 14:17:26 -05:00
2012-01-20 14:17:26 -05:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-12-11 18:25:16 -05:00
2012-01-17 10:31:12 -05:00
2011-12-09 14:14:08 -05:00
2010-07-12 12:57:54 -07:00