Deleted Added
full compact
altq_hfsc.h (247830) altq_hfsc.h (281613)
1/* $KAME: altq_hfsc.h,v 1.12 2003/12/05 05:40:46 kjc Exp $ */
2
3/*
1/*-
4 * Copyright (c) 1997-1999 Carnegie Mellon University. All Rights Reserved.
5 *
6 * Permission to use, copy, modify, and distribute this software and
7 * its documentation is hereby granted (including for commercial or
8 * for-profit use), provided that both the copyright notice and this
9 * permission notice appear in all copies of the software, derivative
10 * works, or modified versions, and any portions thereof.
11 *
12 * THIS SOFTWARE IS EXPERIMENTAL AND IS KNOWN TO HAVE BUGS, SOME OF
13 * WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON PROVIDES THIS
14 * SOFTWARE IN ITS ``AS IS'' CONDITION, AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 * DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
20 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
21 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
24 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
25 * DAMAGE.
26 *
27 * Carnegie Mellon encourages (but does not require) users of this
28 * software to return any improvements or extensions that they make,
29 * and to grant Carnegie Mellon the rights to redistribute these
30 * changes without encumbrance.
2 * Copyright (c) 1997-1999 Carnegie Mellon University. All Rights Reserved.
3 *
4 * Permission to use, copy, modify, and distribute this software and
5 * its documentation is hereby granted (including for commercial or
6 * for-profit use), provided that both the copyright notice and this
7 * permission notice appear in all copies of the software, derivative
8 * works, or modified versions, and any portions thereof.
9 *
10 * THIS SOFTWARE IS EXPERIMENTAL AND IS KNOWN TO HAVE BUGS, SOME OF
11 * WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON PROVIDES THIS
12 * SOFTWARE IN ITS ``AS IS'' CONDITION, AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
14 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15 * DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
16 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
18 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
19 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
20 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
22 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
23 * DAMAGE.
24 *
25 * Carnegie Mellon encourages (but does not require) users of this
26 * software to return any improvements or extensions that they make,
27 * and to grant Carnegie Mellon the rights to redistribute these
28 * changes without encumbrance.
29 *
30 * $KAME: altq_hfsc.h,v 1.12 2003/12/05 05:40:46 kjc Exp $
31 * $FreeBSD: head/sys/net/altq/altq_hfsc.h 281613 2015-04-16 20:22:40Z glebius $
31 */
32#ifndef _ALTQ_ALTQ_HFSC_H_
33#define _ALTQ_ALTQ_HFSC_H_
34
32 */
33#ifndef _ALTQ_ALTQ_HFSC_H_
34#define _ALTQ_ALTQ_HFSC_H_
35
35#include
36#include
37#include
38#include
36#include <net/altq/altq.h>
37#include <net/altq/altq_classq.h>
38#include <net/altq/altq_red.h>
39#include <net/altq/altq_rio.h>
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44struct service_curve {
45 u_int m1; /* slope of the first segment in bits/sec */
46 u_int d; /* the x-projection of the first segment in msec */
47 u_int m2; /* slope of the second segment in bits/sec */
48};
49
50/* special class handles */
51#define HFSC_NULLCLASS_HANDLE 0
52#define HFSC_MAX_CLASSES 64
53
54/* hfsc class flags */
55#define HFCF_RED 0x0001 /* use RED */
56#define HFCF_ECN 0x0002 /* use RED/ECN */
57#define HFCF_RIO 0x0004 /* use RIO */
58#define HFCF_CLEARDSCP 0x0010 /* clear diffserv codepoint */
59#define HFCF_DEFAULTCLASS 0x1000 /* default class */
60
61/* service curve types */
62#define HFSC_REALTIMESC 1
63#define HFSC_LINKSHARINGSC 2
64#define HFSC_UPPERLIMITSC 4
65#define HFSC_DEFAULTSC (HFSC_REALTIMESC|HFSC_LINKSHARINGSC)
66
67struct hfsc_classstats {
68 u_int class_id;
69 u_int32_t class_handle;
70 struct service_curve rsc;
71 struct service_curve fsc;
72 struct service_curve usc; /* upper limit service curve */
73
74 u_int64_t total; /* total work in bytes */
75 u_int64_t cumul; /* cumulative work in bytes
76 done by real-time criteria */
77 u_int64_t d; /* deadline */
78 u_int64_t e; /* eligible time */
79 u_int64_t vt; /* virtual time */
80 u_int64_t f; /* fit time for upper-limit */
81
82 /* info helpful for debugging */
83 u_int64_t initvt; /* init virtual time */
84 u_int64_t vtoff; /* cl_vt_ipoff */
85 u_int64_t cvtmax; /* cl_maxvt */
86 u_int64_t myf; /* cl_myf */
87 u_int64_t cfmin; /* cl_mincf */
88 u_int64_t cvtmin; /* cl_mincvt */
89 u_int64_t myfadj; /* cl_myfadj */
90 u_int64_t vtadj; /* cl_vtadj */
91 u_int64_t cur_time;
92 u_int32_t machclk_freq;
93
94 u_int qlength;
95 u_int qlimit;
96 struct pktcntr xmit_cnt;
97 struct pktcntr drop_cnt;
98 u_int period;
99
100 u_int vtperiod; /* vt period sequence no */
101 u_int parentperiod; /* parent's vt period seqno */
102 int nactive; /* number of active children */
103
104 /* red and rio related info */
105 int qtype;
106 struct redstats red[3];
107};
108
109#ifdef ALTQ3_COMPAT
110struct hfsc_interface {
111 char hfsc_ifname[IFNAMSIZ]; /* interface name (e.g., fxp0) */
112};
113
114struct hfsc_attach {
115 struct hfsc_interface iface;
116 u_int bandwidth; /* link bandwidth in bits/sec */
117};
118
119struct hfsc_add_class {
120 struct hfsc_interface iface;
121 u_int32_t parent_handle;
122 struct service_curve service_curve;
123 int qlimit;
124 int flags;
125
126 u_int32_t class_handle; /* return value */
127};
128
129struct hfsc_delete_class {
130 struct hfsc_interface iface;
131 u_int32_t class_handle;
132};
133
134struct hfsc_modify_class {
135 struct hfsc_interface iface;
136 u_int32_t class_handle;
137 struct service_curve service_curve;
138 int sctype;
139};
140
141struct hfsc_add_filter {
142 struct hfsc_interface iface;
143 u_int32_t class_handle;
144 struct flow_filter filter;
145
146 u_long filter_handle; /* return value */
147};
148
149struct hfsc_delete_filter {
150 struct hfsc_interface iface;
151 u_long filter_handle;
152};
153
154struct hfsc_class_stats {
155 struct hfsc_interface iface;
156 int nskip; /* skip # of classes */
157 int nclasses; /* # of class stats (WR) */
158 u_int64_t cur_time; /* current time */
159 u_int32_t machclk_freq; /* machine clock frequency */
160 u_int hif_classes; /* # of classes in the tree */
161 u_int hif_packets; /* # of packets in the tree */
162 struct hfsc_classstats *stats; /* pointer to stats array */
163};
164
165#define HFSC_IF_ATTACH _IOW('Q', 1, struct hfsc_attach)
166#define HFSC_IF_DETACH _IOW('Q', 2, struct hfsc_interface)
167#define HFSC_ENABLE _IOW('Q', 3, struct hfsc_interface)
168#define HFSC_DISABLE _IOW('Q', 4, struct hfsc_interface)
169#define HFSC_CLEAR_HIERARCHY _IOW('Q', 5, struct hfsc_interface)
170#define HFSC_ADD_CLASS _IOWR('Q', 7, struct hfsc_add_class)
171#define HFSC_DEL_CLASS _IOW('Q', 8, struct hfsc_delete_class)
172#define HFSC_MOD_CLASS _IOW('Q', 9, struct hfsc_modify_class)
173#define HFSC_ADD_FILTER _IOWR('Q', 10, struct hfsc_add_filter)
174#define HFSC_DEL_FILTER _IOW('Q', 11, struct hfsc_delete_filter)
175#define HFSC_GETSTATS _IOWR('Q', 12, struct hfsc_class_stats)
176#endif /* ALTQ3_COMPAT */
177
178#ifdef _KERNEL
179/*
180 * kernel internal service curve representation
181 * coordinates are given by 64 bit unsigned integers.
182 * x-axis: unit is clock count. for the intel x86 architecture,
183 * the raw Pentium TSC (Timestamp Counter) value is used.
184 * virtual time is also calculated in this time scale.
185 * y-axis: unit is byte.
186 *
187 * the service curve parameters are converted to the internal
188 * representation.
189 * the slope values are scaled to avoid overflow.
190 * the inverse slope values as well as the y-projection of the 1st
191 * segment are kept in order to to avoid 64-bit divide operations
192 * that are expensive on 32-bit architectures.
193 *
194 * note: Intel Pentium TSC never wraps around in several thousands of years.
195 * x-axis doesn't wrap around for 1089 years with 1GHz clock.
196 * y-axis doesn't wrap around for 4358 years with 1Gbps bandwidth.
197 */
198
199/* kernel internal representation of a service curve */
200struct internal_sc {
201 u_int64_t sm1; /* scaled slope of the 1st segment */
202 u_int64_t ism1; /* scaled inverse-slope of the 1st segment */
203 u_int64_t dx; /* the x-projection of the 1st segment */
204 u_int64_t dy; /* the y-projection of the 1st segment */
205 u_int64_t sm2; /* scaled slope of the 2nd segment */
206 u_int64_t ism2; /* scaled inverse-slope of the 2nd segment */
207};
208
209/* runtime service curve */
210struct runtime_sc {
211 u_int64_t x; /* current starting position on x-axis */
212 u_int64_t y; /* current starting position on x-axis */
213 u_int64_t sm1; /* scaled slope of the 1st segment */
214 u_int64_t ism1; /* scaled inverse-slope of the 1st segment */
215 u_int64_t dx; /* the x-projection of the 1st segment */
216 u_int64_t dy; /* the y-projection of the 1st segment */
217 u_int64_t sm2; /* scaled slope of the 2nd segment */
218 u_int64_t ism2; /* scaled inverse-slope of the 2nd segment */
219};
220
221struct hfsc_class {
222 u_int cl_id; /* class id (just for debug) */
223 u_int32_t cl_handle; /* class handle */
224 struct hfsc_if *cl_hif; /* back pointer to struct hfsc_if */
225 int cl_flags; /* misc flags */
226
227 struct hfsc_class *cl_parent; /* parent class */
228 struct hfsc_class *cl_siblings; /* sibling classes */
229 struct hfsc_class *cl_children; /* child classes */
230
231 class_queue_t *cl_q; /* class queue structure */
232 struct red *cl_red; /* RED state */
233 struct altq_pktattr *cl_pktattr; /* saved header used by ECN */
234
235 u_int64_t cl_total; /* total work in bytes */
236 u_int64_t cl_cumul; /* cumulative work in bytes
237 done by real-time criteria */
238 u_int64_t cl_d; /* deadline */
239 u_int64_t cl_e; /* eligible time */
240 u_int64_t cl_vt; /* virtual time */
241 u_int64_t cl_f; /* time when this class will fit for
242 link-sharing, max(myf, cfmin) */
243 u_int64_t cl_myf; /* my fit-time (as calculated from this
244 class's own upperlimit curve) */
245 u_int64_t cl_myfadj; /* my fit-time adjustment
246 (to cancel history dependence) */
247 u_int64_t cl_cfmin; /* earliest children's fit-time (used
248 with cl_myf to obtain cl_f) */
249 u_int64_t cl_cvtmin; /* minimal virtual time among the
250 children fit for link-sharing
251 (monotonic within a period) */
252 u_int64_t cl_vtadj; /* intra-period cumulative vt
253 adjustment */
254 u_int64_t cl_vtoff; /* inter-period cumulative vt offset */
255 u_int64_t cl_cvtmax; /* max child's vt in the last period */
256
257 u_int64_t cl_initvt; /* init virtual time (for debugging) */
258
259 struct internal_sc *cl_rsc; /* internal real-time service curve */
260 struct internal_sc *cl_fsc; /* internal fair service curve */
261 struct internal_sc *cl_usc; /* internal upperlimit service curve */
262 struct runtime_sc cl_deadline; /* deadline curve */
263 struct runtime_sc cl_eligible; /* eligible curve */
264 struct runtime_sc cl_virtual; /* virtual curve */
265 struct runtime_sc cl_ulimit; /* upperlimit curve */
266
267 u_int cl_vtperiod; /* vt period sequence no */
268 u_int cl_parentperiod; /* parent's vt period seqno */
269 int cl_nactive; /* number of active children */
270
271 TAILQ_HEAD(acthead, hfsc_class) cl_actc; /* active children list */
272 TAILQ_ENTRY(hfsc_class) cl_actlist; /* active children list entry */
273 TAILQ_ENTRY(hfsc_class) cl_ellist; /* eligible list entry */
274
275 struct {
276 struct pktcntr xmit_cnt;
277 struct pktcntr drop_cnt;
278 u_int period;
279 } cl_stats;
280};
281
282/*
283 * hfsc interface state
284 */
285struct hfsc_if {
286 struct hfsc_if *hif_next; /* interface state list */
287 struct ifaltq *hif_ifq; /* backpointer to ifaltq */
288 struct hfsc_class *hif_rootclass; /* root class */
289 struct hfsc_class *hif_defaultclass; /* default class */
290 struct hfsc_class *hif_class_tbl[HFSC_MAX_CLASSES];
291 struct hfsc_class *hif_pollcache; /* cache for poll operation */
292
293 u_int hif_classes; /* # of classes in the tree */
294 u_int hif_packets; /* # of packets in the tree */
295 u_int hif_classid; /* class id sequence number */
296
297 TAILQ_HEAD(elighead, hfsc_class) hif_eligible; /* eligible list */
298
299#ifdef ALTQ3_CLFIER_COMPAT
300 struct acc_classifier hif_classifier;
301#endif
302};
303
304#endif /* _KERNEL */
305
306#ifdef __cplusplus
307}
308#endif
309
310#endif /* _ALTQ_ALTQ_HFSC_H_ */
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45struct service_curve {
46 u_int m1; /* slope of the first segment in bits/sec */
47 u_int d; /* the x-projection of the first segment in msec */
48 u_int m2; /* slope of the second segment in bits/sec */
49};
50
51/* special class handles */
52#define HFSC_NULLCLASS_HANDLE 0
53#define HFSC_MAX_CLASSES 64
54
55/* hfsc class flags */
56#define HFCF_RED 0x0001 /* use RED */
57#define HFCF_ECN 0x0002 /* use RED/ECN */
58#define HFCF_RIO 0x0004 /* use RIO */
59#define HFCF_CLEARDSCP 0x0010 /* clear diffserv codepoint */
60#define HFCF_DEFAULTCLASS 0x1000 /* default class */
61
62/* service curve types */
63#define HFSC_REALTIMESC 1
64#define HFSC_LINKSHARINGSC 2
65#define HFSC_UPPERLIMITSC 4
66#define HFSC_DEFAULTSC (HFSC_REALTIMESC|HFSC_LINKSHARINGSC)
67
68struct hfsc_classstats {
69 u_int class_id;
70 u_int32_t class_handle;
71 struct service_curve rsc;
72 struct service_curve fsc;
73 struct service_curve usc; /* upper limit service curve */
74
75 u_int64_t total; /* total work in bytes */
76 u_int64_t cumul; /* cumulative work in bytes
77 done by real-time criteria */
78 u_int64_t d; /* deadline */
79 u_int64_t e; /* eligible time */
80 u_int64_t vt; /* virtual time */
81 u_int64_t f; /* fit time for upper-limit */
82
83 /* info helpful for debugging */
84 u_int64_t initvt; /* init virtual time */
85 u_int64_t vtoff; /* cl_vt_ipoff */
86 u_int64_t cvtmax; /* cl_maxvt */
87 u_int64_t myf; /* cl_myf */
88 u_int64_t cfmin; /* cl_mincf */
89 u_int64_t cvtmin; /* cl_mincvt */
90 u_int64_t myfadj; /* cl_myfadj */
91 u_int64_t vtadj; /* cl_vtadj */
92 u_int64_t cur_time;
93 u_int32_t machclk_freq;
94
95 u_int qlength;
96 u_int qlimit;
97 struct pktcntr xmit_cnt;
98 struct pktcntr drop_cnt;
99 u_int period;
100
101 u_int vtperiod; /* vt period sequence no */
102 u_int parentperiod; /* parent's vt period seqno */
103 int nactive; /* number of active children */
104
105 /* red and rio related info */
106 int qtype;
107 struct redstats red[3];
108};
109
110#ifdef ALTQ3_COMPAT
111struct hfsc_interface {
112 char hfsc_ifname[IFNAMSIZ]; /* interface name (e.g., fxp0) */
113};
114
115struct hfsc_attach {
116 struct hfsc_interface iface;
117 u_int bandwidth; /* link bandwidth in bits/sec */
118};
119
120struct hfsc_add_class {
121 struct hfsc_interface iface;
122 u_int32_t parent_handle;
123 struct service_curve service_curve;
124 int qlimit;
125 int flags;
126
127 u_int32_t class_handle; /* return value */
128};
129
130struct hfsc_delete_class {
131 struct hfsc_interface iface;
132 u_int32_t class_handle;
133};
134
135struct hfsc_modify_class {
136 struct hfsc_interface iface;
137 u_int32_t class_handle;
138 struct service_curve service_curve;
139 int sctype;
140};
141
142struct hfsc_add_filter {
143 struct hfsc_interface iface;
144 u_int32_t class_handle;
145 struct flow_filter filter;
146
147 u_long filter_handle; /* return value */
148};
149
150struct hfsc_delete_filter {
151 struct hfsc_interface iface;
152 u_long filter_handle;
153};
154
155struct hfsc_class_stats {
156 struct hfsc_interface iface;
157 int nskip; /* skip # of classes */
158 int nclasses; /* # of class stats (WR) */
159 u_int64_t cur_time; /* current time */
160 u_int32_t machclk_freq; /* machine clock frequency */
161 u_int hif_classes; /* # of classes in the tree */
162 u_int hif_packets; /* # of packets in the tree */
163 struct hfsc_classstats *stats; /* pointer to stats array */
164};
165
166#define HFSC_IF_ATTACH _IOW('Q', 1, struct hfsc_attach)
167#define HFSC_IF_DETACH _IOW('Q', 2, struct hfsc_interface)
168#define HFSC_ENABLE _IOW('Q', 3, struct hfsc_interface)
169#define HFSC_DISABLE _IOW('Q', 4, struct hfsc_interface)
170#define HFSC_CLEAR_HIERARCHY _IOW('Q', 5, struct hfsc_interface)
171#define HFSC_ADD_CLASS _IOWR('Q', 7, struct hfsc_add_class)
172#define HFSC_DEL_CLASS _IOW('Q', 8, struct hfsc_delete_class)
173#define HFSC_MOD_CLASS _IOW('Q', 9, struct hfsc_modify_class)
174#define HFSC_ADD_FILTER _IOWR('Q', 10, struct hfsc_add_filter)
175#define HFSC_DEL_FILTER _IOW('Q', 11, struct hfsc_delete_filter)
176#define HFSC_GETSTATS _IOWR('Q', 12, struct hfsc_class_stats)
177#endif /* ALTQ3_COMPAT */
178
179#ifdef _KERNEL
180/*
181 * kernel internal service curve representation
182 * coordinates are given by 64 bit unsigned integers.
183 * x-axis: unit is clock count. for the intel x86 architecture,
184 * the raw Pentium TSC (Timestamp Counter) value is used.
185 * virtual time is also calculated in this time scale.
186 * y-axis: unit is byte.
187 *
188 * the service curve parameters are converted to the internal
189 * representation.
190 * the slope values are scaled to avoid overflow.
191 * the inverse slope values as well as the y-projection of the 1st
192 * segment are kept in order to to avoid 64-bit divide operations
193 * that are expensive on 32-bit architectures.
194 *
195 * note: Intel Pentium TSC never wraps around in several thousands of years.
196 * x-axis doesn't wrap around for 1089 years with 1GHz clock.
197 * y-axis doesn't wrap around for 4358 years with 1Gbps bandwidth.
198 */
199
200/* kernel internal representation of a service curve */
201struct internal_sc {
202 u_int64_t sm1; /* scaled slope of the 1st segment */
203 u_int64_t ism1; /* scaled inverse-slope of the 1st segment */
204 u_int64_t dx; /* the x-projection of the 1st segment */
205 u_int64_t dy; /* the y-projection of the 1st segment */
206 u_int64_t sm2; /* scaled slope of the 2nd segment */
207 u_int64_t ism2; /* scaled inverse-slope of the 2nd segment */
208};
209
210/* runtime service curve */
211struct runtime_sc {
212 u_int64_t x; /* current starting position on x-axis */
213 u_int64_t y; /* current starting position on x-axis */
214 u_int64_t sm1; /* scaled slope of the 1st segment */
215 u_int64_t ism1; /* scaled inverse-slope of the 1st segment */
216 u_int64_t dx; /* the x-projection of the 1st segment */
217 u_int64_t dy; /* the y-projection of the 1st segment */
218 u_int64_t sm2; /* scaled slope of the 2nd segment */
219 u_int64_t ism2; /* scaled inverse-slope of the 2nd segment */
220};
221
222struct hfsc_class {
223 u_int cl_id; /* class id (just for debug) */
224 u_int32_t cl_handle; /* class handle */
225 struct hfsc_if *cl_hif; /* back pointer to struct hfsc_if */
226 int cl_flags; /* misc flags */
227
228 struct hfsc_class *cl_parent; /* parent class */
229 struct hfsc_class *cl_siblings; /* sibling classes */
230 struct hfsc_class *cl_children; /* child classes */
231
232 class_queue_t *cl_q; /* class queue structure */
233 struct red *cl_red; /* RED state */
234 struct altq_pktattr *cl_pktattr; /* saved header used by ECN */
235
236 u_int64_t cl_total; /* total work in bytes */
237 u_int64_t cl_cumul; /* cumulative work in bytes
238 done by real-time criteria */
239 u_int64_t cl_d; /* deadline */
240 u_int64_t cl_e; /* eligible time */
241 u_int64_t cl_vt; /* virtual time */
242 u_int64_t cl_f; /* time when this class will fit for
243 link-sharing, max(myf, cfmin) */
244 u_int64_t cl_myf; /* my fit-time (as calculated from this
245 class's own upperlimit curve) */
246 u_int64_t cl_myfadj; /* my fit-time adjustment
247 (to cancel history dependence) */
248 u_int64_t cl_cfmin; /* earliest children's fit-time (used
249 with cl_myf to obtain cl_f) */
250 u_int64_t cl_cvtmin; /* minimal virtual time among the
251 children fit for link-sharing
252 (monotonic within a period) */
253 u_int64_t cl_vtadj; /* intra-period cumulative vt
254 adjustment */
255 u_int64_t cl_vtoff; /* inter-period cumulative vt offset */
256 u_int64_t cl_cvtmax; /* max child's vt in the last period */
257
258 u_int64_t cl_initvt; /* init virtual time (for debugging) */
259
260 struct internal_sc *cl_rsc; /* internal real-time service curve */
261 struct internal_sc *cl_fsc; /* internal fair service curve */
262 struct internal_sc *cl_usc; /* internal upperlimit service curve */
263 struct runtime_sc cl_deadline; /* deadline curve */
264 struct runtime_sc cl_eligible; /* eligible curve */
265 struct runtime_sc cl_virtual; /* virtual curve */
266 struct runtime_sc cl_ulimit; /* upperlimit curve */
267
268 u_int cl_vtperiod; /* vt period sequence no */
269 u_int cl_parentperiod; /* parent's vt period seqno */
270 int cl_nactive; /* number of active children */
271
272 TAILQ_HEAD(acthead, hfsc_class) cl_actc; /* active children list */
273 TAILQ_ENTRY(hfsc_class) cl_actlist; /* active children list entry */
274 TAILQ_ENTRY(hfsc_class) cl_ellist; /* eligible list entry */
275
276 struct {
277 struct pktcntr xmit_cnt;
278 struct pktcntr drop_cnt;
279 u_int period;
280 } cl_stats;
281};
282
283/*
284 * hfsc interface state
285 */
286struct hfsc_if {
287 struct hfsc_if *hif_next; /* interface state list */
288 struct ifaltq *hif_ifq; /* backpointer to ifaltq */
289 struct hfsc_class *hif_rootclass; /* root class */
290 struct hfsc_class *hif_defaultclass; /* default class */
291 struct hfsc_class *hif_class_tbl[HFSC_MAX_CLASSES];
292 struct hfsc_class *hif_pollcache; /* cache for poll operation */
293
294 u_int hif_classes; /* # of classes in the tree */
295 u_int hif_packets; /* # of packets in the tree */
296 u_int hif_classid; /* class id sequence number */
297
298 TAILQ_HEAD(elighead, hfsc_class) hif_eligible; /* eligible list */
299
300#ifdef ALTQ3_CLFIER_COMPAT
301 struct acc_classifier hif_classifier;
302#endif
303};
304
305#endif /* _KERNEL */
306
307#ifdef __cplusplus
308}
309#endif
310
311#endif /* _ALTQ_ALTQ_HFSC_H_ */