Re: [RFC PATCH net-next] net: Add l3mdev cgroup

2 messages, 2 authors, 2016-01-04 · open the first message on its own page

Re: [RFC PATCH net-next] net: Add l3mdev cgroup

From: Tejun Heo <hidden>
Date: 2016-01-04 17:58:36

Hello, David.

On Mon, Jan 04, 2016 at 08:32:16AM -0800, David Ahern wrote:
Add cgroup to assoicate tasks with L3 networking domains. AF_INET{6}
sockets opened by tasks associated with an l3mdev cgroup are bound to
the associated master device when the socket is created. This allows a
user to run a command (and its children) within an L3 networking context.

The master-device for an l3mdev cgroup must be an L3 master device
(e.g., VRF), and it must be set before attaching tasks to the cgroup. Once
set the master-device can not change. Nested l3mdev cgroups are not
supported. The root (aka default) l3mdev cgroup can not be bound to a
master device.

Example:
    ip link add vrf-red type vrf table vrf-red
    ip link set dev vrf-red up
    ip link set dev eth1 master vrf-red

    cgcreate -g l3mdev:vrf-red
    cgset -r l3mdev.master-device=vrf-red vrf-red
    cgexec -g l3mdev:vrf-red bash
Please don't create any new controller whose sole purpose is
identifying group membership.  Please take a look at how libxt_cgroup
handles identification w/o creating a new controller.

 http://lkml.kernel.org/g/1449527935-27056-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

Thanks.

-- 
tejun

Re: [RFC PATCH net-next] net: Add l3mdev cgroup

From: David Ahern <hidden>
Date: 2016-01-04 18:53:58

Hi Tejun:

On 1/4/16 10:58 AM, Tejun Heo wrote:
Please don't create any new controller whose sole purpose is
identifying group membership.  Please take a look at how libxt_cgroup
handles identification w/o creating a new controller.

  http://lkml.kernel.org/g/1449527935-27056-1-git-send-email-tj@kernel.org
This controller applies a cgroup specific setting to tasks associated 
with an instance (similar to cpuset restricting tasks to specifics 
CPUs), so it is more than just identifying membership.

I looked at the commits referenced above and net/netfilter/xt_cgroup.c 
code in particular and I don't see how it applies to this use case. Can 
you elaborate?

Thanks,
David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help