From: Daniel Lezcano <dlezcano@fr.ibm.com>
To: Pavel Emelyanov <xemul@openvz.org>
Cc: David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, den@openvz.org,
"Eric W. Biederman" <ebiederm@xmission.com>,
Linux Containers <containers@lists.osdl.org>
Subject: Re: [PATCH 0/4] MIB: add struct net to UDP accounting macros
Date: Mon, 07 Jul 2008 12:19:03 +0200 [thread overview]
Message-ID: <4871ED97.70806@fr.ibm.com> (raw)
In-Reply-To: <4871D027.4070504@openvz.org>
Pavel Emelyanov wrote:
> David Miller wrote:
>> From: Pavel Emelyanov <xemul@openvz.org>
>> Date: Fri, 04 Jul 2008 15:58:44 +0400
>>
>>> This is the first small set of MIB statistics netnsization. The easiest
>>> case is UDP stats, so I started with this one. If this set is accepted,
>>> I will go on step-by-step with adding struct net to all the other stats'
>>> accounting macros, then SNMP_XXX ones and finish with a set than will put
>>> the stats on the struct net and fix appropriate proc files.
>>>
>>> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
>>> Acked-by: Denis V. Lunev <den@openvz.org>
>> Applied, thanks Pavel.
>>
>> Are we going to provide some way for an administrator to fetch
>> stats from the perspective of all namespaces? I know the idea
>> is seperation with this stuff, but admins are going to want
>> something like that.
>
> Well, if we want to get the stats for each namespace separately, then
> this ability is already present. Since this statistics is shown via the
> /proc/net files and the /proc/net itself is seen via the /proc/<pid>/net,
> then we can walk the init-s of all the containers in the system and dump
> this info.
>
> The problem that is to be solved with this approach is how to get these
> init-s :) But since finding any namespace by some task living in it is a
> common practice now (netdev moving, sys_hijack) this one will be solved.
>
> BTW, are there some plans about implementing some netlink-based fetcher
> of this statistics? If so, then I think it's worth making this engine
> namespaces aware from the very beginning.
Shouldn't be interesting to handle the network namespaces directly with
the iproute command ?
* ip netns add <name>
* ip netns del <name>
* ip netns <oldname> set name <newname>
* ip netns show
When a network namespace is created via clone|unshare, the name is
automatically the pid of the creator.
In order to track the namespace, we can add an entry in /proc/net (aka
/proc/<pid>/net) named "name" which contains the name of the namespace.
I heard Eric is thinking about a netnsfs.
From a larger perspective, the iproute command with a new "netns"
subcommand can be enhanced to have more features, for example the freeze
and resume for the network.
* ip netns set down <name>
* ip netns set up <name>
So having the netns binded, we can plug the known subcommand (link, ip,
...) with the netns features. For examples:
* ip addr add 1.2.3.4/24 dev eth0 netns foo
next prev parent reply other threads:[~2008-07-07 10:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-04 11:58 [PATCH 0/4] MIB: add struct net to UDP accounting macros Pavel Emelyanov
2008-07-04 12:00 ` [PATCH net-next-2.6 1/4] MIB: add struct net to UDP_INC_STATS_USER Pavel Emelyanov
2008-07-04 12:02 ` [PATCH 2/4] MIB: add struct net to UDP_INC_STATS_BH Pavel Emelyanov
2008-07-04 12:03 ` [PATCH net-next 3/4] MIB: add struct net to UDP6_INC_STATS_USER Pavel Emelyanov
2008-07-04 12:04 ` [PATCH 4/4] MIB: add struct net to UDP6_INC_STATS_BH Pavel Emelyanov
2008-07-06 4:21 ` [PATCH 0/4] MIB: add struct net to UDP accounting macros David Miller
2008-07-07 8:13 ` Pavel Emelyanov
2008-07-07 8:47 ` David Miller
2008-07-10 11:04 ` Thomas Graf
2008-07-07 10:19 ` Daniel Lezcano [this message]
2008-07-07 11:54 ` Global namespace naming, and monitoring 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=4871ED97.70806@fr.ibm.com \
--to=dlezcano@fr.ibm.com \
--cc=containers@lists.osdl.org \
--cc=davem@davemloft.net \
--cc=den@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 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).