@@ -2430,6 +2430,19 @@ void tcp_plb_update_state(const struct sock *sk, struct tcp_plb_state *plb,
2430
2430
void tcp_plb_check_rehash (struct sock * sk , struct tcp_plb_state * plb );
2431
2431
void tcp_plb_update_state_upon_rto (struct sock * sk , struct tcp_plb_state * plb );
2432
2432
2433
+ static inline void tcp_warn_once (const struct sock * sk , bool cond , const char * str )
2434
+ {
2435
+ WARN_ONCE (cond ,
2436
+ "%sout:%u sacked:%u lost:%u retrans:%u tlp_high_seq:%u sk_state:%u ca_state:%u advmss:%u mss_cache:%u pmtu:%u\n" ,
2437
+ str ,
2438
+ tcp_sk (sk )-> packets_out , tcp_sk (sk )-> sacked_out ,
2439
+ tcp_sk (sk )-> lost_out , tcp_sk (sk )-> retrans_out ,
2440
+ tcp_sk (sk )-> tlp_high_seq , sk -> sk_state ,
2441
+ inet_csk (sk )-> icsk_ca_state ,
2442
+ tcp_sk (sk )-> advmss , tcp_sk (sk )-> mss_cache ,
2443
+ inet_csk (sk )-> icsk_pmtu_cookie );
2444
+ }
2445
+
2433
2446
/* At how many usecs into the future should the RTO fire? */
2434
2447
static inline s64 tcp_rto_delta_us (const struct sock * sk )
2435
2448
{
@@ -2441,17 +2454,7 @@ static inline s64 tcp_rto_delta_us(const struct sock *sk)
2441
2454
2442
2455
return rto_time_stamp_us - tcp_sk (sk )-> tcp_mstamp ;
2443
2456
} else {
2444
- WARN_ONCE (1 ,
2445
- "rtx queue empty: "
2446
- "out:%u sacked:%u lost:%u retrans:%u "
2447
- "tlp_high_seq:%u sk_state:%u ca_state:%u "
2448
- "advmss:%u mss_cache:%u pmtu:%u\n" ,
2449
- tcp_sk (sk )-> packets_out , tcp_sk (sk )-> sacked_out ,
2450
- tcp_sk (sk )-> lost_out , tcp_sk (sk )-> retrans_out ,
2451
- tcp_sk (sk )-> tlp_high_seq , sk -> sk_state ,
2452
- inet_csk (sk )-> icsk_ca_state ,
2453
- tcp_sk (sk )-> advmss , tcp_sk (sk )-> mss_cache ,
2454
- inet_csk (sk )-> icsk_pmtu_cookie );
2457
+ tcp_warn_once (sk , 1 , "rtx queue empty: " );
2455
2458
return jiffies_to_usecs (rto );
2456
2459
}
2457
2460
0 commit comments