From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jiri Pirko <jiri@resnulli.us>, netdev@vger.kernel.org
Cc: davem@davemloft.net, idosch@mellanox.com, dsahern@gmail.com,
mlxsw@mellanox.com
Subject: Re: [patch net-next] net: fib_notifier: move fib_notifier_ops from struct net into per-net struct
Date: Fri, 6 Sep 2019 07:54:39 +0200 [thread overview]
Message-ID: <bb24e9d5-24c6-d590-e490-be2226016288@gmail.com> (raw)
In-Reply-To: <20190905180656.4756-1-jiri@resnulli.us>
On 9/5/19 8:06 PM, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@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.
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 ?
next prev parent reply other threads:[~2019-09-06 5:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-05 18:06 [patch net-next] net: fib_notifier: move fib_notifier_ops from struct net into per-net struct Jiri Pirko
2019-09-06 5:54 ` Eric Dumazet [this message]
2019-09-06 6:05 ` Jiri Pirko
2019-09-07 15:28 ` David Miller
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=bb24e9d5-24c6-d590-e490-be2226016288@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=idosch@mellanox.com \
--cc=jiri@resnulli.us \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).