From: Yuchung Cheng <ycheng@google.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Soheil Hassas Yeganeh <soheil@google.com>,
Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH net-next 01/10] tcp: add tp->tcp_mstamp field
Date: Tue, 25 Apr 2017 14:27:10 -0700 [thread overview]
Message-ID: <CAK6E8=fhzzLKiUnB73upZdUUUSZ4t6HABmM17YGyEj93jLBkMQ@mail.gmail.com> (raw)
In-Reply-To: <20170425171541.3417-2-edumazet@google.com>
On Tue, Apr 25, 2017 at 10:15 AM, Eric Dumazet <edumazet@google.com> wrote:
> We want to use precise timestamps in TCP stack, but we do not
> want to call possibly expensive kernel time services too often.
>
> tp->tcp_mstamp is guaranteed to be updated once per incoming packet.
>
> We will use it in the following patches, removing specific
> skb_mstamp_get() calls, and removing ack_time from
> struct tcp_sacktag_state.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> include/linux/tcp.h | 1 +
> net/ipv4/tcp_input.c | 3 +++
> 2 files changed, 4 insertions(+)
>
> diff --git a/include/linux/tcp.h b/include/linux/tcp.h
> index cbe5b602a2d349fdeb1e878305f37b4da1e6cc86..99a22f44c32e1587a6bf4835b65c7a4314807aa8 100644
> --- a/include/linux/tcp.h
> +++ b/include/linux/tcp.h
> @@ -240,6 +240,7 @@ struct tcp_sock {
> u32 tlp_high_seq; /* snd_nxt at the time of TLP retransmit. */
>
> /* RTT measurement */
> + struct skb_mstamp tcp_mstamp; /* most recent packet received/sent */
Eric: would this new stamp cover outgoing packet as well in the
future? in the patch series seem to cover only the incoming packets.
> u32 srtt_us; /* smoothed round trip time << 3 in usecs */
> u32 mdev_us; /* medium deviation */
> u32 mdev_max_us; /* maximal mdev for the last rtt period */
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 5af2f04f885914491a7116c20056b3d2188d2d7d..bd18c65df4a9d9c2b66d8005f2cc4ff468140a73 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -5362,6 +5362,7 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
> {
> struct tcp_sock *tp = tcp_sk(sk);
>
> + skb_mstamp_get(&tp->tcp_mstamp);
> if (unlikely(!sk->sk_rx_dst))
> inet_csk(sk)->icsk_af_ops->sk_rx_dst_set(sk, skb);
> /*
> @@ -5922,6 +5923,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
>
> case TCP_SYN_SENT:
> tp->rx_opt.saw_tstamp = 0;
> + skb_mstamp_get(&tp->tcp_mstamp);
> queued = tcp_rcv_synsent_state_process(sk, skb, th);
> if (queued >= 0)
> return queued;
> @@ -5933,6 +5935,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
> return 0;
> }
>
> + skb_mstamp_get(&tp->tcp_mstamp);
> tp->rx_opt.saw_tstamp = 0;
> req = tp->fastopen_rsk;
> if (req) {
> --
> 2.13.0.rc0.306.g87b477812d-goog
>
next prev parent reply other threads:[~2017-04-25 21:27 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-25 17:15 [PATCH net-next 00/10] tcp: do not use tcp_time_stamp for rcv autotuning Eric Dumazet
2017-04-25 17:15 ` [PATCH net-next 01/10] tcp: add tp->tcp_mstamp field Eric Dumazet
2017-04-25 17:48 ` Soheil Hassas Yeganeh
2017-04-25 17:49 ` Neal Cardwell
2017-04-25 21:27 ` Yuchung Cheng [this message]
2017-04-25 21:33 ` Eric Dumazet
2017-04-25 17:15 ` [PATCH net-next 02/10] tcp: do not pass timestamp to tcp_rack_detect_loss() Eric Dumazet
2017-04-25 17:51 ` Neal Cardwell
2017-04-26 23:03 ` Eric Dumazet
2017-04-25 17:15 ` [PATCH net-next 03/10] tcp: do not pass timestamp to tcp_rack_mark_lost() Eric Dumazet
2017-04-25 17:51 ` Neal Cardwell
2017-04-25 17:15 ` [PATCH net-next 04/10] tcp: do not pass timestamp to tcp_rack_identify_loss() Eric Dumazet
2017-04-25 17:52 ` Neal Cardwell
2017-04-25 17:15 ` [PATCH net-next 05/10] tcp: do not pass timestamp to tcp_fastretrans_alert() Eric Dumazet
2017-04-25 17:52 ` Neal Cardwell
2017-04-25 17:15 ` [PATCH net-next 06/10] tcp: do not pass timestamp to tcp_rate_gen() Eric Dumazet
2017-04-25 17:53 ` Neal Cardwell
2017-04-25 17:15 ` [PATCH net-next 07/10] tcp: do not pass timestamp to tcp_rack_advance() Eric Dumazet
2017-04-25 17:53 ` Neal Cardwell
2017-04-25 17:15 ` [PATCH net-next 08/10] tcp: use tp->tcp_mstamp in tcp_clean_rtx_queue() Eric Dumazet
2017-04-25 17:53 ` Neal Cardwell
2017-04-25 17:15 ` [PATCH net-next 09/10] tcp: remove ack_time from struct tcp_sacktag_state Eric Dumazet
2017-04-25 17:53 ` Neal Cardwell
2017-04-25 17:15 ` [PATCH net-next 10/10] tcp: switch rcv_rtt_est and rcvq_space to high resolution timestamps Eric Dumazet
2017-04-25 17:54 ` Neal Cardwell
2017-04-26 18:44 ` [PATCH net-next 00/10] tcp: do not use tcp_time_stamp for rcv autotuning David Miller
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='CAK6E8=fhzzLKiUnB73upZdUUUSZ4t6HABmM17YGyEj93jLBkMQ@mail.gmail.com' \
--to=ycheng@google.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=soheil@google.com \
/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).