Skip to contentSkip to conversation

Traffic control cgroups subsystem

PATCH In review Ranjit Manomohan 1 participant 1 message Sep 10, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Traffic control cgroups subsystem

This patch implements a filter that classifies packets based upon the cgroup_classid of the packet.

---

include/linux/pkt_cls.h +15 -0
index 99efbed..53348a3 100644
@@ -379,6 +379,21 @@ enum
 
 #define TCA_FLOW_MAX	(__TCA_FLOW_MAX - 1)
 
+/* Cgroups filter */
+
+enum {
+	TCA_CGROUP_UNSPEC,
+	TCA_CGROUP_CLASSID,
+	TCA_CGROUP_MASK,
+	TCA_CGROUP_VALUE,
+	TCA_CGROUP_ACT,
+	TCA_CGROUP_POLICE,
+	TCA_CGROUP_EMATCHES,
+	__TCA_CGROUP_MAX
+};
+
+#define TCA_CGROUP_MAX	(__TCA_CGROUP_MAX - 1)
+
 /* Basic filter */
 
 enum
net/sched/Kconfig +10 -0
index 82adfe6..844837f 100644
@@ -318,6 +318,16 @@ config NET_CLS_FLOW
 	  To compile this code as a module, choose M here: the
 	  module will be called cls_flow.
 
+config NET_CLS_CGROUP
+	tristate "Cgroups tc classifier"
+	select NET_CLS
+	---help---
+	  If you say Y here, you will be able to classify packets based on
+	  cgroup membership of the task originating the packet.
+
+	  To compile this code as a module, choose M here: the
+	  module will be called cls_cgroup.
+
 config NET_EMATCH
 	bool "Extended Matches"
 	select NET_CLS
net/sched/Makefile +1 -0
index 1d2b0f7..91e9ee0 100644
@@ -36,6 +36,7 @@ obj-$(CONFIG_NET_CLS_TCINDEX)	+= cls_tcindex.o
 obj-$(CONFIG_NET_CLS_RSVP6)	+= cls_rsvp6.o
 obj-$(CONFIG_NET_CLS_BASIC)	+= cls_basic.o
 obj-$(CONFIG_NET_CLS_FLOW)	+= cls_flow.o
+obj-$(CONFIG_NET_CLS_CGROUP)	+= cls_cgroup.o
 obj-$(CONFIG_NET_EMATCH)	+= ematch.o
 obj-$(CONFIG_NET_EMATCH_CMP)	+= em_cmp.o
 obj-$(CONFIG_NET_EMATCH_NBYTE)	+= em_nbyte.o
net/sched/cls_cgroup.c new file +330 -0

330 lines not on this page · raw message