[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL+tcoDuogZy76ZtBQmdC5nD=Dbk9Om31s8-jekfUeNum04o1g@mail.gmail.com>
Date: Tue, 22 Oct 2024 17:13:41 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
dsahern@...nel.org, ncardwell@...gle.com, netdev@...r.kernel.org,
Jason Xing <kernelxing@...cent.com>
Subject: Re: [PATCH net-next v2 2/2] tcp: add more warn of socket in tcp_send_loss_probe()
On Tue, Oct 22, 2024 at 4:00 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Mon, Oct 21, 2024 at 5:53 PM Jason Xing <kerneljasonxing@...il.com> wrote:
> >
> > From: Jason Xing <kernelxing@...cent.com>
> >
> > Add two fields to print in the helper which here covers tcp_send_loss_probe().
> >
> > Link: https://lore.kernel.org/all/5632e043-bdba-4d75-bc7e-bf58014492fd@redhat.com/
> > Suggested-by: Paolo Abeni <pabeni@...hat.com>
> > Signed-off-by: Jason Xing <kernelxing@...cent.com>
> > Cc: Neal Cardwell <ncardwell@...gle.com>
> > --
> > v2
> > Link:https://lore.kernel.org/all/CAL+tcoAr7RHhaZGV12wYDcPPPaubAqdxMCmy7Jujtr8b3+bY=w@mail.gmail.com/
> > 1. use "" instead of NULL in tcp_send_loss_probe()
> > ---
> > include/net/tcp.h | 4 +++-
> > net/ipv4/tcp_output.c | 4 +---
> > 2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/include/net/tcp.h b/include/net/tcp.h
> > index 8b8d94bb1746..78158169e944 100644
> > --- a/include/net/tcp.h
> > +++ b/include/net/tcp.h
> > @@ -2433,12 +2433,14 @@ 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",
> > + "%scwn:%u out:%u sacked:%u lost:%u retrans:%u tlp_high_seq:%u sk_state:%u ca_state:%u mss:%u advmss:%u mss_cache:%u pmtu:%u\n",
> > str,
> > + tcp_snd_cwnd(tcp_sk(sk)),
> > 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_current_mss((struct sock *)sk),
>
> You can not promote to non const, because tcp_current_mss() might
> change socket state.
>
> If a debug helper changes the socket state, then it is no longer a debug helper.
It does make sense. Thanks.
>
> > tcp_sk(sk)->advmss, tcp_sk(sk)->mss_cache,
>
> This was already reported btw.
So I'm going to remove this tcp_current_mss() line.
Thanks,
Jason
Powered by blists - more mailing lists