[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a1xeZsrOv4+xhL5dbi02zfQcPEJvWDzmUNkFKmQubMkSA@mail.gmail.com>
Date: Tue, 18 Dec 2018 17:16:20 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: Deepa Dinamani <deepa.kernel@...il.com>,
David Miller <davem@...emloft.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Networking <netdev@...r.kernel.org>,
y2038 Mailman List <y2038@...ts.linaro.org>,
Chris Zankel <chris@...kel.net>,
Fenghua Yu <fenghua.yu@...el.com>,
Richard Henderson <rth@...ddle.net>,
Thomas Gleixner <tglx@...utronix.de>, ubraun@...ux.ibm.com,
linux-alpha@...r.kernel.org,
linux-arch <linux-arch@...r.kernel.org>,
linux-ia64@...r.kernel.org,
"open list:RALINK MIPS ARCHITECTURE" <linux-mips@...ux-mips.org>,
linux-s390 <linux-s390@...r.kernel.org>,
linux-xtensa@...ux-xtensa.org,
sparclinux <sparclinux@...r.kernel.org>
Subject: Re: [PATCH v2 7/8] socket: Add SO_TIMESTAMPING_NEW
On Wed, Dec 12, 2018 at 4:25 PM Willem de Bruijn
<willemdebruijn.kernel@...il.com> wrote:
> On Tue, Dec 11, 2018 at 3:30 PM Deepa Dinamani <deepa.kernel@...il.com> wrote:
> > @@ -851,39 +890,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
> > break;
> >
> > case SO_TIMESTAMPING_OLD:
> > - if (val & ~SOF_TIMESTAMPING_MASK) {
> > - ret = -EINVAL;
> > - break;
> > - }
> > -
> > - if (val & SOF_TIMESTAMPING_OPT_ID &&
> > - !(sk->sk_tsflags & SOF_TIMESTAMPING_OPT_ID)) {
> > - if (sk->sk_protocol == IPPROTO_TCP &&
> > - sk->sk_type == SOCK_STREAM) {
> > - if ((1 << sk->sk_state) &
> > - (TCPF_CLOSE | TCPF_LISTEN)) {
> > - ret = -EINVAL;
> > - break;
> > - }
> > - sk->sk_tskey = tcp_sk(sk)->snd_una;
> > - } else {
> > - sk->sk_tskey = 0;
> > - }
> > - }
> > -
> > - if (val & SOF_TIMESTAMPING_OPT_STATS &&
> > - !(val & SOF_TIMESTAMPING_OPT_TSONLY)) {
> > - ret = -EINVAL;
> > - break;
> > - }
> > -
> > - sk->sk_tsflags = val;
> > - if (val & SOF_TIMESTAMPING_RX_SOFTWARE)
> > - sock_enable_timestamp(sk,
> > - SOCK_TIMESTAMPING_RX_SOFTWARE);
> > - else
> > - sock_disable_timestamp(sk,
> > - (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE));
> > + ret = setsockopt_timestamping(sk, optname, val);
>
> Once again a lot of needless code churn. The only functional change is adding
I think moving the code out into a separate function is a useful cleanup,
but if we want to do that, it may be better done in another patch, to
make it easier to review.
Arnd
Powered by blists - more mailing lists