[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bb24e9d5-24c6-d590-e490-be2226016288@gmail.com>
Date: Fri, 6 Sep 2019 07:54:39 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jiri Pirko <jiri@...nulli.us>, netdev@...r.kernel.org
Cc: davem@...emloft.net, idosch@...lanox.com, dsahern@...il.com,
mlxsw@...lanox.com
Subject: Re: [patch net-next] net: fib_notifier: move fib_notifier_ops from
struct net into per-net struct
On 9/5/19 8:06 PM, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@...lanox.com>
>
> No need for fib_notifier_ops to be in struct net. It is used only by
> fib_notifier as a private data. Use net_generic to introduce per-net
> fib_notifier struct and move fib_notifier_ops there.
>
>
...
> static struct pernet_operations fib_notifier_net_ops = {
> .init = fib_notifier_net_init,
> .exit = fib_notifier_net_exit,
> + .id = &fib_notifier_net_id,
> + .size = sizeof(struct fib_notifier_net),
> };
>
> static int __init fib_notifier_init(void)
>
Note that this will allocate a block of memory (in ops_init()) to hold this,
plus a second one to hold the pointer to this block.
Due to kmalloc() constraints, this block will use more memory.
Not sure your patch is a win, since it makes things a bit more complex.
Is it a preparation patch so that you can add later other fields in struct fib_notifier_net ?
Powered by blists - more mailing lists