diff options
author | Tomasz Grobelny <tomasz@grobelny.oswiecenia.net> | 2008-09-04 01:30:19 -0400 |
---|---|---|
committer | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-09-04 01:45:39 -0400 |
commit | d6da3511d6b558d0b017777b61dc08b8fbc06ea4 (patch) | |
tree | 473f9131b9e641d803bfbea174cf1dfc45aea3ca /Documentation/networking | |
parent | ddab05568eaa70fc92b2aae957136f188f724e9c (diff) |
dccp: Policy-based packet dequeueing infrastructure
This patch adds a generic infrastructure for policy-based dequeueing of
TX packets and provides two policies:
* a simple FIFO policy (which is the default) and
* a priority based policy (set via socket options).
Both policies honour the tx_qlen sysctl for the maximum size of the write
queue (can be overridden via socket options).
The priority policy uses skb->priority internally to assign an u32 priority
identifier, using the same ranking as SO_PRIORITY. The skb->priority field
is set to 0 when the packet leaves DCCP. The priority is supplied as ancillary
data using cmsg(3), the patch also provides the requisite parsing routines.
Signed-off-by: Tomasz Grobelny <tomasz@grobelny.oswiecenia.net>
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Diffstat (limited to 'Documentation/networking')
-rw-r--r-- | Documentation/networking/dccp.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Documentation/networking/dccp.txt b/Documentation/networking/dccp.txt index b132e4a3cf0f..fcfc12534428 100644 --- a/Documentation/networking/dccp.txt +++ b/Documentation/networking/dccp.txt | |||
@@ -45,6 +45,25 @@ http://linux-net.osdl.org/index.php/DCCP_Testing#Experimental_DCCP_source_tree | |||
45 | 45 | ||
46 | Socket options | 46 | Socket options |
47 | ============== | 47 | ============== |
48 | DCCP_SOCKOPT_QPOLICY_ID sets the dequeuing policy for outgoing packets. It takes | ||
49 | a policy ID as argument and can only be set before the connection (i.e. changes | ||
50 | during an established connection are not supported). Currently, two policies are | ||
51 | defined: the "simple" policy (DCCPQ_POLICY_SIMPLE), which does nothing special, | ||
52 | and a priority-based variant (DCCPQ_POLICY_PRIO). The latter allows to pass an | ||
53 | u32 priority value as ancillary data to sendmsg(), where higher numbers indicate | ||
54 | a higher packet priority (similar to SO_PRIORITY). This ancillary data needs to | ||
55 | be formatted using a cmsg(3) message header filled in as follows: | ||
56 | cmsg->cmsg_level = SOL_DCCP; | ||
57 | cmsg->cmsg_type = DCCP_SCM_PRIORITY; | ||
58 | cmsg->cmsg_len = CMSG_LEN(sizeof(uint32_t)); /* or CMSG_LEN(4) */ | ||
59 | |||
60 | DCCP_SOCKOPT_QPOLICY_TXQLEN sets the maximum length of the output queue. A zero | ||
61 | value is always interpreted as unbounded queue length. If different from zero, | ||
62 | the interpretation of this parameter depends on the current dequeuing policy | ||
63 | (see above): the "simple" policy will enforce a fixed queue size by returning | ||
64 | EAGAIN, whereas the "prio" policy enforces a fixed queue length by dropping the | ||
65 | lowest-priority packet first. The default value for this parameter is | ||
66 | initialised from /proc/sys/net/dccp/default/tx_qlen. | ||
48 | 67 | ||
49 | DCCP_SOCKOPT_SERVICE sets the service. The specification mandates use of | 68 | DCCP_SOCKOPT_SERVICE sets the service. The specification mandates use of |
50 | service codes (RFC 4340, sec. 8.1.2); if this socket option is not set, | 69 | service codes (RFC 4340, sec. 8.1.2); if this socket option is not set, |