tcp: debugging patch to warn if icsk_rto is 0

[ Testing fix for the patch series in b/308472523 / b/308151197
  Any code path that sets an RTO of 0 jiffies runs a risk of
  busy-looping for long periods, which would match the symptoms of the
  traces in b/308472523 ... ]

Google-Bug-Id: 308151197
Change-Id: I690c52efefe96fd2dba1fa22c08f588b46e97c79
Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/61181
Reviewed-by: Brian Vazquez <brianvv@google.com>
Tested-by: Brian Vazquez <brianvv@google.com>
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 74ac7b3..055d004 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -954,6 +954,9 @@ static void tcp_set_rto(struct sock *sk)
 	 *    ACKs in some circumstances.
 	 */
 	inet_csk(sk)->icsk_rto = __tcp_set_rto(tp);
+	WARN_ONCE(inet_csk(sk)->icsk_rto == 0,
+		  "icsk_rto is 0; srtt_us=%u rttvar_us=%u min_rto_us=%u",
+		  tp->srtt_us, tp->rttvar_us, tcp_rto_min_us(sk));
 
 	/* 2. Fixups made earlier cannot be right.
 	 *    If we do not estimate RTO correctly without them,