From: Patrick McHardy <kaber@trash.net>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
jamal <hadi@cyberus.ca>,
Stephen Hemminger <shemminger@linux-foundation.org>,
Ben Greear <greearb@candelatech.com>,
Jeff Garzik <jeff@garzik.org>,
YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>,
Linux Containers <containers@lists.osdl.org>
Subject: Re: [RFD] L2 Network namespace infrastructure
Date: Sat, 23 Jun 2007 20:00:45 +0200 [thread overview]
Message-ID: <467D5FCD.4080003@trash.net> (raw)
In-Reply-To: <m1bqf6a8rd.fsf@ebiederm.dsl.xmission.com>
Eric W. Biederman wrote:
> Patrick McHardy <kaber@trash.net> writes:
>
>>I believe OpenVZ stores the current namespace somewhere global,
>>which avoids passing the namespace around. Couldn't you do this
>>as well?
>
>
> It sucks. Especially in the corner cases. Think macvlan
> with the real network device in one namespace and the ``vlan''
> device in another device.
>
> The implementation of a global is also pretty a little questionable.
> Last I looked it didn't work on the transmit path at all and
> interesting on the receive path.
>
> Further and fundamentally all a global achieves is removing the need
> for the noise patches where you pass the pointer into the various
> functions. For long term maintenance it doesn't help anything.
>
> All of the other changes such as messing with the
> initialization/cleanup and changing access to access the per network
> namespace data structure, and modifying the code partly along the way
> to reject working in other non-default network namespaces that are
> truly intrusive we both still have to make.
>
> So except as an implementation detail how we pass the per network
> namespace pointer is uninteresting.
>
> Currently I am trying for the least clever most straight forward
> implementation I can find, that doesn't give us a regression
> in network stack performance.
>
> So yes if we want to do passing through a magic per cpu global on
> the packet receive path now is the time to decide to do that.
> Currently I don't see the advantage in doing that so I'm not
> suggesting it.
I think your approach is fine and is probably a lot easier
to review than using something global.
>>>Depending upon the data structure it will either be modified to hold
>>>a per entry network namespace pointer or it there will be a separate
>>>copy per network namespace. For large global data structures like
>>>the ipv4 routing cache hash table adding an additional pointer to the
>>>entries appears the more reasonable solution.
>>
>>
>>So the routing cache is shared between all namespaces?
>
>
> Yes. Each namespaces has it's own view so semantically it's not
> shared. But the initial fan out of the hash table 2M or something
> isn't something we want to replicate on a per namespace basis even
> assuming the huge page allocations could happen.
>
> So we just tag the entries and add the network namespace as one more
> part of the key when doing hash table look ups.
I can wait for the patches, but I would be interested in how
GC is performed and whether limits can be configured per
namespace.
next prev parent reply other threads:[~2007-06-23 18:01 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-22 19:39 [RFD] L2 Network namespace infrastructure Eric W. Biederman
2007-06-22 21:22 ` [PATCH] net: Basic network " Eric W. Biederman
2007-06-23 10:40 ` [RFD] L2 Network " Patrick McHardy
2007-06-23 15:20 ` Ben Greear
2007-06-23 17:26 ` Eric W. Biederman
2007-06-23 20:09 ` Ben Greear
2007-06-23 20:39 ` Eric W. Biederman
2007-06-23 20:44 ` Ben Greear
2007-06-23 17:26 ` Stephen Hemminger
2007-06-23 17:55 ` Eric W. Biederman
2007-06-23 20:03 ` Ben Greear
2007-06-27 14:41 ` [Devel] " Kirill Korotaev
2007-06-23 17:19 ` Eric W. Biederman
2007-06-23 18:00 ` Patrick McHardy [this message]
2007-06-23 19:08 ` Eric W. Biederman
2007-06-23 20:19 ` Carl-Daniel Hailfinger
2007-06-23 20:31 ` Eric W. Biederman
2007-06-23 20:57 ` David Miller
2007-06-23 21:22 ` Benny Amorsen
2007-06-24 5:39 ` David Miller
2007-06-23 21:41 ` Eric W. Biederman
2007-06-24 5:45 ` David Miller
2007-06-24 12:58 ` Eric W. Biederman
2007-06-25 2:39 ` David Miller
2007-06-26 15:32 ` Eric W. Biederman
2007-06-23 22:15 ` Jeff Garzik
2007-06-23 22:56 ` Eric W. Biederman
2007-06-24 1:28 ` Jeff Garzik
2007-06-25 15:23 ` Serge E. Hallyn
2007-06-27 15:38 ` [Devel] " Kirill Korotaev
2007-06-24 5:48 ` David Miller
2007-06-24 10:25 ` Benny Amorsen
2007-06-24 12:38 ` Eric W. Biederman
2007-06-25 15:11 ` Serge E. Hallyn
2007-06-28 14:53 ` Kirill Korotaev
2007-06-27 14:39 ` [Devel] " Kirill Korotaev
2007-06-27 14:45 ` Patrick McHardy
2007-06-27 14:56 ` Ben Greear
2007-06-28 13:12 ` Kirill Korotaev
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=467D5FCD.4080003@trash.net \
--to=kaber@trash.net \
--cc=containers@lists.osdl.org \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=greearb@candelatech.com \
--cc=hadi@cyberus.ca \
--cc=jeff@garzik.org \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.org \
--cc=yoshfuji@linux-ipv6.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).