[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <65575e53-c5b8-47a9-a0e8-034f42211844@kernel.org>
Date: Sun, 20 Oct 2024 10:40:59 -0600
From: David Ahern <dsahern@...nel.org>
To: Jason Xing <kerneljasonxing@...il.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, ncardwell@...gle.com, netdev@...r.kernel.org,
Jason Xing <kernelxing@...cent.com>
Subject: Re: [PATCH net-next 1/2] tcp: add a common helper to debug the
underlying issue
On 10/20/24 10:34 AM, Jason Xing wrote:
> diff --git a/include/net/tcp.h b/include/net/tcp.h
> index 739a9fb83d0c..8b8d94bb1746 100644
> --- a/include/net/tcp.h
> +++ b/include/net/tcp.h
> @@ -2430,6 +2430,19 @@ void tcp_plb_update_state(const struct sock
> *sk, struct tcp_plb_state *plb,
> void tcp_plb_check_rehash(struct sock *sk, struct tcp_plb_state *plb);
> void tcp_plb_update_state_upon_rto(struct sock *sk, struct tcp_plb_state *plb);
>
> +static inline void tcp_warn_once(const struct sock *sk, bool cond,
> const char *str)
> +{
> + WARN_ONCE(cond,
> + "%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",
> + str,
> + tcp_sk(sk)->packets_out, tcp_sk(sk)->sacked_out,
> + tcp_sk(sk)->lost_out, tcp_sk(sk)->retrans_out,
> + tcp_sk(sk)->tlp_high_seq, sk->sk_state,
> + inet_csk(sk)->icsk_ca_state,
> + tcp_sk(sk)->advmss, tcp_sk(sk)->mss_cache,
> + inet_csk(sk)->icsk_pmtu_cookie);
> +}
> +
> That quoted line seems a little long... Do you think this format is
> fine with you? If so, I will adjust it in the next version.
>
Format strings are an exception to the 80-column rule. Strings should
not be split to allow for grep to find a match, for example.
Powered by blists - more mailing lists