Re: [PATCH v2 7/8] socket: Add SO_TIMESTAMPING_NEW

Deepa Dinamani <[email protected]>
Newsgroups gmane.linux.network,gmane.linux.kernel,gmane.linux.kernel.year-2038,gmane.linux.ports.alpha,gmane.linux.kernel.cross-arch,gmane.linux.ports.ia64,gmane.linux.ports.mips.general,gmane.linux.ports.sparc
Message-ID <CABeXuvofQQ6GoL9TEgaNRkkFE5RDdrWUmkKOPQUP4f9Zg1KBXA@mail.gmail.com>
On Tue, Dec 18, 2018 at 8:16 AM Arnd Bergmann <[email protected]> wrote:
>
> On Wed, Dec 12, 2018 at 4:25 PM Willem de Bruijn
> <[email protected]> wrote:
> > On Tue, Dec 11, 2018 at 3:30 PM Deepa Dinamani <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.