tcp: simplify tcp_mark_skb_lost
authorYuchung Cheng <ycheng@google.com>
Fri, 25 Sep 2020 17:04:30 +0000 (10:04 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 26 Sep 2020 00:17:14 +0000 (17:17 -0700)
commit686989700cabc444f25c1f1eb022aca8f2fc14b2
tree582acbcd45b06e696d8fa11d71df13a09add4246
parentfd2146741c98569c8b4dc41b8ccae597150b122c
tcp: simplify tcp_mark_skb_lost

This patch consolidates and simplifes the loss marking logic used
by a few loss detections (RACK, RFC6675, NewReno). Previously
each detection uses a subset of several intertwined subroutines.
This unncessary complexity has led to bugs (and fixes of bug fixes).

tcp_mark_skb_lost now is the single one routine to mark a packet loss
when a loss detection caller deems an skb ist lost:

   1. rewind tp->retransmit_hint_skb if skb has lower sequence or
      all lost ones have been retransmitted.

   2. book-keeping: adjust flags and counts depending on if skb was
      retransmitted or not.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_input.c