From: Herbert Poetzl <herbert@13thfloor.at>
To: Andrey Savochkin <saw@swsoft.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
dlezcano@fr.ibm.com, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, serue@us.ibm.com, haveblue@us.ibm.com,
clg@fr.ibm.com, Andrew Morton <akpm@osdl.org>,
dev@sw.ru, devel@openvz.org, sam@vilain.net,
viro@ftp.linux.org.uk, Alexey Kuznetsov <alexey@sw.ru>
Subject: Re: Network namespaces a path to mergable code.
Date: Wed, 28 Jun 2006 19:40:06 +0200 [thread overview]
Message-ID: <20060628174005.GE6440@MAIL.13thfloor.at> (raw)
In-Reply-To: <20060628212240.A1833@castle.nmd.msu.ru>
On Wed, Jun 28, 2006 at 09:22:40PM +0400, Andrey Savochkin wrote:
> Hi Eric,
>
> On Wed, Jun 28, 2006 at 10:51:26AM -0600, Eric W. Biederman wrote:
> > Andrey Savochkin <saw@swsoft.com> writes:
> >
> > > One possible option to resolve this question is to show 2
> > > relatively short patches just introducing namespaces for sockets
> > > in 2 ways: with explicit function parameters and using implicit
> > > current context. Then people can compare them and vote. Do you
> > > think it's worth the effort?
> >
> > Given that we have two strong opinions in different directions I
> > think it is worth the effort to resolve this.
>
> Do you have time to extract necessary parts of your old patch? Or you
> aren't afraid of letting me draft an alternative version of socket
> namespaces basing on your code? :)
>
> > In a slightly different vein your second patch introduced a lot of
> > #ifdef CONFIG_NET_NS in C files. That is something we need to look
> > closely at.
> >
> > So I think the abstraction that we use to access per network
> > namespace variables needs some work if we are going to allow the
> > ability to compile out all of the namespace code. The explicit
> > versus implicit lookup is just one dimension of that problem.
> This is a good comment.
>
> Those ifdef's mostly correspond to places where we walk over lists and
> need to filter-out entities not belonging to a specific namespace.
> Those places about the same in your and my implementation. We can
> think what we can do with them. One trick that I used on several
> occasions is net_ns_same macro which doesn't evalute its arguments if
> CONFIG_NET_NS not defined, and thus can be used without ifdef's.
yes, I think almost all of those cases can be avoided
while making the code even more readable by using
proper preprocessor (or even inline) mechanisms
> Returning to implicit vs explicit function arguments, I belive that
> implicit arguments are more promising in having zero impact on the
> code when CONFIG_NET_NS is disabled. Functions like inet_addr_type
> will translate into exactly the same code as they did without net
> namespace patches.
maybe a preprocessor wrapper can help here too ...
> > >> I'm still curious why many of those chunks can't use existing helper
> > >> functions, to be cleaned up.
> > >
> > > What helper functions are you referring to?
> >
> > Basically most of the device list walker functions live in.
> > net/core/dev.c
> >
> > I don't know if the cases you fixed could have used any of those
> > helper functions but it certainly has me asking that question.
> >
> > A general pattern that happens in cleanups is the discovery
> > that code using an old interface in a problematic way really
> > could be done much better another way. I didn't dig enough
> > to see if that was the case in any of the code that you changed.
>
> Well, there is obvious improvement of this kind: many protocols walk
> over device list to find devices with non-NULL protocol specific
> pointers. For example, IPv6, decnet and others do it on module
> unloading to clean up. Those places just ask for some simpler standard
> way of doing it, but I wasn't bold enough for such radical change.
> Do you think I should try?
IMHO it could not hurt to have some kind of protocol
helper library functions or macros ...
best,
Herbert
> Best regards
>
> Andrey
next prev parent reply other threads:[~2006-06-28 17:40 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-26 9:49 [patch 1/4] Network namespaces: cleanup of dev_base list use Andrey Savochkin
2006-06-26 9:52 ` [patch 2/4] " Andrey Savochkin
2006-06-26 9:54 ` [patch 3/4] Network namespaces: IPv4 FIB/routing in namespaces Andrey Savochkin
2006-06-26 9:55 ` [patch 4/4] Network namespaces: playing and debugging Andrey Savochkin
2006-06-26 15:04 ` Daniel Lezcano
2006-06-26 15:43 ` Andrey Savochkin
2006-06-26 17:29 ` Daniel Lezcano
2006-06-26 19:34 ` Andrey Savochkin
2006-06-26 14:56 ` [patch 3/4] Network namespaces: IPv4 FIB/routing in namespaces Daniel Lezcano
2006-06-26 15:46 ` Andrey Savochkin
2006-06-26 15:57 ` Daniel Lezcano
2006-06-26 19:39 ` Andrey Savochkin
2006-06-26 20:05 ` Herbert Poetzl
2006-06-27 9:25 ` Andrey Savochkin
2006-06-28 13:51 ` Daniel Lezcano
2006-06-28 14:19 ` Herbert Poetzl
2006-06-28 14:30 ` Andrey Savochkin
2006-06-28 14:34 ` Kirill Korotaev
2006-06-28 16:56 ` Daniel Lezcano
2006-06-28 17:10 ` Ben Greear
2006-06-28 15:05 ` Eric W. Biederman
2006-06-26 15:13 ` [RFC][patch 1/4] Network namespaces: cleanup of dev_base list use Eric W. Biederman
2006-06-26 15:42 ` [patch " Andrey Savochkin
2006-06-26 16:26 ` Eric W. Biederman
2006-06-26 20:14 ` Andrey Savochkin
2006-06-26 21:02 ` Eric W. Biederman
2006-06-27 6:59 ` [RFC][patch " Kirill Korotaev
2006-06-27 11:13 ` Eric W. Biederman
2006-06-27 15:08 ` Kirill Korotaev
2006-06-27 15:26 ` Serge E. Hallyn
2006-06-27 16:54 ` Eric W. Biederman
2006-06-27 17:20 ` [RFC] Network namespaces a path to mergable code Eric W. Biederman
2006-06-27 17:58 ` Andrey Savochkin
2006-06-27 22:20 ` Sam Vilain
2006-06-28 4:33 ` Eric W. Biederman
2006-06-28 5:59 ` Abdallah Chatila
2006-06-28 6:19 ` Sam Vilain
2006-06-28 6:55 ` Eric W. Biederman
2006-06-28 9:54 ` Cedric Le Goater
2006-06-28 14:03 ` Eric W. Biederman
2006-06-28 14:15 ` Serge E. Hallyn
2006-06-28 14:56 ` Eric W. Biederman
2006-06-28 4:20 ` Eric W. Biederman
2006-06-28 11:06 ` Andrey Savochkin
2006-06-28 16:51 ` Eric W. Biederman
2006-06-28 17:22 ` Andrey Savochkin
2006-06-28 17:40 ` Herbert Poetzl [this message]
2006-06-28 17:50 ` Eric W. Biederman
2006-06-28 18:11 ` Eric W. Biederman
2006-06-28 18:14 ` Eric W. Biederman
2006-06-28 18:51 ` Andrey Savochkin
2006-06-28 21:53 ` Daniel Lezcano
2006-06-28 22:54 ` James Morris
2006-06-29 0:19 ` Eric W. Biederman
2006-06-29 0:25 ` Eric W. Biederman
2006-06-29 9:42 ` Daniel Lezcano
2006-06-28 10:20 ` [RFC] " Cedric Le Goater
2006-06-28 15:20 ` Eric W. Biederman
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=20060628174005.GE6440@MAIL.13thfloor.at \
--to=herbert@13thfloor.at \
--cc=akpm@osdl.org \
--cc=alexey@sw.ru \
--cc=clg@fr.ibm.com \
--cc=dev@sw.ru \
--cc=devel@openvz.org \
--cc=dlezcano@fr.ibm.com \
--cc=ebiederm@xmission.com \
--cc=haveblue@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sam@vilain.net \
--cc=saw@swsoft.com \
--cc=serue@us.ibm.com \
--cc=viro@ftp.linux.org.uk \
/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
all inboxes | Powered by JetHome®