Fri, Sep 06, 2019 at 07:54:39AM CEST, eric.duma...@gmail.com wrote: > > >On 9/5/19 8:06 PM, Jiri Pirko wrote: >> From: Jiri Pirko <j...@mellanox.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.
I'm aware. But we have net_generic for exactly this purpose not to pullute struct net. > >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 ? Yes. >