1 .\" $OpenBSD: altq.9,v 1.4 2001/07/12 12:41:42 itojun Exp $
2 .\" $NetBSD: altq.9,v 1.14 2007/06/24 19:26:58 rumble Exp $
5 .\" Sony Computer Science Laboratories Inc. All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY SONY CSL AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL SONY CSL OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .Nd kernel interfaces for manipulating output queues on network interfaces
40 .Fn ifq_enqueue "struct ifaltq *_ifq" "struct mbuf *_m" "struct altq_pktattr *_pa"
42 .Fn ifq_handoff "struct ifnet *_ifp" "struct mbuf *_m" "struct altq_pktattr *_pa"
44 .Fn ifq_dequeue "struct ifaltq *_ifq" "struct mbuf *_mpolled"
46 .Fn ifq_poll "struct ifaltq *_ifq"
48 .Fn ifq_purge "struct ifaltq *_ifq"
50 .Fn ifq_classify "struct ifaltq *_ifq" "struct mbuf *_m" "uint8_t _af" "struct altq_pktattr *_pa"
52 .Fn ifq_is_empty "struct ifaltq *_ifq"
54 .Fn ifq_set_maxlen "struct ifaltq *_ifq" "int _len"
56 .Fn ifq_set_ready "struct ifaltq *_ifq"
58 .Fn ifq_is_enabled "struct ifaltq *_ifq"
62 system is a framework to manage queueing disciplines on network
65 introduces new functions to manipulate output queues.
66 The output queue functions are used to abstract queue operations and not to
67 touch the internal fields of the output queue structure.
76 The underlying queueing discipline may discard the packet.
77 They return 0 on success, or
79 if the packet is discarded.
80 The packet pointed to by
82 will be freed by the device driver on success or by the queueing discipline on
83 failure, so that the caller should not touch
88 combines the enqueue operation with statistic generation and calls
90 upon successful enqueue to initiate the actual send.
93 dequeues a packet from the queue.
94 It returns the dequeued packet, or
96 if no packet is dequeued.
97 The caller must always check the return value
98 since a non-empty queue could return
103 returns the next packet without removing it from the queue.
104 It is guaranteed by the underlying queueing discipline that
108 returns the same packet.
111 discards all the packets in the queue.
112 The purge operation is needed since a non-work conserving queue cannot be
113 emptied by a dequeue loop.
116 classifies a packet to a scheduling class, and returns the result in
120 can be used to check if the queue is empty.
125 if the queueing discipline is non-work conserving.
128 sets the queue length limit to the default FIFO queue.
131 sets a flag to indicate that this driver is converted to use the new macros.
133 can be enabled only on interfaces with this flag.
138 is enabled for the queue, 0 if not.
139 .Sh QUEUEING DISCIPLINES
140 Queueing disciplines need to maintain
146 Queueing disciplines also need to guarantee that the same mbuf is returned if
148 is called immediately after
158 system first appeared in March 1997 and was imported into