[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221129204818.7d8204b4@kernel.org>
Date: Tue, 29 Nov 2022 20:48:18 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Firo Yang <firo.yang@...e.com>
Cc: marcelo.leitner@...il.com, vyasevich@...il.com,
nhorman@...driver.com, mkubecek@...e.com, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com, linux-sctp@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
firogm@...il.com
Subject: Re: [PATCH v2 1/1] sctp: sysctl: make extra pointers netns aware
On Fri, 25 Nov 2022 20:11:27 +0800 Firo Yang wrote:
> +#define SCTP_RTO_MIN_IDX 1
> +#define SCTP_RTO_MAX_IDX 2
> +#define SCTP_PF_RETRANS_IDX 3
> +#define SCTP_PS_RETRANS_IDX 4
Use these to index the entries, please, like this:
struct bla table[] = {
[MY_INDEX_ONE] = {
.whatever = 1,
},
[MY_INDEX_TWO] = {
.fields = 2,
},
{
.there = 3,
},
{
.are = 4,
},
};
I think that works even without all entries in the table having the
index.. ?
> static struct ctl_table sctp_net_table[] = {
> {
> .procname = "rto_initial",
> @@ -112,6 +122,24 @@ static struct ctl_table sctp_net_table[] = {
> .extra1 = &init_net.sctp.rto_min,
> .extra2 = &timer_max
> },
> + {
> + .procname = "pf_retrans",
> + .data = &init_net.sctp.pf_retrans,
> + .maxlen = sizeof(int),
> + .mode = 0644,
> + .proc_handler = proc_dointvec_minmax,
> + .extra1 = SYSCTL_ZERO,
> + .extra2 = &init_net.sctp.ps_retrans,
> + },
> + {
> + .procname = "ps_retrans",
> + .data = &init_net.sctp.ps_retrans,
> + .maxlen = sizeof(int),
> + .mode = 0644,
> + .proc_handler = proc_dointvec_minmax,
> + .extra1 = &init_net.sctp.pf_retrans,
> + .extra2 = &ps_retrans_max,
> + },
Powered by blists - more mailing lists