From owner-freebsd-sparc64@FreeBSD.ORG Wed Jul 28 08:22:04 2004 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C969716A4CE for ; Wed, 28 Jul 2004 08:22:04 +0000 (GMT) Received: from ns.kt-is.co.kr (ns.kt-is.co.kr [211.218.149.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id 244B443D39 for ; Wed, 28 Jul 2004 08:22:04 +0000 (GMT) (envelope-from yongari@kt-is.co.kr) Received: from michelle.kt-is.co.kr (ns2.kt-is.co.kr [220.76.118.193]) (authenticated bits=128) by ns.kt-is.co.kr (8.12.10/8.12.10) with ESMTP id i6S8CLAh047504 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 28 Jul 2004 17:12:21 +0900 (KST) Received: from michelle.kt-is.co.kr (localhost.kt-is.co.kr [127.0.0.1]) by michelle.kt-is.co.kr (8.12.10/8.12.10) with ESMTP id i6S8LfoI008974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 28 Jul 2004 17:21:41 +0900 (KST) (envelope-from yongari@kt-is.co.kr) Received: (from yongari@localhost) by michelle.kt-is.co.kr (8.12.10/8.12.10/Submit) id i6S8LfN9008973 for sparc64@freebsd.org; Wed, 28 Jul 2004 17:21:41 +0900 (KST) (envelope-from yongari@kt-is.co.kr) Date: Wed, 28 Jul 2004 17:21:41 +0900 From: Pyun YongHyeon To: sparc64@freebsd.org Message-ID: <20040728082141.GA8679@kt-is.co.kr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Nq2Wo0NMKNjxTN9z" Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Filter-Version: 1.11a (ns.kt-is.co.kr) Subject: ALTQ patch for hme(4) X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: yongari@kt-is.co.kr List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jul 2004 08:22:04 -0000 --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="hme.altq.patch" --- 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", --Nq2Wo0NMKNjxTN9z--