netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Soheil Hassas Yeganeh <soheil@google.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Neal Cardwell <ncardwell@google.com>,
	Yuchung Cheng <ycheng@google.com>, Wei Wang <weiwan@google.com>,
	netdev <netdev@vger.kernel.org>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH net-next 02/15] tcp: introduce tcp_jiffies32
Date: Wed, 17 May 2017 09:43:09 -0400	[thread overview]
Message-ID: <CACSApvYvWvDHmdfzCRmA8pJ87jcW-aPKC98c699Simnr1vwdzw@mail.gmail.com> (raw)
In-Reply-To: <20170516210014.31176-3-edumazet@google.com>

On Tue, May 16, 2017 at 5:00 PM, Eric Dumazet <edumazet@google.com> wrote:
> We abuse tcp_time_stamp for two different cases :
>
> 1) base to generate TCP Timestamp options (RFC 7323)
>
> 2) A 32bit version of jiffies since some TCP fields
>    are 32bit wide to save memory.
>
> Since we want in the future to have 1ms TCP TS clock,
> regardless of HZ value, we want to cleanup things.
>
> tcp_jiffies32 is the truncated jiffies value,
> which will be used only in places where we want a 'host'
> timestamp.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Acked-by: Soheil Hassas Yeganeh <soheil@google.com>

> ---
>  include/net/tcp.h | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/include/net/tcp.h b/include/net/tcp.h
> index b4dc93dae98c2d175ccadce150083705d237555e..4b45be5708215bae4551a5430b63ab2777baf447 100644
> --- a/include/net/tcp.h
> +++ b/include/net/tcp.h
> @@ -700,11 +700,14 @@ u32 __tcp_select_window(struct sock *sk);
>
>  void tcp_send_window_probe(struct sock *sk);
>
> -/* TCP timestamps are only 32-bits, this causes a slight
> - * complication on 64-bit systems since we store a snapshot
> - * of jiffies in the buffer control blocks below.  We decided
> - * to use only the low 32-bits of jiffies and hide the ugly
> - * casts with the following macro.
> +/* TCP uses 32bit jiffies to save some space.
> + * Note that this is different from tcp_time_stamp, which
> + * historically has been the same until linux-4.13.
> + */
> +#define tcp_jiffies32 ((u32)jiffies)
> +
> +/* Generator for TCP TS option (RFC 7323)
> + * Currently tied to 'jiffies' but will soon be driven by 1 ms clock.
>   */
>  #define tcp_time_stamp         ((__u32)(jiffies))
>
> --
> 2.13.0.303.g4ebf302169-goog
>

  reply	other threads:[~2017-05-17 13:44 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 20:59 [PATCH net-next 00/15] tcp: TCP TS option use 1 ms clock Eric Dumazet
2017-05-16 21:00 ` [PATCH net-next 01/15] tcp: use tp->tcp_mstamp in output path Eric Dumazet
2017-05-17 13:42   ` Soheil Hassas Yeganeh
2017-05-16 21:00 ` [PATCH net-next 02/15] tcp: introduce tcp_jiffies32 Eric Dumazet
2017-05-17 13:43   ` Soheil Hassas Yeganeh [this message]
2017-05-16 21:00 ` [PATCH net-next 03/15] dccp: do not use tcp_time_stamp Eric Dumazet
2017-05-17 13:43   ` Soheil Hassas Yeganeh
2017-05-16 21:00 ` [PATCH net-next 04/15] tcp: use tcp_jiffies32 to feed tp->lsndtime Eric Dumazet
2017-05-17 13:43   ` Soheil Hassas Yeganeh
2017-05-16 21:00 ` [PATCH net-next 05/15] tcp: use tcp_jiffies32 to feed tp->snd_cwnd_stamp Eric Dumazet
2017-05-17 13:45   ` Soheil Hassas Yeganeh
2017-05-16 21:00 ` [PATCH net-next 06/15] tcp_bbr: use tcp_jiffies32 instead of tcp_time_stamp Eric Dumazet
2017-05-17 13:45   ` Soheil Hassas Yeganeh
2017-05-16 21:00 ` [PATCH net-next 07/15] tcp: bic,cubic: " Eric Dumazet
2017-05-17 13:46   ` Soheil Hassas Yeganeh
2017-05-16 21:00 ` [PATCH net-next 08/15] tcp: use tcp_jiffies32 for rcv_tstamp and lrcvtime Eric Dumazet
2017-05-17 13:46   ` Soheil Hassas Yeganeh
2017-05-16 21:00 ` [PATCH net-next 09/15] tcp: use tcp_jiffies32 to feed probe_timestamp Eric Dumazet
2017-05-17 13:46   ` Soheil Hassas Yeganeh
2017-05-16 21:00 ` [PATCH net-next 10/15] tcp: uses jiffies_32 to feed tp->chrono_start Eric Dumazet
2017-05-17 13:46   ` Soheil Hassas Yeganeh
2017-05-16 21:00 ` [PATCH net-next 11/15] tcp: use tcp_jiffies32 in __tcp_oow_rate_limited() Eric Dumazet
2017-05-17 13:47   ` Soheil Hassas Yeganeh
2017-05-16 21:00 ` [PATCH net-next 12/15] tcp_westwood: use tcp_jiffies32 instead of tcp_time_stamp Eric Dumazet
2017-05-17 13:47   ` Soheil Hassas Yeganeh
2017-05-16 21:00 ` [PATCH net-next 13/15] tcp_lp: cache tcp_time_stamp Eric Dumazet
2017-05-17 13:47   ` Soheil Hassas Yeganeh
2017-05-16 21:00 ` [PATCH net-next 14/15] tcp: replace misc tcp_time_stamp to tcp_jiffies32 Eric Dumazet
2017-05-17 13:47   ` Soheil Hassas Yeganeh
2017-05-16 21:00 ` [PATCH net-next 15/15] tcp: switch TCP TS option (RFC 7323) to 1ms clock Eric Dumazet
2017-05-17 13:51   ` Soheil Hassas Yeganeh
2017-05-18 12:33   ` Eric Dumazet
2017-05-18 16:15     ` [PATCH net-next] tcp: fix tcp_rearm_rto() Eric Dumazet
2017-05-18 16:55       ` Soheil Hassas Yeganeh
2017-05-18 17:20       ` David Miller
2017-05-17 20:06 ` [PATCH net-next 00/15] tcp: TCP TS option use 1 ms clock 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=CACSApvYvWvDHmdfzCRmA8pJ87jcW-aPKC98c699Simnr1vwdzw@mail.gmail.com \
    --to=soheil@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=weiwan@google.com \
    --cc=ycheng@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).