[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL+tcoBxZB-OmOyA4NDOnRgj8S7x3nnssdYdLdU+5fGU8EY6iA@mail.gmail.com>
Date: Sun, 6 Oct 2024 07:04:25 +0900
From: Jason Xing <kerneljasonxing@...il.com>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kernelxing@...cent.com,
kuba@...nel.org, netdev@...r.kernel.org, pabeni@...hat.com,
willemb@...gle.com, willemdebruijn.kernel@...il.com
Subject: Re: [PATCH net-next v3] net-timestamp: namespacify the sysctl_tstamp_allow_data
On Fri, Oct 4, 2024 at 7:10 AM Kuniyuki Iwashima <kuniyu@...zon.com> wrote:
>
> From: Jason Xing <kerneljasonxing@...il.com>
> Date: Thu, 3 Oct 2024 19:40:35 +0900
> > diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
> > index 86a2476678c4..83622799eb80 100644
> > --- a/net/core/sysctl_net_core.c
> > +++ b/net/core/sysctl_net_core.c
> > @@ -491,15 +491,6 @@ static struct ctl_table net_core_table[] = {
> > .mode = 0644,
> > .proc_handler = proc_dointvec,
> > },
> > - {
> > - .procname = "tstamp_allow_data",
> > - .data = &sysctl_tstamp_allow_data,
> > - .maxlen = sizeof(int),
> > - .mode = 0644,
> > - .proc_handler = proc_dointvec_minmax,
> > - .extra1 = SYSCTL_ZERO,
> > - .extra2 = SYSCTL_ONE
> > - },
> > #ifdef CONFIG_RPS
> > {
> > .procname = "rps_sock_flow_entries",
> > @@ -665,6 +656,15 @@ static struct ctl_table netns_core_table[] = {
> > .extra2 = SYSCTL_ONE,
> > .proc_handler = proc_dou8vec_minmax,
> > },
> > + {
> > + .procname = "tstamp_allow_data",
> > + .data = &init_net.core.sysctl_tstamp_allow_data,
> > + .maxlen = sizeof(int),
> > + .mode = 0644,
> > + .proc_handler = proc_dointvec_minmax,
> > + .extra1 = SYSCTL_ZERO,
> > + .extra2 = SYSCTL_ONE
>
> It's already limited to [0, 1], so you can use u8 and save 3 bytes.
>
> grep -rnI proc_dou8vec_minmax.
Thanks for your advice. I will update it soon.
Thanks,
Jason
Powered by blists - more mailing lists