From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: David Miller <davem@davemloft.net>,
LKML <linux-kernel@vger.kernel.org>,
Network Development <netdev@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>, Arnd Bergmann <arnd@arndb.de>,
y2038 Mailman List <y2038@lists.linaro.org>,
chris@zankel.net, fenghua.yu@intel.com, rth@twiddle.net,
Thomas Gleixner <tglx@linutronix.de>,
ubraun@linux.ibm.com, linux-alpha@vger.kernel.org,
linux-arch@vger.kernel.org, linux-ia64@vger.kernel.org,
linux-mips@linux-mips.org,
linux-s390 <linux-s390@vger.kernel.org>,
linux-xtensa@linux-xtensa.org, sparclinux@vger.kernel.org
Subject: Re: [PATCH 8/8] socket: Add SO_TIMESTAMPING_NEW
Date: Sat, 24 Nov 2018 23:00:08 -0500 [thread overview]
Message-ID: <CAF=yD-Jz8c2EsoKxUDbf7dygWRW49kwteUsksq3eUV00Eg94-w@mail.gmail.com> (raw)
In-Reply-To: <20181124022035.17519-9-deepa.kernel@gmail.com>
On Sat, Nov 24, 2018 at 3:58 AM Deepa Dinamani <deepa.kernel@gmail.com> wrote:
>
> Add SO_TIMESTAMPING_NEW variant of socket timestamp options.
> This is the y2038 safe versions of the SO_TIMESTAMPING_OLD
> for all architectures.
>
> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> Cc: chris@zankel.net
> Cc: fenghua.yu@intel.com
> Cc: rth@twiddle.net
> Cc: tglx@linutronix.de
> Cc: ubraun@linux.ibm.com
> Cc: linux-alpha@vger.kernel.org
> Cc: linux-arch@vger.kernel.org
> Cc: linux-ia64@vger.kernel.org
> Cc: linux-mips@linux-mips.org
> Cc: linux-s390@vger.kernel.org
> Cc: linux-xtensa@linux-xtensa.org
> Cc: sparclinux@vger.kernel.org
> ---
> /*
> * called from sock_recv_timestamp() if sock_flag(sk, SOCK_RCVTSTAMP)
> * or sock_flag(sk, SOCK_RCVTSTAMPNS)
> @@ -739,8 +740,8 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
> struct sk_buff *skb)
> {
> int need_software_tstamp = sock_flag(sk, SOCK_RCVTSTAMP) || sock_flag(sk, SOCK_RCVTSTAMPNS);
> - struct scm_timestamping tss;
> - int empty = 1, false_tstamp = 0;
> + struct scm_timestamping_internal tss;
> + int empty = 1, false_tstamp = 0, new_tstamp = 0;
> struct skb_shared_hwtstamps *shhwtstamps =
> skb_hwtstamps(skb);
>
> @@ -756,20 +757,23 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
>
> memset(&tss, 0, sizeof(tss));
> if ((sk->sk_tsflags & SOF_TIMESTAMPING_SOFTWARE) &&
> - ktime_to_timespec_cond(skb->tstamp, tss.ts + 0))
> + ktime_to_timespec64_cond(skb->tstamp, tss.ts + 0))
> empty = 0;
> if (shhwtstamps &&
> (sk->sk_tsflags & SOF_TIMESTAMPING_RAW_HARDWARE) &&
> !skb_is_swtx_tstamp(skb, false_tstamp) &&
> - ktime_to_timespec_cond(shhwtstamps->hwtstamp, tss.ts + 2)) {
> + ktime_to_timespec64_cond(shhwtstamps->hwtstamp, tss.ts + 2)) {
> empty = 0;
> if ((sk->sk_tsflags & SOF_TIMESTAMPING_OPT_PKTINFO) &&
> !skb_is_err_queue(skb))
> put_ts_pktinfo(msg, skb);
> }
> if (!empty) {
> - put_cmsg(msg, SOL_SOCKET,
> - SO_TIMESTAMPING_OLD, sizeof(tss), &tss);
> + new_tstamp = sock_flag(sk, SOCK_TSTAMP_NEW);
> + if (new_tstamp)
nit: no need for explicit variable
> + put_cmsg_scm_timestamping64(msg, &tss);
> + else
> + put_cmsg_scm_timestamping(msg, &tss);
>
> if (skb_is_err_queue(skb) && skb->len &&
> SKB_EXT_ERR(skb)->opt_stats)
> --
> 2.17.1
>
next prev parent reply other threads:[~2018-11-25 4:00 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-24 2:20 [PATCH 0/8] net: y2038-safe socket timestamps Deepa Dinamani
2018-11-24 2:20 ` [PATCH 1/8] arch: Use asm-generic/socket.h when possible Deepa Dinamani
2018-11-24 2:20 ` [PATCH 2/8] sockopt: Rename SO_TIMESTAMP* to SO_TIMESTAMP*_OLD Deepa Dinamani
2018-11-25 3:58 ` Willem de Bruijn
2018-11-30 22:38 ` Deepa Dinamani
2018-11-30 23:33 ` Willem de Bruijn
2018-11-24 2:20 ` [PATCH 3/8] socket: Disentangle SOCK_RCVTSTAMPNS from SOCK_RCVTSTAMP Deepa Dinamani
2018-11-25 3:59 ` Willem de Bruijn
2018-11-25 5:06 ` Deepa Dinamani
2018-11-25 14:18 ` Willem de Bruijn
2018-11-25 18:19 ` David Miller
2018-11-30 22:16 ` Deepa Dinamani
2018-11-30 23:31 ` Willem de Bruijn
2018-11-24 2:20 ` [PATCH 4/8] arch: sparc: Override struct __kernel_old_timeval Deepa Dinamani
2018-11-24 2:20 ` [PATCH 5/8] socket: Use old_timeval types for socket timestamps Deepa Dinamani
2018-11-24 2:20 ` [PATCH 6/8] socket: Add struct sock_timeval Deepa Dinamani
2018-11-24 19:37 ` Willem de Bruijn
2018-11-25 2:09 ` David Miller
2018-11-25 4:52 ` Deepa Dinamani
2018-11-25 20:50 ` Arnd Bergmann
2018-11-26 16:33 ` Deepa Dinamani
2018-11-24 2:20 ` [PATCH 7/8] socket: Add SO_TIMESTAMP[NS]_NEW Deepa Dinamani
2018-11-25 3:59 ` Willem de Bruijn
2018-11-25 4:17 ` Willem de Bruijn
2018-11-25 5:28 ` Deepa Dinamani
2018-11-25 5:55 ` Deepa Dinamani
2018-11-25 14:38 ` Willem de Bruijn
2018-11-25 14:33 ` Willem de Bruijn
2018-11-25 22:35 ` Arnd Bergmann
2018-11-26 0:25 ` Willem de Bruijn
2018-11-30 22:43 ` Deepa Dinamani
2018-11-30 23:37 ` Willem de Bruijn
2018-11-24 2:20 ` [PATCH 8/8] socket: Add SO_TIMESTAMPING_NEW Deepa Dinamani
2018-11-25 4:00 ` Willem de Bruijn [this message]
2018-11-25 5:07 ` Deepa Dinamani
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='CAF=yD-Jz8c2EsoKxUDbf7dygWRW49kwteUsksq3eUV00Eg94-w@mail.gmail.com' \
--to=willemdebruijn.kernel@gmail.com \
--cc=arnd@arndb.de \
--cc=chris@zankel.net \
--cc=davem@davemloft.net \
--cc=deepa.kernel@gmail.com \
--cc=fenghua.yu@intel.com \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-xtensa@linux-xtensa.org \
--cc=netdev@vger.kernel.org \
--cc=rth@twiddle.net \
--cc=sparclinux@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=ubraun@linux.ibm.com \
--cc=viro@zeniv.linux.org.uk \
--cc=y2038@lists.linaro.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).