- struct mbuf *m, *m_tmp;
-
- MBUFQ_FOREACH_SAFE(m, &q->mbufq, m_tmp) {
- if ((isflowid && (val == 0 || ((m->m_flags & M_PKTHDR) &&
- m->m_pkthdr.pkt_flowid == val))) ||
- (!isflowid &&
- MBUF_SCIDX(mbuf_get_service_class(m)) < val)) {
- /* remove it from the class queue */
- MBUFQ_REMOVE(&q->mbufq, m);
- MBUFQ_NEXT(m) = NULL;
- break;
+ void *pkt = NULL;
+ uint32_t pkt_len;
+
+ switch (qptype(q)) {
+ case QP_MBUF: {
+ struct mbuf *m, *m_tmp;
+
+ MBUFQ_FOREACH_SAFE(m, &qmbufq(q), m_tmp) {
+ if ((isflowid && (val == 0 ||
+ ((m->m_flags & M_PKTHDR) &&
+ m->m_pkthdr.pkt_flowid == val))) ||
+ (!isflowid &&
+ MBUF_SCIDX(mbuf_get_service_class(m)) < val)) {
+ /* remove it from the class queue */
+ MBUFQ_REMOVE(&qmbufq(q), m);
+ MBUFQ_NEXT(m) = NULL;
+ break;
+ }
+ }
+ if (m != NULL) {
+ pkt = m;
+ pkt_len = m_length(m);