All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Granados <j.granados@samsung.com>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	David Ahern <dsahern@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Alexander Aring <alex.aring@gmail.com>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Matthieu Baerts <matthieu.baerts@tessares.net>,
	Mat Martineau <martineau@kernel.org>,
	Santosh Shilimkar <santosh.shilimkar@oracle.com>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	Xin Long <lucien.xin@gmail.com>,
	Karsten Graul <kgraul@linux.ibm.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>,
	Jan Karcher <jaka@linux.ibm.com>, <willy@infradead.org>,
	<keescook@chromium.org>, <josh@joshtriplett.org>,
	"D. Wythe" <alibuda@linux.alibaba.com>,
	Tony Lu <tonylu@linux.alibaba.com>,
	Wen Gu <guwen@linux.alibaba.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-wpan@vger.kernel.org>,
	<mptcp@lists.linux.dev>, <linux-rdma@vger.kernel.org>,
	<rds-devel@oss.oracle.com>, <linux-sctp@vger.kernel.org>,
	<linux-s390@vger.kernel.org>
Subject: Re: [PATCH 11/14] networking: Update to register_net_sysctl_sz
Date: Fri, 28 Jul 2023 09:08:22 +0200	[thread overview]
Message-ID: <20230728070822.nfxb36kvvd7dio2a@localhost> (raw)
In-Reply-To: <ZMFgZHsnhrXNIQ53@bombadil.infradead.org>

[-- Attachment #1: Type: text/plain, Size: 2516 bytes --]

On Wed, Jul 26, 2023 at 11:05:24AM -0700, Luis Chamberlain wrote:
> On Wed, Jul 26, 2023 at 04:06:31PM +0200, Joel Granados wrote:
> > This is part of the effort to remove the sentinel (last empty) element
> > from the ctl_table arrays. We update to the new function and pass it the
> > array size. Care is taken to mirror the NULL assignments with a size of
> > zero (for the unprivileged users). An additional size function was added
> > to the following files in order to calculate the size of an array that
> > is defined in another file:
> >     include/net/ipv6.h
> >     net/ipv6/icmp.c
> >     net/ipv6/route.c
> >     net/ipv6/sysctl_net_ipv6.c
> > 
> 
> Same here as with the other patches, the "why" and size impact should go here.
> I'll skip mentioning that in the other patches.
> 
> > diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
> > index bf6e81d56263..5bad14b3c71e 100644
> > --- a/net/mpls/af_mpls.c
> > +++ b/net/mpls/af_mpls.c
> > @@ -1396,6 +1396,40 @@ static const struct ctl_table mpls_dev_table[] = {
> >  	{ }
> >  };
> >  
> > +static int mpls_platform_labels(struct ctl_table *table, int write,
> > +				void *buffer, size_t *lenp, loff_t *ppos);
> > +#define MPLS_NS_SYSCTL_OFFSET(field)		\
> > +	(&((struct net *)0)->field)
> > +
> > +static const struct ctl_table mpls_table[] = {
> > +	{
> > +		.procname	= "platform_labels",
> > +		.data		= NULL,
> > +		.maxlen		= sizeof(int),
> > +		.mode		= 0644,
> > +		.proc_handler	= mpls_platform_labels,
> > +	},
> > +	{
> > +		.procname	= "ip_ttl_propagate",
> > +		.data		= MPLS_NS_SYSCTL_OFFSET(mpls.ip_ttl_propagate),
> > +		.maxlen		= sizeof(int),
> > +		.mode		= 0644,
> > +		.proc_handler	= proc_dointvec_minmax,
> > +		.extra1		= SYSCTL_ZERO,
> > +		.extra2		= SYSCTL_ONE,
> > +	},
> > +	{
> > +		.procname	= "default_ttl",
> > +		.data		= MPLS_NS_SYSCTL_OFFSET(mpls.default_ttl),
> > +		.maxlen		= sizeof(int),
> > +		.mode		= 0644,
> > +		.proc_handler	= proc_dointvec_minmax,
> > +		.extra1		= SYSCTL_ONE,
> > +		.extra2		= &ttl_max,
> > +	},
> > +	{ }
> > +};
> 
> Unless we hear otherwise from networking folks, I think this move alone
> should probably go as a separate patch with no functional changes to
> make the changes easier to review / bisect.
On further inspection, I have dropped this part of the patch as there is
no real reason to move the mpls_table up the file. I'll comment this in
the new cover letter
> 
>   Luis

-- 

Joel Granados

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  parent reply	other threads:[~2023-07-28  7:14 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230726140648eucas1p29a92c80fb28550e2087cd0ae190d29bd@eucas1p2.samsung.com>
2023-07-26 14:06 ` [PATCH 00/14] sysctl: Add a size argument to register functions in sysctl Joel Granados
     [not found]   ` <CGME20230726140650eucas1p1f5b2aa9dd8f90989c881f0a2e682b9eb@eucas1p1.samsung.com>
2023-07-26 14:06     ` [PATCH 01/14] sysctl: Prefer ctl_table_header in proc_sysctl Joel Granados
     [not found]   ` <CGME20230726140652eucas1p2a2ac2dd74986bd9ace8380d6f51024ff@eucas1p2.samsung.com>
2023-07-26 14:06     ` [PATCH 02/14] sysctl: Use ctl_table_header in list_for_each_table_entry Joel Granados
     [not found]   ` <CGME20230726140653eucas1p2e234b7cd0af5dc506bd27399b84292a6@eucas1p2.samsung.com>
2023-07-26 14:06     ` [PATCH 03/14] sysctl: Add ctl_table_size to ctl_table_header Joel Granados
2023-07-28 10:48       ` Simon Horman
2023-07-31 12:10         ` Joel Granados
     [not found]   ` <CGME20230726140655eucas1p1c71c8de9edc8441b5262c936731b91a2@eucas1p1.samsung.com>
2023-07-26 14:06     ` [PATCH 04/14] sysctl: Add size argument to init_header Joel Granados
     [not found]   ` <CGME20230726140656eucas1p26cd9da21663d25b51dda75258aaa3b55@eucas1p2.samsung.com>
2023-07-26 14:06     ` [PATCH 05/14] sysctl: Add a size arg to __register_sysctl_table Joel Granados
2023-07-28 10:51       ` Simon Horman
2023-07-28 16:08         ` Joel Granados
     [not found]   ` <CGME20230726140659eucas1p2c3cd9f57dd13c71ddeb78d2480587e72@eucas1p2.samsung.com>
2023-07-26 14:06     ` [PATCH 06/14] sysctl: Add size to register_sysctl Joel Granados
2023-07-26 17:58       ` Luis Chamberlain
2023-07-27 12:22         ` Joel Granados
2023-07-27 12:22           ` Joel Granados
2023-07-27 15:42           ` Luis Chamberlain
2023-07-27 15:42             ` Luis Chamberlain
2023-07-28  7:41             ` Joel Granados
2023-07-28  7:41               ` Joel Granados
     [not found]   ` <CGME20230726140700eucas1p1e6b16e884362ebec50f6712b3f11a533@eucas1p1.samsung.com>
2023-07-26 14:06     ` [PATCH 07/14] sysctl: Add size arg to __register_sysctl_init Joel Granados
2023-07-28 10:56       ` Simon Horman
2023-07-28 16:11         ` Joel Granados
     [not found]   ` <CGME20230726140702eucas1p20c75fc21d675ea267dd2ad4ebd6e60b4@eucas1p2.samsung.com>
2023-07-26 14:06     ` [PATCH 08/14] sysctl: Add size to register_net_sysctl function Joel Granados
     [not found]   ` <CGME20230726140703eucas1p2786577bcc67d5ae434671dac11870c60@eucas1p2.samsung.com>
2023-07-26 14:06     ` [PATCH 09/14] ax.25: Update to register_net_sysctl_sz Joel Granados
2023-07-26 18:00       ` Luis Chamberlain
2023-07-27 12:31         ` Joel Granados
2023-07-27 12:31           ` Joel Granados
2023-07-27 15:44           ` Luis Chamberlain
2023-07-28  7:35             ` Joel Granados
2023-07-28  7:35               ` Joel Granados
2023-07-28 18:16               ` Luis Chamberlain
2023-07-31  7:09                 ` Joel Granados
2023-07-31  7:09                   ` Joel Granados
2023-07-27 15:38         ` Joel Granados
2023-07-27 15:38           ` Joel Granados
2023-07-27 15:50           ` Luis Chamberlain
     [not found]   ` <CGME20230726140706eucas1p1b11e5f0bd17f0de19af9608cbd8d17f3@eucas1p1.samsung.com>
2023-07-26 14:06     ` [PATCH 10/14] netfilter: " Joel Granados
2023-07-26 14:06       ` [Bridge] " Joel Granados
2023-07-26 18:01       ` Luis Chamberlain
2023-07-26 18:01         ` [Bridge] " Luis Chamberlain
     [not found]   ` <CGME20230726140709eucas1p2033d64aec69a1962fd7e64c57ad60adc@eucas1p2.samsung.com>
2023-07-26 14:06     ` [PATCH 11/14] networking: " Joel Granados
2023-07-26 18:05       ` Luis Chamberlain
2023-07-27  0:33         ` David Ahern
2023-07-27 12:33         ` Joel Granados
2023-07-28  7:08         ` Joel Granados [this message]
     [not found]   ` <CGME20230726140711eucas1p25a947afeef5593e21578f778355db192@eucas1p2.samsung.com>
2023-07-26 14:06     ` [PATCH 12/14] vrf: " Joel Granados
     [not found]   ` <CGME20230726140712eucas1p1bc7b2d150482936d974ceba9c51d7bc4@eucas1p1.samsung.com>
2023-07-26 14:06     ` [PATCH 13/14] sysctl: SIZE_MAX->ARRAY_SIZE in register_net_sysctl Joel Granados
     [not found]   ` <CGME20230726140714eucas1p186bad44daf14c4c8c93f9aaf52deade5@eucas1p1.samsung.com>
2023-07-26 14:06     ` [PATCH 14/14] sysctl: Use size as stopping criteria for list macro Joel Granados
2023-07-26 18:15   ` [PATCH 00/14] sysctl: Add a size argument to register functions in sysctl Luis Chamberlain
2023-07-27 11:43     ` Joel Granados
2023-07-27 15:39       ` Luis Chamberlain
2023-07-28  7:04         ` Joel Granados

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=20230728070822.nfxb36kvvd7dio2a@localhost \
    --to=j.granados@samsung.com \
    --cc=alex.aring@gmail.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=guwen@linux.alibaba.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jaka@linux.ibm.com \
    --cc=josh@joshtriplett.org \
    --cc=keescook@chromium.org \
    --cc=kgraul@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=marcelo.leitner@gmail.com \
    --cc=martineau@kernel.org \
    --cc=matthieu.baerts@tessares.net \
    --cc=mcgrof@kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rds-devel@oss.oracle.com \
    --cc=santosh.shilimkar@oracle.com \
    --cc=stefan@datenfreihafen.org \
    --cc=steffen.klassert@secunet.com \
    --cc=tonylu@linux.alibaba.com \
    --cc=wenjia@linux.ibm.com \
    --cc=willy@infradead.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.