Lines Matching defs:q
70 #define qtype(q) (q)->qtype_ /* Get queue type */
71 #define qlimit(q) (q)->qlim_ /* Max packets to be queued */
72 #define qlen(q) (q)->qlen_ /* Current queue length. */
73 #define qtail(q) (q)->tail_ /* Tail of the queue */
74 #define qhead(q) ((q)->tail_ ? (q)->tail_->m_nextpkt : NULL)
76 #define qempty(q) ((q)->qlen_ == 0) /* Is the queue empty?? */
77 #define q_is_red(q) ((q)->qtype_ == Q_RED) /* Is the queue a red queue */
78 #define q_is_rio(q) ((q)->qtype_ == Q_RIO) /* Is the queue a rio queue */
79 #define q_is_red_or_rio(q) ((q)->qtype_ == Q_RED || (q)->qtype_ == Q_RIO)
95 _addq(class_queue_t *q, struct mbuf *m)
99 if ((m0 = qtail(q)) != NULL)
104 qtail(q) = m;
105 qlen(q)++;
109 _getq(class_queue_t *q)
113 if ((m = qtail(q)) == NULL)
118 qtail(q) = NULL;
119 qlen(q)--;
126 _getq_tail(class_queue_t *q)
130 if ((m = m0 = qtail(q)) == NULL)
138 qtail(q) = NULL;
140 qtail(q) = prev;
141 qlen(q)--;
148 _getq_random(class_queue_t *q)
153 if ((m = qtail(q)) == NULL)
156 qtail(q) = NULL;
160 n = cprng_fast32() % qlen(q) + 1;
166 if (m == qtail(q))
167 qtail(q) = prev;
169 qlen(q)--;
175 _removeq(class_queue_t *q, struct mbuf *m)
179 m0 = qtail(q);
186 qtail(q) = NULL;
187 else if (qtail(q) == m)
188 qtail(q) = prev;
189 qlen(q)--;
193 _flushq(class_queue_t *q)
197 while ((m = _getq(q)) != NULL)