Traffic control cgroups subsystem
Subsystems (3)
PATCH 2/2 Traffic control cgroups subsystem
This patch implements a filter that classifies packets based upon the cgroup_classid of the packet.
Signed-off-by Ranjit Manomohan <[email protected]>
---
include/linux/pkt_cls.h +15 -0
@@ -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
@@ -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
@@ -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