xref: /xnu-8792.81.2/bsd/net/classq/classq_fq_codel.h (revision 19c3b8c28c31cb8130e034cfb5df6bf9ba342d90)
1*19c3b8c2SApple OSS Distributions /*
2*19c3b8c2SApple OSS Distributions  * Copyright (c) 2016-2021 Apple Inc. All rights reserved.
3*19c3b8c2SApple OSS Distributions  *
4*19c3b8c2SApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5*19c3b8c2SApple OSS Distributions  *
6*19c3b8c2SApple OSS Distributions  * This file contains Original Code and/or Modifications of Original Code
7*19c3b8c2SApple OSS Distributions  * as defined in and that are subject to the Apple Public Source License
8*19c3b8c2SApple OSS Distributions  * Version 2.0 (the 'License'). You may not use this file except in
9*19c3b8c2SApple OSS Distributions  * compliance with the License. The rights granted to you under the License
10*19c3b8c2SApple OSS Distributions  * may not be used to create, or enable the creation or redistribution of,
11*19c3b8c2SApple OSS Distributions  * unlawful or unlicensed copies of an Apple operating system, or to
12*19c3b8c2SApple OSS Distributions  * circumvent, violate, or enable the circumvention or violation of, any
13*19c3b8c2SApple OSS Distributions  * terms of an Apple operating system software license agreement.
14*19c3b8c2SApple OSS Distributions  *
15*19c3b8c2SApple OSS Distributions  * Please obtain a copy of the License at
16*19c3b8c2SApple OSS Distributions  * http://www.opensource.apple.com/apsl/ and read it before using this file.
17*19c3b8c2SApple OSS Distributions  *
18*19c3b8c2SApple OSS Distributions  * The Original Code and all software distributed under the License are
19*19c3b8c2SApple OSS Distributions  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20*19c3b8c2SApple OSS Distributions  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21*19c3b8c2SApple OSS Distributions  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22*19c3b8c2SApple OSS Distributions  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23*19c3b8c2SApple OSS Distributions  * Please see the License for the specific language governing rights and
24*19c3b8c2SApple OSS Distributions  * limitations under the License.
25*19c3b8c2SApple OSS Distributions  *
26*19c3b8c2SApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27*19c3b8c2SApple OSS Distributions  */
28*19c3b8c2SApple OSS Distributions 
29*19c3b8c2SApple OSS Distributions #ifndef _NET_CLASSQ_CLASSQ_FQ_CODEL_H
30*19c3b8c2SApple OSS Distributions #define _NET_CLASSQ_CLASSQ_FQ_CODEL_H
31*19c3b8c2SApple OSS Distributions #ifdef PRIVATE
32*19c3b8c2SApple OSS Distributions #ifdef BSD_KERNEL_PRIVATE
33*19c3b8c2SApple OSS Distributions #include <stdbool.h>
34*19c3b8c2SApple OSS Distributions #include <sys/time.h>
35*19c3b8c2SApple OSS Distributions #include <net/flowadv.h>
36*19c3b8c2SApple OSS Distributions #include <net/classq/if_classq.h>
37*19c3b8c2SApple OSS Distributions #if SKYWALK
38*19c3b8c2SApple OSS Distributions #include <skywalk/os_skywalk_private.h>
39*19c3b8c2SApple OSS Distributions #endif /* SKYWALK */
40*19c3b8c2SApple OSS Distributions 
41*19c3b8c2SApple OSS Distributions #ifdef __cplusplus
42*19c3b8c2SApple OSS Distributions extern "C" {
43*19c3b8c2SApple OSS Distributions #endif
44*19c3b8c2SApple OSS Distributions 
45*19c3b8c2SApple OSS Distributions #define AQM_KTRACE_AON_FLOW_HIGH_DELAY    AQMDBG_CODE(DBG_AQM_ALWAYSON, 0x001)
46*19c3b8c2SApple OSS Distributions #define AQM_KTRACE_AON_THROTTLE           AQMDBG_CODE(DBG_AQM_ALWAYSON, 0x002)
47*19c3b8c2SApple OSS Distributions #define AQM_KTRACE_AON_FLOW_OVERWHELMING  AQMDBG_CODE(DBG_AQM_ALWAYSON, 0x003)
48*19c3b8c2SApple OSS Distributions #define AQM_KTRACE_AON_FLOW_DQ_STALL      AQMDBG_CODE(DBG_AQM_ALWAYSON, 0x004)
49*19c3b8c2SApple OSS Distributions 
50*19c3b8c2SApple OSS Distributions #define AQM_KTRACE_STATS_FLOW_ENQUEUE   AQMDBG_CODE(DBG_AQM_STATS, 0x001)
51*19c3b8c2SApple OSS Distributions #define AQM_KTRACE_STATS_FLOW_DEQUEUE   AQMDBG_CODE(DBG_AQM_STATS, 0x002)
52*19c3b8c2SApple OSS Distributions #define AQM_KTRACE_STATS_FLOW_CTL       AQMDBG_CODE(DBG_AQM_STATS, 0x003)
53*19c3b8c2SApple OSS Distributions #define AQM_KTRACE_STATS_FLOW_ALLOC     AQMDBG_CODE(DBG_AQM_STATS, 0x004)
54*19c3b8c2SApple OSS Distributions #define AQM_KTRACE_STATS_FLOW_DESTROY   AQMDBG_CODE(DBG_AQM_STATS, 0x005)
55*19c3b8c2SApple OSS Distributions 
56*19c3b8c2SApple OSS Distributions #define AQM_KTRACE_FQ_GRP_SC_IDX(_fq_) \
57*19c3b8c2SApple OSS Distributions 	((_fq_)->fq_group->fqg_index << 4 | (_fq_)->fq_sc_index)
58*19c3b8c2SApple OSS Distributions 
59*19c3b8c2SApple OSS Distributions #define FQ_MIN_FC_THRESHOLD_BYTES       7500
60*19c3b8c2SApple OSS Distributions #define FQ_IS_DELAY_HIGH(_fq_)   ((_fq_)->fq_flags & FQF_DELAY_HIGH)
61*19c3b8c2SApple OSS Distributions #define FQ_SET_DELAY_HIGH(_fq_) do {                          \
62*19c3b8c2SApple OSS Distributions     if (!FQ_IS_DELAY_HIGH(_fq_)) {                              \
63*19c3b8c2SApple OSS Distributions 	KDBG(AQM_KTRACE_AON_FLOW_HIGH_DELAY | DBG_FUNC_START, \
64*19c3b8c2SApple OSS Distributions 	    (_fq_)->fq_flowhash, AQM_KTRACE_FQ_GRP_SC_IDX((_fq_)),    \
65*19c3b8c2SApple OSS Distributions 	    (_fq_)->fq_bytes, (_fq_)->fq_min_qdelay);                 \
66*19c3b8c2SApple OSS Distributions     }                                                                 \
67*19c3b8c2SApple OSS Distributions     (_fq_)->fq_flags |= FQF_DELAY_HIGH; \
68*19c3b8c2SApple OSS Distributions     } while (0)
69*19c3b8c2SApple OSS Distributions #define FQ_CLEAR_DELAY_HIGH(_fq_) do { \
70*19c3b8c2SApple OSS Distributions     if (FQ_IS_DELAY_HIGH(_fq_)) {        \
71*19c3b8c2SApple OSS Distributions 	    KDBG(AQM_KTRACE_AON_FLOW_HIGH_DELAY | DBG_FUNC_END, \
72*19c3b8c2SApple OSS Distributions 	            (_fq_)->fq_flowhash, AQM_KTRACE_FQ_GRP_SC_IDX((_fq_)),  \
73*19c3b8c2SApple OSS Distributions 	            (_fq_)->fq_bytes, (_fq_)->fq_min_qdelay);               \
74*19c3b8c2SApple OSS Distributions     }                                                       \
75*19c3b8c2SApple OSS Distributions     (_fq_)->fq_flags &= ~FQF_DELAY_HIGH;                    \
76*19c3b8c2SApple OSS Distributions } while (0)
77*19c3b8c2SApple OSS Distributions 
78*19c3b8c2SApple OSS Distributions #define FQ_IS_OVERWHELMING(_fq_)   ((_fq_)->fq_flags & FQF_OVERWHELMING)
79*19c3b8c2SApple OSS Distributions #define FQ_SET_OVERWHELMING(_fq_) do { \
80*19c3b8c2SApple OSS Distributions 	if (!FQ_IS_OVERWHELMING(_fq_)) {                              \
81*19c3b8c2SApple OSS Distributions 	        KDBG(AQM_KTRACE_AON_FLOW_OVERWHELMING | DBG_FUNC_START, \
82*19c3b8c2SApple OSS Distributions 	                        (_fq_)->fq_flowhash, AQM_KTRACE_FQ_GRP_SC_IDX((_fq_)),    \
83*19c3b8c2SApple OSS Distributions 	                        (_fq_)->fq_bytes, (_fq_)->fq_min_qdelay);                 \
84*19c3b8c2SApple OSS Distributions 	}                                                                                                                                         \
85*19c3b8c2SApple OSS Distributions 	(_fq_)->fq_flags |= FQF_OVERWHELMING; \
86*19c3b8c2SApple OSS Distributions } while (0)
87*19c3b8c2SApple OSS Distributions #define FQ_CLEAR_OVERWHELMING(_fq_) do { \
88*19c3b8c2SApple OSS Distributions 	if (FQ_IS_OVERWHELMING(_fq_)) {                              \
89*19c3b8c2SApple OSS Distributions 	        KDBG(AQM_KTRACE_AON_FLOW_OVERWHELMING | DBG_FUNC_END,  \
90*19c3b8c2SApple OSS Distributions 	                        (_fq_)->fq_flowhash, AQM_KTRACE_FQ_GRP_SC_IDX((_fq_)),    \
91*19c3b8c2SApple OSS Distributions 	                        (_fq_)->fq_bytes, (_fq_)->fq_min_qdelay);                 \
92*19c3b8c2SApple OSS Distributions 	}                                                                                     \
93*19c3b8c2SApple OSS Distributions 	(_fq_)->fq_flags &= ~FQF_OVERWHELMING; \
94*19c3b8c2SApple OSS Distributions } while (0)
95*19c3b8c2SApple OSS Distributions 
96*19c3b8c2SApple OSS Distributions /*
97*19c3b8c2SApple OSS Distributions  * time (in ns) the flow queue can stay in empty state.
98*19c3b8c2SApple OSS Distributions  */
99*19c3b8c2SApple OSS Distributions #define FQ_EMPTY_PURGE_DELAY    (3ULL * 1000 * 1000 * 1000)
100*19c3b8c2SApple OSS Distributions 
101*19c3b8c2SApple OSS Distributions /*
102*19c3b8c2SApple OSS Distributions  * maximum number of flow queues which can be purged during a dequeue.
103*19c3b8c2SApple OSS Distributions  */
104*19c3b8c2SApple OSS Distributions #define FQ_EMPTY_PURGE_MAX      4
105*19c3b8c2SApple OSS Distributions 
106*19c3b8c2SApple OSS Distributions struct flowq {
107*19c3b8c2SApple OSS Distributions #pragma pack(push,1)
108*19c3b8c2SApple OSS Distributions 	union {
109*19c3b8c2SApple OSS Distributions 		MBUFQ_HEAD(mbufq_head) __mbufq; /* mbuf packet queue */
110*19c3b8c2SApple OSS Distributions #if SKYWALK
111*19c3b8c2SApple OSS Distributions 		KPKTQ_HEAD(kpktq_head) __kpktq; /* skywalk packet queue */
112*19c3b8c2SApple OSS Distributions #endif /* SKYWALK */
113*19c3b8c2SApple OSS Distributions 	} __fq_pktq_u;
114*19c3b8c2SApple OSS Distributions #pragma pack(pop)
115*19c3b8c2SApple OSS Distributions 	uint32_t       fq_flowhash;    /* Flow hash */
116*19c3b8c2SApple OSS Distributions 	uint32_t       fq_bytes;       /* Number of bytes in the queue */
117*19c3b8c2SApple OSS Distributions 	int32_t        fq_deficit;     /* Deficit for scheduling */
118*19c3b8c2SApple OSS Distributions 	fq_if_group_t  *fq_group;          /* Back pointer to the group */
119*19c3b8c2SApple OSS Distributions #define FQF_FLOWCTL_CAPABLE 0x01 /* Use flow control instead of drop */
120*19c3b8c2SApple OSS Distributions #define FQF_DELAY_HIGH  0x02    /* Min delay is greater than target */
121*19c3b8c2SApple OSS Distributions #define FQF_NEW_FLOW    0x04    /* Currently on new flows queue */
122*19c3b8c2SApple OSS Distributions #define FQF_OLD_FLOW    0x08    /* Currently on old flows queue */
123*19c3b8c2SApple OSS Distributions #define FQF_FLOWCTL_ON  0x10    /* Currently flow controlled */
124*19c3b8c2SApple OSS Distributions #define FQF_EMPTY_FLOW  0x20    /* Currently on empty flows queue */
125*19c3b8c2SApple OSS Distributions #define FQF_OVERWHELMING  0x40  /* The largest flow when AQM hits queue limit */
126*19c3b8c2SApple OSS Distributions 	uint8_t        fq_flags;       /* flags */
127*19c3b8c2SApple OSS Distributions 	uint8_t        fq_sc_index; /* service_class index */
128*19c3b8c2SApple OSS Distributions 	bool           fq_in_dqlist;
129*19c3b8c2SApple OSS Distributions 	fq_tfc_type_t  fq_tfc_type;
130*19c3b8c2SApple OSS Distributions 	uint8_t        __fq_pad_uint8[4];
131*19c3b8c2SApple OSS Distributions 	uint64_t       fq_min_qdelay; /* min queue delay for Codel */
132*19c3b8c2SApple OSS Distributions 	uint64_t       fq_getqtime;    /* last dequeue time */
133*19c3b8c2SApple OSS Distributions 	union {
134*19c3b8c2SApple OSS Distributions 		uint64_t   fq_updatetime; /* next update interval */
135*19c3b8c2SApple OSS Distributions 		/* empty list purge time (in nanoseconds) */
136*19c3b8c2SApple OSS Distributions 		uint64_t   fq_empty_purge_time;
137*19c3b8c2SApple OSS Distributions 	};
138*19c3b8c2SApple OSS Distributions 	SLIST_ENTRY(flowq) fq_hashlink; /* for flow queue hash table */
139*19c3b8c2SApple OSS Distributions 	/*
140*19c3b8c2SApple OSS Distributions 	 * flow queue will only be on either one of the lists.
141*19c3b8c2SApple OSS Distributions 	 */
142*19c3b8c2SApple OSS Distributions 	union {
143*19c3b8c2SApple OSS Distributions 		STAILQ_ENTRY(flowq) fq_actlink; /* for new/old flow queues */
144*19c3b8c2SApple OSS Distributions 		/* entry on empty flow queue list */
145*19c3b8c2SApple OSS Distributions 		TAILQ_ENTRY(flowq) fq_empty_link;
146*19c3b8c2SApple OSS Distributions 	};
147*19c3b8c2SApple OSS Distributions 	/* entry on dequeue flow list */
148*19c3b8c2SApple OSS Distributions 	STAILQ_ENTRY(flowq) fq_dqlink;
149*19c3b8c2SApple OSS Distributions 	/* temporary packet queue for dequeued packets */
150*19c3b8c2SApple OSS Distributions 	classq_pkt_t   fq_dq_head;
151*19c3b8c2SApple OSS Distributions 	classq_pkt_t   fq_dq_tail;
152*19c3b8c2SApple OSS Distributions };
153*19c3b8c2SApple OSS Distributions 
154*19c3b8c2SApple OSS Distributions typedef struct flowq fq_t;
155*19c3b8c2SApple OSS Distributions 
156*19c3b8c2SApple OSS Distributions #define FQF_FLOW_STATE_MASK    (FQF_DELAY_HIGH | FQF_NEW_FLOW | \
157*19c3b8c2SApple OSS Distributions     FQF_OLD_FLOW | FQF_FLOWCTL_ON | FQF_EMPTY_FLOW)
158*19c3b8c2SApple OSS Distributions 
159*19c3b8c2SApple OSS Distributions #define fq_mbufq        __fq_pktq_u.__mbufq
160*19c3b8c2SApple OSS Distributions #if SKYWALK
161*19c3b8c2SApple OSS Distributions #define fq_kpktq        __fq_pktq_u.__kpktq
162*19c3b8c2SApple OSS Distributions #endif /* SKYWALK */
163*19c3b8c2SApple OSS Distributions 
164*19c3b8c2SApple OSS Distributions #if SKYWALK
165*19c3b8c2SApple OSS Distributions #define fq_empty(_q, _ptype)    (((_ptype) == QP_MBUF) ?  \
166*19c3b8c2SApple OSS Distributions     MBUFQ_EMPTY(&(_q)->fq_mbufq) : KPKTQ_EMPTY(&(_q)->fq_kpktq))
167*19c3b8c2SApple OSS Distributions #else /* !SKYWALK */
168*19c3b8c2SApple OSS Distributions #define fq_empty(_q, _ptype)    MBUFQ_EMPTY(&(_q)->fq_mbufq)
169*19c3b8c2SApple OSS Distributions #endif /* !SKYWALK */
170*19c3b8c2SApple OSS Distributions 
171*19c3b8c2SApple OSS Distributions #if SKYWALK
172*19c3b8c2SApple OSS Distributions #define fq_enqueue(_q, _h, _t, _c, _ptype) do {                         \
173*19c3b8c2SApple OSS Distributions 	switch (_ptype) {                                               \
174*19c3b8c2SApple OSS Distributions 	case QP_MBUF:                                                   \
175*19c3b8c2SApple OSS Distributions 	        ASSERT((_h).cp_ptype == QP_MBUF);                       \
176*19c3b8c2SApple OSS Distributions 	        ASSERT((_t).cp_ptype == QP_MBUF);                       \
177*19c3b8c2SApple OSS Distributions 	        MBUFQ_ENQUEUE_MULTI(&(_q)->fq_mbufq, (_h).cp_mbuf,      \
178*19c3b8c2SApple OSS Distributions 	            (_t).cp_mbuf);                                      \
179*19c3b8c2SApple OSS Distributions 	        MBUFQ_ADD_CRUMB_MULTI(&(_q)->fq_mbufq, (_h).cp_mbuf,    \
180*19c3b8c2SApple OSS Distributions 	            (_t).cp_mbuf, PKT_CRUMB_FQ_ENQUEUE);                \
181*19c3b8c2SApple OSS Distributions 	        break;                                                  \
182*19c3b8c2SApple OSS Distributions 	case QP_PACKET:                                                 \
183*19c3b8c2SApple OSS Distributions 	        ASSERT((_h).cp_ptype == QP_PACKET);                     \
184*19c3b8c2SApple OSS Distributions 	        ASSERT((_t).cp_ptype == QP_PACKET);                     \
185*19c3b8c2SApple OSS Distributions 	        KPKTQ_ENQUEUE_MULTI(&(_q)->fq_kpktq, (_h).cp_kpkt,      \
186*19c3b8c2SApple OSS Distributions 	            (_t).cp_kpkt, (_c));                                \
187*19c3b8c2SApple OSS Distributions 	        break;                                                  \
188*19c3b8c2SApple OSS Distributions 	default:                                                        \
189*19c3b8c2SApple OSS Distributions 	        VERIFY(0);                                              \
190*19c3b8c2SApple OSS Distributions 	        __builtin_unreachable();                                \
191*19c3b8c2SApple OSS Distributions 	        break;                                                  \
192*19c3b8c2SApple OSS Distributions 	}                                                               \
193*19c3b8c2SApple OSS Distributions } while (0)
194*19c3b8c2SApple OSS Distributions #else /* !SKYWALK */
195*19c3b8c2SApple OSS Distributions #define fq_enqueue(_q, _h, _t, _c, _ptype) {                            \
196*19c3b8c2SApple OSS Distributions     MBUFQ_ENQUEUE_MULTI(&(_q)->fq_mbufq, (_h).cp_mbuf, (_t).cp_mbuf);   \
197*19c3b8c2SApple OSS Distributions     MBUFQ_ADD_CRUMB_MULTI(&(_q)->fq_mbufq, (_h).cp_mbuf,                \
198*19c3b8c2SApple OSS Distributions 	    (_t).cp_mbuf, PKT_CRUMB_FQ_ENQUEUE);                        \
199*19c3b8c2SApple OSS Distributions } while (0)
200*19c3b8c2SApple OSS Distributions #endif /* !SKYWALK */
201*19c3b8c2SApple OSS Distributions 
202*19c3b8c2SApple OSS Distributions #if SKYWALK
203*19c3b8c2SApple OSS Distributions #define fq_dequeue(_q, _p, _ptype) do {                                 \
204*19c3b8c2SApple OSS Distributions 	switch (_ptype) {                                               \
205*19c3b8c2SApple OSS Distributions 	case QP_MBUF: {                                                 \
206*19c3b8c2SApple OSS Distributions 	        MBUFQ_DEQUEUE(&(_q)->fq_mbufq, (_p)->cp_mbuf);          \
207*19c3b8c2SApple OSS Distributions 	        if (__probable((_p)->cp_mbuf != NULL)) {                \
208*19c3b8c2SApple OSS Distributions 	                CLASSQ_PKT_INIT_MBUF((_p), (_p)->cp_mbuf);      \
209*19c3b8c2SApple OSS Distributions 	                m_add_crumb((_p)->cp_mbuf,                      \
210*19c3b8c2SApple OSS Distributions 	                    PKT_CRUMB_FQ_DEQUEUE);                      \
211*19c3b8c2SApple OSS Distributions 	        }                                                       \
212*19c3b8c2SApple OSS Distributions 	        break;                                                  \
213*19c3b8c2SApple OSS Distributions 	}                                                               \
214*19c3b8c2SApple OSS Distributions 	case QP_PACKET: {                                               \
215*19c3b8c2SApple OSS Distributions 	        KPKTQ_DEQUEUE(&(_q)->fq_kpktq, (_p)->cp_kpkt);          \
216*19c3b8c2SApple OSS Distributions 	        if (__probable((_p)->cp_kpkt != NULL)) {                \
217*19c3b8c2SApple OSS Distributions 	                CLASSQ_PKT_INIT_PACKET((_p), (_p)->cp_kpkt);    \
218*19c3b8c2SApple OSS Distributions 	        }                                                       \
219*19c3b8c2SApple OSS Distributions 	        break;                                                  \
220*19c3b8c2SApple OSS Distributions 	}                                                               \
221*19c3b8c2SApple OSS Distributions 	default:                                                        \
222*19c3b8c2SApple OSS Distributions 	        VERIFY(0);                                              \
223*19c3b8c2SApple OSS Distributions 	        __builtin_unreachable();                                \
224*19c3b8c2SApple OSS Distributions 	        break;                                                  \
225*19c3b8c2SApple OSS Distributions 	}                                                               \
226*19c3b8c2SApple OSS Distributions } while (0)
227*19c3b8c2SApple OSS Distributions #else /* !SKYWALK */
228*19c3b8c2SApple OSS Distributions #define fq_dequeue(_q, _p, _ptype) do {                                 \
229*19c3b8c2SApple OSS Distributions 	MBUFQ_DEQUEUE(&(_q)->fq_mbufq, (_p)->cp_mbuf);                  \
230*19c3b8c2SApple OSS Distributions 	if (__probable((_p)->cp_mbuf != NULL)) {                        \
231*19c3b8c2SApple OSS Distributions 	        CLASSQ_PKT_INIT_MBUF((_p), (_p)->cp_mbuf);              \
232*19c3b8c2SApple OSS Distributions 	        m_add_crumb((_p)->cp_mbuf, PKT_CRUMB_FQ_DEQUEUE);       \
233*19c3b8c2SApple OSS Distributions 	}                                                               \
234*19c3b8c2SApple OSS Distributions } while (0)
235*19c3b8c2SApple OSS Distributions #endif /* !SKYWALK */
236*19c3b8c2SApple OSS Distributions 
237*19c3b8c2SApple OSS Distributions struct fq_codel_sched_data;
238*19c3b8c2SApple OSS Distributions struct fq_if_classq;
239*19c3b8c2SApple OSS Distributions 
240*19c3b8c2SApple OSS Distributions /* Function definitions */
241*19c3b8c2SApple OSS Distributions extern void fq_codel_init(void);
242*19c3b8c2SApple OSS Distributions extern void fq_codel_reap_caches(boolean_t);
243*19c3b8c2SApple OSS Distributions extern fq_t *fq_alloc(classq_pkt_type_t);
244*19c3b8c2SApple OSS Distributions extern void fq_destroy(fq_t *, classq_pkt_type_t);
245*19c3b8c2SApple OSS Distributions extern int fq_addq(struct fq_codel_sched_data *, fq_if_group_t *,
246*19c3b8c2SApple OSS Distributions     pktsched_pkt_t *, struct fq_if_classq *);
247*19c3b8c2SApple OSS Distributions extern void fq_getq_flow(struct fq_codel_sched_data *, fq_t *,
248*19c3b8c2SApple OSS Distributions     pktsched_pkt_t *, uint64_t now);
249*19c3b8c2SApple OSS Distributions extern void fq_codel_dequeue(fq_if_t *fqs, fq_t *fq,
250*19c3b8c2SApple OSS Distributions     pktsched_pkt_t *pkt, uint64_t now);
251*19c3b8c2SApple OSS Distributions extern void fq_getq_flow_internal(struct fq_codel_sched_data *,
252*19c3b8c2SApple OSS Distributions     fq_t *, pktsched_pkt_t *);
253*19c3b8c2SApple OSS Distributions extern void fq_head_drop(struct fq_codel_sched_data *, fq_t *);
254*19c3b8c2SApple OSS Distributions 
255*19c3b8c2SApple OSS Distributions #ifdef __cplusplus
256*19c3b8c2SApple OSS Distributions }
257*19c3b8c2SApple OSS Distributions #endif
258*19c3b8c2SApple OSS Distributions #endif /* BSD_KERNEL_PRIVATE */
259*19c3b8c2SApple OSS Distributions #endif /* PRIVATE */
260*19c3b8c2SApple OSS Distributions #endif /* _NET_CLASSQ_CLASSQ_FQ_CODEL_H */
261