From: Daniel Lezcano <dlezcano@fr.ibm.com>
To: Eric Dumazet <dada1@cosmosbay.com>
Cc: Pavel Emelyanov <xemul@openvz.org>,
David Miller <davem@davemloft.net>,
Linux Netdev List <netdev@vger.kernel.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
devel@openvz.org
Subject: Re: [PATCH 0/5] Make nicer CONFIG_NET_NS=n case code
Date: Wed, 31 Oct 2007 22:35:51 +0100 [thread overview]
Message-ID: <4728F537.40407@fr.ibm.com> (raw)
In-Reply-To: <20071031194924.2436843e.dada1@cosmosbay.com>
Eric Dumazet wrote:
> On Wed, 31 Oct 2007 22:19:43 +0300
> Pavel Emelyanov <xemul@openvz.org> wrote:
>
>> Currently we have the NET_NS config option, but the only change it
>> makes is just return ERR_PTR(-EINVAL) inside the cloning call thus
>> introducing a bunch of a dead code and making the reference counting
>> unneeded. This is not very good.
>>
>> So clean the net_namespace.c to fix this.
>>
>> I have sent a set of patches to Andrew to make similar thing for
>> other namespaces, which introduces the NAMESPACES option to turn
>> all the namespaces off at once (to make embedded people suffer
>> less). So after that stuff is in, there will be some more patches
>> to tie all this together.
>>
>> What is to be done after this set is to make the register_pernet_xxx
>> stuff smaller. Currently this code weights approximately 500 bytes,
>> so it worths reducing it, but I haven't found a good solution yet.
>
> Definitly wanted here. Thank you.
> One more refcounting on each socket creation/deletion was expensive.
>
> Maybe we can add a macro to get nd_net from a "struct net_device"
> so that every instance of
>
> if (dev->nd_net != &init_net)
> goto drop;
>
> can also be optimized away if !CONFIG_NET_NS
>
> extern inline netdev_get_ns(struct netdevice *dev)
> {
> #ifdef CONFIG_NET_NS
> return dev->nd_net;
> #else
> return &init_net;
> #endif
> }
Or something like:
#ifdef CONFIG_NET_NS
static inline int init_net_dev(struct net_device *dev)
{
return dev->nd_net == &init_net;
}
#else
static inline int init_net_dev(struct net_device *dev)
{
return 1;
}
#endif
By the way, this kind of test will disappear when the network namespace
will be complete and take into account the differents protocols.
next prev parent reply other threads:[~2007-10-31 21:38 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-31 19:19 [PATCH 0/5] Make nicer CONFIG_NET_NS=n case code Pavel Emelyanov
2007-10-31 18:49 ` Eric Dumazet
2007-10-31 21:35 ` Daniel Lezcano [this message]
2007-10-31 22:05 ` Eric W. Biederman
2007-10-31 22:40 ` Eric Dumazet
2007-10-31 23:31 ` David Miller
2007-11-01 0:58 ` Eric W. Biederman
2007-11-01 0:51 ` Eric W. Biederman
2007-11-01 6:58 ` Eric Dumazet
2007-11-01 7:02 ` David Miller
2007-10-31 19:23 ` [PATCH 1/5][NETNS] Make the init/exit hooks checks outside the loop Pavel Emelyanov
2007-11-01 7:43 ` David Miller
2007-10-31 19:25 ` [PATCH 2/5] Relax the reference counting of init_net_ns Pavel Emelyanov
2007-11-01 7:43 ` David Miller
2007-10-31 19:28 ` [PATCH 3/5] Hide the dead code in the net_namespace.c Pavel Emelyanov
2007-11-01 7:45 ` David Miller
2007-10-31 19:31 ` [PATCH 4/5] Mark the setup_net as __net_init Pavel Emelyanov
2007-11-01 7:46 ` David Miller
2007-10-31 19:32 ` [PATCH 5/5] Hide the net_ns kmem cache Pavel Emelyanov
2007-11-01 7:47 ` David Miller
2007-10-31 21:37 ` [PATCH 0/5] Make nicer CONFIG_NET_NS=n case code Daniel Lezcano
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=4728F537.40407@fr.ibm.com \
--to=dlezcano@fr.ibm.com \
--cc=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=devel@openvz.org \
--cc=ebiederm@xmission.com \
--cc=netdev@vger.kernel.org \
--cc=xemul@openvz.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.