Skip to content

Commit 668d663

Browse files
JasonXingdavem330
authored andcommitted
tcp: add more warn of socket in tcp_send_loss_probe()
Add two fields to print in the helper which here covers tcp_send_loss_probe(). Link: https://lore.kernel.org/all/[email protected]/ Suggested-by: Paolo Abeni <[email protected]> Signed-off-by: Jason Xing <[email protected]> Cc: Neal Cardwell <[email protected]> Reviewed-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 386c2b8 commit 668d663

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

include/net/tcp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2433,8 +2433,9 @@ void tcp_plb_update_state_upon_rto(struct sock *sk, struct tcp_plb_state *plb);
24332433
static inline void tcp_warn_once(const struct sock *sk, bool cond, const char *str)
24342434
{
24352435
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",
2436+
"%scwn:%u out:%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",
24372437
str,
2438+
tcp_snd_cwnd(tcp_sk(sk)),
24382439
tcp_sk(sk)->packets_out, tcp_sk(sk)->sacked_out,
24392440
tcp_sk(sk)->lost_out, tcp_sk(sk)->retrans_out,
24402441
tcp_sk(sk)->tlp_high_seq, sk->sk_state,

net/ipv4/tcp_output.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2954,9 +2954,7 @@ void tcp_send_loss_probe(struct sock *sk)
29542954
}
29552955
skb = skb_rb_last(&sk->tcp_rtx_queue);
29562956
if (unlikely(!skb)) {
2957-
WARN_ONCE(tp->packets_out,
2958-
"invalid inflight: %u state %u cwnd %u mss %d\n",
2959-
tp->packets_out, sk->sk_state, tcp_snd_cwnd(tp), mss);
2957+
tcp_warn_once(sk, tp->packets_out, "invalid inflight: ");
29602958
smp_store_release(&inet_csk(sk)->icsk_pending, 0);
29612959
return;
29622960
}

0 commit comments

Comments
 (0)