Subject: Re: [PATCH] pkt_sched: Control group classifier

From: Thomas Graf <[email-masked]>
Date: Tue, 14 Oct 2008 19:03:31 +0200

* Chei-yol Kim <[email-masked]> 2008-10-14 11:56
> Thomas Graf <tgraf <at> suug.ch> writes:
> 
> > 
> > This patch implements a very basic cgroup subsystem which allows
> > assigning classids to cgroups. It also adds a trivial classifier
> > to filter packets based on that classid and map them to classes.
> > 
> 
> In order to test your patch, I need more programs such as iproute-x.x.x 
> package modified for using your cgroup classifier.
> You seem to test your code now. Please send me additional code and patch for 
> testing environments.

Here is an example of how to use it:

mkdir -p /dev/cgroup
mount -t cgroup net_cls -onet_cls /dev/cgroup
mkdir /dev/cgroup/foo

# packets in cgroup foo go to class 10:1
echo 0xA0001 > /dev/cgroup/foo/net_cls.classid

tc qdisc add dev eth0 root handle 10: htb
tc class add dev eth0 parent 10:0 classid 10:1 htb rate 10mbit
tc class add dev eth0 parent 10:0 classid 10:2 htb rate 10mbit

# cgroup filter -> 10:X
tc filter add dev eth0 parent 10: protocol ip prio 10 handle 20: cgroup
# everything else -> 10:1
tc filter add dev eth0 parent 10: protocol ip prio 20 basic classid 10:2