All of lore.kernel.org
 help / color / mirror / Atom feed
From: Deepa Dinamani <deepa.kernel@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	David Miller <davem@davemloft.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>,
	y2038 Mailman List <y2038@lists.linaro.org>,
	Chris Zankel <chris@zankel.net>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Richard Henderson <rth@twiddle.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	ubraun@linux.ibm.com, linux-alpha@vger.kernel.org,
	linux-arch <linux-arch@vger.kernel.org>,
	linux-ia64@vger.kernel.org,
	"open list:RALINK MIPS ARCHITECTURE" <linux-mips@linux-mips.org>,
	linux-s390 <linux-s390@vger.kernel.org>,
	linux-xtensa@linux-xtensa.org,
	sparclinux <sparclinux@vger.kernel.org>
Subject: Re: [PATCH v2 7/8] socket: Add SO_TIMESTAMPING_NEW
Date: Tue, 18 Dec 2018 13:22:05 -0800	[thread overview]
Message-ID: <CABeXuvofQQ6GoL9TEgaNRkkFE5RDdrWUmkKOPQUP4f9Zg1KBXA@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a1xeZsrOv4+xhL5dbi02zfQcPEJvWDzmUNkFKmQubMkSA@mail.gmail.com>

On Tue, Dec 18, 2018 at 8:16 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Wed, Dec 12, 2018 at 4:25 PM Willem de Bruijn
> <willemdebruijn.kernel@gmail.com> wrote:
> > On Tue, Dec 11, 2018 at 3:30 PM Deepa Dinamani <deepa.kernel@gmail.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.

I already removed this addition of function. I have open coded all the
logic here and in the patch 6.
I will post an update.

-Deepa

WARNING: multiple messages have this Message-ID (diff)
From: Deepa Dinamani <deepa.kernel@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	David Miller <davem@davemloft.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>,
	y2038 Mailman List <y2038@lists.linaro.org>,
	Chris Zankel <chris@zankel.net>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Richard Henderson <rth@twiddle.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	ubraun@linux.ibm.com, linux-alpha@vger.kernel.org,
	linux-arch <linux-arch@vger.kernel.org>,
	linux-ia64@vger.kernel.org,
	"open list:RALINK MIPS ARCHITECTURE" <linux-mips@linux-mips.org>,
	linux-s390 <linux-s390@vger.kernel.org>,
	linux-xtensa@linux-xtensa.org,
	sparclinux <sparclinux@vger.kernel.org>
Subject: Re: [PATCH v2 7/8] socket: Add SO_TIMESTAMPING_NEW
Date: Tue, 18 Dec 2018 21:22:05 +0000	[thread overview]
Message-ID: <CABeXuvofQQ6GoL9TEgaNRkkFE5RDdrWUmkKOPQUP4f9Zg1KBXA@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a1xeZsrOv4+xhL5dbi02zfQcPEJvWDzmUNkFKmQubMkSA@mail.gmail.com>

On Tue, Dec 18, 2018 at 8:16 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Wed, Dec 12, 2018 at 4:25 PM Willem de Bruijn
> <willemdebruijn.kernel@gmail.com> wrote:
> > On Tue, Dec 11, 2018 at 3:30 PM Deepa Dinamani <deepa.kernel@gmail.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.

I already removed this addition of function. I have open coded all the
logic here and in the patch 6.
I will post an update.

-Deepa

  reply	other threads:[~2018-12-18 21:22 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 20:25 [PATCH v2 0/8] net: y2038-safe socket timestamps Deepa Dinamani
2018-12-11 20:25 ` Deepa Dinamani
2018-12-11 20:25 ` [PATCH v2 1/8] arch: Use asm-generic/socket.h when possible Deepa Dinamani
2018-12-11 20:25   ` Deepa Dinamani
2018-12-11 20:25 ` [PATCH v2 2/8] sockopt: Rename SO_TIMESTAMP* to SO_TIMESTAMP*_OLD Deepa Dinamani
2018-12-11 20:25   ` Deepa Dinamani
2018-12-11 20:25 ` [PATCH v2 3/8] arch: sparc: Override struct __kernel_old_timeval Deepa Dinamani
2018-12-11 20:25   ` Deepa Dinamani
2018-12-11 20:25 ` [PATCH v2 4/8] socket: Use old_timeval types for socket timestamps Deepa Dinamani
2018-12-11 20:25 ` [PATCH v2 5/8] socket: Add struct __kernel_sock_timeval Deepa Dinamani
2018-12-11 20:25 ` [PATCH v2 6/8] socket: Add SO_TIMESTAMP[NS]_NEW Deepa Dinamani
2018-12-11 20:25   ` Deepa Dinamani
2018-12-12 15:22   ` Willem de Bruijn
2018-12-12 15:22     ` Willem de Bruijn
2018-12-12 15:35     ` Willem de Bruijn
2018-12-12 15:35       ` Willem de Bruijn
2018-12-15  1:07     ` Deepa Dinamani
2018-12-15  1:07       ` Deepa Dinamani
2018-12-15 15:11       ` Willem de Bruijn
2018-12-15 15:11         ` Willem de Bruijn
2018-12-15 16:50         ` Deepa Dinamani
2018-12-15 16:50           ` Deepa Dinamani
2018-12-15 16:50           ` Deepa Dinamani
2018-12-15 18:51           ` Willem de Bruijn
2018-12-15 18:51             ` Willem de Bruijn
2018-12-15 20:56             ` Deepa Dinamani
2018-12-15 20:56               ` Deepa Dinamani
2018-12-18 16:33             ` Arnd Bergmann
2018-12-18 16:33               ` Arnd Bergmann
2018-12-18 21:27               ` Deepa Dinamani
2018-12-18 21:27                 ` Deepa Dinamani
2018-12-11 20:25 ` [PATCH v2 7/8] socket: Add SO_TIMESTAMPING_NEW Deepa Dinamani
2018-12-11 20:25   ` Deepa Dinamani
2018-12-12 15:25   ` Willem de Bruijn
2018-12-12 15:25     ` Willem de Bruijn
2018-12-18 16:16     ` Arnd Bergmann
2018-12-18 16:16       ` Arnd Bergmann
2018-12-18 21:22       ` Deepa Dinamani [this message]
2018-12-18 21:22         ` Deepa Dinamani
2018-12-11 20:25 ` [PATCH v2 8/8] socket: Update timestamping Documentation Deepa Dinamani
2018-12-12 15:07   ` Willem de Bruijn
2018-12-14 23:24 ` [PATCH v2 0/8] net: y2038-safe socket timestamps David Miller
2018-12-14 23:24   ` David Miller
2018-12-14 23:24   ` 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=CABeXuvofQQ6GoL9TEgaNRkkFE5RDdrWUmkKOPQUP4f9Zg1KBXA@mail.gmail.com \
    --to=deepa.kernel@gmail.com \
    --cc=arnd@arndb.de \
    --cc=chris@zankel.net \
    --cc=davem@davemloft.net \
    --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=willemdebruijn.kernel@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.