ALTQ patch for hme(4)

Pyun YongHyeon yongari at kt-is.co.kr
Wed Jul 28 01:22:04 PDT 2004


Hello,

For those users that want to use ALTQ traffic shaping with PF,
here is patch for hme(4) driver. The patch was tested
on Ultra2(SMP). ATM, CBQ and CBQ's borrowing from parent
seems to work as expected. I guess it will work for PRIQ and
HFSC too. If you have bad-experience with this patch, please
let me know.

Best regards,
Pyun YongHyeon
-- 
Pyun YongHyeon <http://www.kr.freebsd.org/~yongari>
-------------- next part --------------
--- if_hme.c.orig	Sat Jun 12 11:23:06 2004
+++ if_hme.c	Wed Jul 28 13:55:42 2004
@@ -276,7 +276,9 @@
 	ifp->if_ioctl = hme_ioctl;
 	ifp->if_init = hme_init;
 	ifp->if_watchdog = hme_watchdog;
-	ifp->if_snd.ifq_maxlen = HME_NTXQ;
+	IFQ_SET_MAXLEN(&ifp->if_snd, HME_NTXQ);
+	ifp->if_snd.ifq_drv_maxlen = HME_NTXQ;
+	IFQ_SET_READY(&ifp->if_snd);
 
 	hme_mifinit(sc);
 
@@ -1002,14 +1004,14 @@
 
 	error = 0;
 	for (;;) {
-		IF_DEQUEUE(&ifp->if_snd, m);
+		IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
 		if (m == NULL)
 			break;
 
 		error = hme_load_txmbuf(sc, m);
 		if (error == -1) {
 			ifp->if_flags |= IFF_OACTIVE;
-			IF_PREPEND(&ifp->if_snd, m);
+			IFQ_DRV_PREPEND(&ifp->if_snd, m);
 			break;
 		} else if (error > 0) {
 			printf("hme_start: error %d while loading mbuf\n",


More information about the freebsd-sparc64 mailing list