diff mbox series

[v1,net] l2tp: Don't assign net->gen->ptr[] for pppol2tp_net_ops.

Message ID 20240722191556.36224-1-kuniyu@amazon.com (mailing list archive)
State Deferred
Delegated to: Netdev Maintainers
Headers show
Series [v1,net] l2tp: Don't assign net->gen->ptr[] for pppol2tp_net_ops. | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 273 this patch: 273
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 1 blamed authors not CCed: rdunlap@infradead.org; 1 maintainers not CCed: rdunlap@infradead.org
netdev/build_clang success Errors and warnings before: 281 this patch: 281
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 281 this patch: 281
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-07-23--15-00 (tests: 688)

Commit Message

Kuniyuki Iwashima July 22, 2024, 7:15 p.m. UTC
Commit fd558d186df2 ("l2tp: Split pppol2tp patch into separate l2tp and
ppp parts") converted net->gen->ptr[pppol2tp_net_id] in l2tp_ppp.c to
net->gen->ptr[l2tp_net_id] in l2tp_core.c.

Now the leftover wastes one entry of net->gen->ptr[] in each netns.

Let's avoid the unwanted allocation.

Fixes: fd558d186df2 ("l2tp: Split pppol2tp patch into separate l2tp and ppp parts")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
---
 net/l2tp/l2tp_ppp.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Simon Horman July 23, 2024, 8:50 a.m. UTC | #1
On Mon, Jul 22, 2024 at 12:15:56PM -0700, Kuniyuki Iwashima wrote:
> Commit fd558d186df2 ("l2tp: Split pppol2tp patch into separate l2tp and
> ppp parts") converted net->gen->ptr[pppol2tp_net_id] in l2tp_ppp.c to
> net->gen->ptr[l2tp_net_id] in l2tp_core.c.
> 
> Now the leftover wastes one entry of net->gen->ptr[] in each netns.
> 
> Let's avoid the unwanted allocation.
> 
> Fixes: fd558d186df2 ("l2tp: Split pppol2tp patch into separate l2tp and ppp parts")
> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>

Hi Iwashima-san,

It looks like this problem is a resource overuse that has been present
since 2010. So I lean towards it being a clean-up for net-next rather than
a fix.

That notwithstanding, this looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>

...
Kuniyuki Iwashima July 23, 2024, 6:34 p.m. UTC | #2
From: Simon Horman <horms@kernel.org>
Date: Tue, 23 Jul 2024 09:50:23 +0100
> On Mon, Jul 22, 2024 at 12:15:56PM -0700, Kuniyuki Iwashima wrote:
> > Commit fd558d186df2 ("l2tp: Split pppol2tp patch into separate l2tp and
> > ppp parts") converted net->gen->ptr[pppol2tp_net_id] in l2tp_ppp.c to
> > net->gen->ptr[l2tp_net_id] in l2tp_core.c.
> > 
> > Now the leftover wastes one entry of net->gen->ptr[] in each netns.
> > 
> > Let's avoid the unwanted allocation.
> > 
> > Fixes: fd558d186df2 ("l2tp: Split pppol2tp patch into separate l2tp and ppp parts")
> > Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
> 
> Hi Iwashima-san,
> 
> It looks like this problem is a resource overuse that has been present
> since 2010. So I lean towards it being a clean-up for net-next rather than
> a fix.
> 
> That notwithstanding, this looks good to me.
> 
> Reviewed-by: Simon Horman <horms@kernel.org>

Thanks, Simon.

Will post this next week in a seris.
diff mbox series

Patch

diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index 3596290047b2..246089b17910 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -1406,8 +1406,6 @@  static int pppol2tp_getsockopt(struct socket *sock, int level, int optname,
  * L2TPv2, we dump only L2TPv2 tunnels and sessions here.
  *****************************************************************************/
 
-static unsigned int pppol2tp_net_id;
-
 #ifdef CONFIG_PROC_FS
 
 struct pppol2tp_seq_data {
@@ -1641,7 +1639,6 @@  static __net_exit void pppol2tp_exit_net(struct net *net)
 static struct pernet_operations pppol2tp_net_ops = {
 	.init = pppol2tp_init_net,
 	.exit = pppol2tp_exit_net,
-	.id   = &pppol2tp_net_id,
 };
 
 /*****************************************************************************