From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: David Miller <davem@davemloft.net>,
Song Liu <songliubraving@fb.com>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
yoshfuji@linux-ipv6.org, Steven Rostedt <rostedt@goodmis.org>,
Brendan Gregg <bgregg@netflix.com>,
netdev@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint
Date: Fri, 8 Dec 2017 09:03:56 -0200 [thread overview]
Message-ID: <20171208110356.GS13341@localhost.localdomain> (raw)
In-Reply-To: <CALOAHbBbo+ueVt7Wu=wAvgrfFjg7LVHfo4W_hhv_d7pQzeY9+Q@mail.gmail.com>
On Fri, Dec 08, 2017 at 11:40:23AM +0800, Yafang Shao wrote:
> It will looks like these,
>
> if (sk->sk_protocol == IPPROTO_TCP)
> __tcp_set_state(newsk, TCP_SYN_RECV);
> else
> newsk->sk_state = TCP_SYN_RECV;
>
>
> if (sk->sk_protocol == IPPROTO_TCP)
> __tcp_set_state(sk, TCP_CLOSE);
> else
> sk->sk_state = TCP_CLOSE;
>
> if (sk->sk_protocol == IPPROTO_TCP)
> tcp_state_store(sk, state);
> else
> sk_state_store(sk, state);
>
>
> Some redundant code.
>
> IMO, put these similar code into a wrapper is more nice.
Agreed. Hmpf, looks like one way or another, we have to add the sk_
functions to do such check, and then the tcp_* won't help much.
I'm okay with this v5 then, can't see a better way around it.
Marcelo
next prev parent reply other threads:[~2017-12-08 11:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 14:10 [PATCH v5 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint Yafang Shao
2017-12-07 20:02 ` Marcelo Ricardo Leitner
2017-12-07 20:04 ` David Miller
2017-12-08 1:41 ` Yafang Shao
2017-12-08 3:40 ` Yafang Shao
2017-12-08 11:03 ` Marcelo Ricardo Leitner [this message]
2017-12-08 16:03 ` David Miller
2017-12-08 15:42 ` David Miller
2017-12-08 15:50 ` Yafang Shao
2017-12-08 16:28 ` David Miller
2017-12-09 0:47 ` Yafang Shao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171208110356.GS13341@localhost.localdomain \
--to=marcelo.leitner@gmail.com \
--cc=bgregg@netflix.com \
--cc=davem@davemloft.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=laoar.shao@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=songliubraving@fb.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).