diff options
author | Neil Horman <nhorman@tuxdriver.com> | 2011-11-22 00:10:52 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-22 15:22:23 -0500 |
commit | 3ee32fee65ef6a4a8a4188e913be7dd90ba9e058 (patch) | |
tree | 5d450d446498258decc755f65c77c9140102a132 /Documentation | |
parent | 5bc1421e34ecfe0bd4b26dc3232b7d5e25179144 (diff) |
net: add documentation for net_prio cgroups (v4)
Add the requisite documentation to explain to new users how net_prio cgroups work
Signed-off-by:Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
CC: Robert Love <robert.w.love@intel.com>
CC: "David S. Miller" <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/cgroups/net_prio.txt | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/Documentation/cgroups/net_prio.txt b/Documentation/cgroups/net_prio.txt new file mode 100644 index 000000000000..01b322635591 --- /dev/null +++ b/Documentation/cgroups/net_prio.txt | |||
@@ -0,0 +1,53 @@ | |||
1 | Network priority cgroup | ||
2 | ------------------------- | ||
3 | |||
4 | The Network priority cgroup provides an interface to allow an administrator to | ||
5 | dynamically set the priority of network traffic generated by various | ||
6 | applications | ||
7 | |||
8 | Nominally, an application would set the priority of its traffic via the | ||
9 | SO_PRIORITY socket option. This however, is not always possible because: | ||
10 | |||
11 | 1) The application may not have been coded to set this value | ||
12 | 2) The priority of application traffic is often a site-specific administrative | ||
13 | decision rather than an application defined one. | ||
14 | |||
15 | This cgroup allows an administrator to assign a process to a group which defines | ||
16 | the priority of egress traffic on a given interface. Network priority groups can | ||
17 | be created by first mounting the cgroup filesystem. | ||
18 | |||
19 | # mount -t cgroup -onet_prio none /sys/fs/cgroup/net_prio | ||
20 | |||
21 | With the above step, the initial group acting as the parent accounting group | ||
22 | becomes visible at '/sys/fs/cgroup/net_prio'. This group includes all tasks in | ||
23 | the system. '/sys/fs/cgroup/net_prio/tasks' lists the tasks in this cgroup. | ||
24 | |||
25 | Each net_prio cgroup contains two files that are subsystem specific | ||
26 | |||
27 | net_prio.prioidx | ||
28 | This file is read-only, and is simply informative. It contains a unique integer | ||
29 | value that the kernel uses as an internal representation of this cgroup. | ||
30 | |||
31 | net_prio.ifpriomap | ||
32 | This file contains a map of the priorities assigned to traffic originating from | ||
33 | processes in this group and egressing the system on various interfaces. It | ||
34 | contains a list of tuples in the form <ifname priority>. Contents of this file | ||
35 | can be modified by echoing a string into the file using the same tuple format. | ||
36 | for example: | ||
37 | |||
38 | echo "eth0 5" > /sys/fs/cgroups/net_prio/iscsi/net_prio.ifpriomap | ||
39 | |||
40 | This command would force any traffic originating from processes belonging to the | ||
41 | iscsi net_prio cgroup and egressing on interface eth0 to have the priority of | ||
42 | said traffic set to the value 5. The parent accounting group also has a | ||
43 | writeable 'net_prio.ifpriomap' file that can be used to set a system default | ||
44 | priority. | ||
45 | |||
46 | Priorities are set immediately prior to queueing a frame to the device | ||
47 | queueing discipline (qdisc) so priorities will be assigned prior to the hardware | ||
48 | queue selection being made. | ||
49 | |||
50 | One usage for the net_prio cgroup is with mqprio qdisc allowing application | ||
51 | traffic to be steered to hardware/driver based traffic classes. These mappings | ||
52 | can then be managed by administrators or other networking protocols such as | ||
53 | DCBX. | ||