Index: hfsc.c =================================================================== RCS file: /cvs/src/sys/net/hfsc.c,v retrieving revision 1.22 diff -u -p -r1.22 hfsc.c --- hfsc.c 27 Sep 2015 05:23:50 -0000 1.22 +++ hfsc.c 27 Sep 2015 09:18:51 -0000 @@ -211,7 +211,10 @@ struct hfsc_class *hfsc_class_create(str int hfsc_class_destroy(struct hfsc_class *); struct hfsc_class *hfsc_nextclass(struct hfsc_class *); +int hfsc_queue(struct ifqueue *, struct mbuf *, + int (*)(struct hfsc_class *, struct mbuf *)); int hfsc_addq(struct hfsc_class *, struct mbuf *); +int hfsc_req(struct hfsc_class *, struct mbuf *); struct mbuf *hfsc_getq(struct hfsc_class *); struct mbuf *hfsc_pollq(struct hfsc_class *); void hfsc_purgeq(struct hfsc_class *); @@ -640,6 +643,19 @@ hfsc_nextclass(struct hfsc_class *cl) int hfsc_enqueue(struct ifqueue *ifq, struct mbuf *m) { + return (hfsc_queue(ifq, m, hfsc_addq)); +} + +void +hfsc_requeue(struct ifqueue *ifq, struct mbuf *m) +{ + (void)hfsc_queue(ifq, m, hfsc_req); +} + +int +hfsc_queue(struct ifqueue *ifq, struct mbuf *m, + int (*queue)(struct hfsc_class *, struct mbuf *)) +{ struct hfsc_if *hif = ifq->ifq_hfsc; struct hfsc_class *cl; @@ -651,7 +667,7 @@ hfsc_enqueue(struct ifqueue *ifq, struct cl->cl_pktattr = NULL; } - if (hfsc_addq(cl, m) != 0) { + if ((*queue)(cl, m) != 0) { /* drop occurred. mbuf needs to be freed */ PKTCNTR_INC(&cl->cl_stats.drop_cnt, m->m_pkthdr.len); return (ENOBUFS); @@ -781,6 +797,14 @@ hfsc_addq(struct hfsc_class *cl, struct return (-1); ml_enqueue(&cl->cl_q.q, m); + + return (0); +} + +int +hfsc_req(struct hfsc_class *cl, struct mbuf *m) +{ + ml_requeue(&cl->cl_q.q, m); return (0); } Index: hfsc.h =================================================================== RCS file: /cvs/src/sys/net/hfsc.h,v retrieving revision 1.8 diff -u -p -r1.8 hfsc.h --- hfsc.h 12 Apr 2015 09:58:46 -0000 1.8 +++ hfsc.h 27 Sep 2015 09:18:51 -0000 @@ -121,6 +121,7 @@ int hfsc_detach(struct ifnet *); void hfsc_purge(struct ifqueue *); int hfsc_enqueue(struct ifqueue *, struct mbuf *); struct mbuf *hfsc_dequeue(struct ifqueue *, int); +void hfsc_requeue(struct ifqueue *, struct mbuf *); u_int64_t hfsc_microuptime(void); int hfsc_addqueue(struct pf_queuespec *); int hfsc_delqueue(struct pf_queuespec *);