From owner-freebsd-pf@FreeBSD.ORG Tue Jan 30 23:09:34 2007 Return-Path: X-Original-To: freebsd-pf@freebsd.org Delivered-To: freebsd-pf@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A274D16A401 for ; Tue, 30 Jan 2007 23:09:34 +0000 (UTC) (envelope-from volker@vwsoft.com) Received: from frontmail.ipactive.de (frontmail.maindns.de [85.214.95.103]) by mx1.freebsd.org (Postfix) with ESMTP id 3B4A513C48E for ; Tue, 30 Jan 2007 23:09:33 +0000 (UTC) (envelope-from volker@vwsoft.com) Received: from mail.vtec.ipme.de (unknown [89.53.125.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by frontmail.ipactive.de (Postfix) with ESMTP id C0C54128831; Wed, 31 Jan 2007 00:09:26 +0100 (CET) Received: from [192.168.16.3] (cesar.sz.vwsoft.com [192.168.16.3]) by mail.vtec.ipme.de (Postfix) with ESMTP id B3C632E572; Wed, 31 Jan 2007 00:09:17 +0100 (CET) Message-ID: <45BFD021.7030101@vwsoft.com> Date: Wed, 31 Jan 2007 00:09:21 +0100 From: Volker User-Agent: Thunderbird 1.5.0.9 (X11/20070119) MIME-Version: 1.0 To: Max Laier References: <000301c742ee$ff867500$0201a8c0@d620> <200701300020.52770.max@love2party.net> <000601c744bb$5ee186c0$1ca49440$@Hennessy@nviz.net> <200701302358.03532.max@love2party.net> In-Reply-To: <200701302358.03532.max@love2party.net> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-VWSoft-MailScanner: Found to be clean X-MailScanner-From: volker@vwsoft.com X-ipactive-MailScanner-Information: Please contact the ISP for more information X-ipactive-MailScanner: Found to be clean X-ipactive-MailScanner-From: volker@vwsoft.com Cc: Greg Hennessy , freebsd-pf@freebsd.org Subject: Re: ALTQ support for usb NICs? X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jan 2007 23:09:34 -0000 On 01/30/07 23:57, Max Laier wrote: > On Tuesday 30 January 2007 23:09, you wrote: >>> aue and kue patches added to >>> http://people.freebsd.org/~mlaier/ALTQ_driver/ >>> >>> Please test and report back. >> So far so good. >> >> Greg >> >> >> gw2:~ # uname -a >> FreeBSD gw2.local.net 7.0-CURRENT FreeBSD 7.0-CURRENT #167: Tue Jan 30 >> 15:57:33 GMT 2007 root@gw2.local.net:/usr/obj/usr/src/sys/GH i386 >> gw2:~ # cat /etc/rc.early >> /sbin/ifconfig aue0 name outside >> /sbin/ifconfig em0 name inside >> /sbin/ifconfig inside polling > > Wow ... so naming really works? That's news :-) > >> gw2:~ # pfctl -vsq >> queue root_outside bandwidth 700Kb priority 0 {q_pri, q_def, q_p2p} >> [ pkts: 0 bytes: 0 dropped pkts: 0 bytes: >> 0 ] >> [ qlength: 0/ 50 ] >> queue q_pri bandwidth 105Kb qlimit 250 hfsc( realtime 140Kb upperlimit >> 350Kb ) >> [ pkts: 118289 bytes: 6735193 dropped pkts: 0 bytes: >> 0 ] >> [ qlength: 0/250 ] >> queue q_def bandwidth 455Kb qlimit 250 hfsc( rio linkshare 350Kb >> upperlimit 630Kb ) >> [ pkts: 20710 bytes: 5146240 dropped pkts: 0 bytes: >> 0 ] >> [ qlength: 0/250 ] >> queue q_p2p bandwidth 140Kb qlimit 250 hfsc( rio default upperlimit >> 630Kb ) [ pkts: 3141 bytes: 140498 dropped pkts: 0 >> bytes: 0 ] >> [ qlength: 0/250 ] >> gw2:~ # > > Can you by any chance run the simple benchmark described at > http://people.freebsd.org/~mlaier/ALTQ_driver/ ? It's good if hfsc > works, but the main goal is to make sure that we do not break anything > for non-ALTQ users. > Max, I'm using a RELENG_6 system so your patches did not succeed on my system. What I did was to manually make the needed modifications with if_aue.c 1.90.2.6 (cvs RELENG_6). Following you'll find my patch against RELENG_6. The interface is working, comes up and traffic goes through. Running netperf (tcp_range_script) is giving some errors (trimmed at bit): /usr/local/bin/netperf -l 60 -H 192.168.20.141 -t TCP_STREAM -i 10,2 -I 99,3 -- -m 1 -s 32768 -S 32768 TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.20.141 (192.168.20.141) port 0 AF_INET : +/-1.5% @ 99% conf. netperf: cannot shutdown tcp stream socket: Operation not permitted netperf claims about operation not permitted at least four times (still running in the background) whereas before the patch has been installed, netperf showed this message only one single time. Throughput w/o ALTQ decreases a bit from 5,78 MBit/s (w/o patch) and 5,74 MBit/s (w/ patch, w/o ALTQ enabled for that interface). As traffic is passing the interface, I would consider this working but find the "operation not permitted" messages a bit strange. Next, I'll test w/ ALTQ enabled for that interface but it will take half an hour (will drop another note to the ML). FreeBSD bellona.sz.vwsoft.com 6.2-STABLE FreeBSD 6.2-STABLE #6: Tue Jan 30 23:28:14 CET 2007 root@bellona.sz.vwsoft.com:/usr/obj/usr/src/sys/BELLONA i386 Greetings, Volker Patch for if_aue.c against RELENG_6: --- if_aue.c.orig Thu Nov 16 12:50:54 2006 +++ if_aue.c.new Tue Jan 30 23:20:57 2007 @@ -732,7 +732,10 @@ ifp->if_start = aue_start; ifp->if_watchdog = aue_watchdog; ifp->if_init = aue_init; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_READY(&ifp->if_snd); + /* * Do MII setup. @@ -1034,7 +1037,7 @@ if (!sc->aue_link && mii->mii_media_status & IFM_ACTIVE && IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { sc->aue_link++; - if (ifp->if_snd.ifq_head != NULL) + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) aue_start(ifp); } @@ -1106,14 +1109,14 @@ return; } - IF_DEQUEUE(&ifp->if_snd, m_head); + IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) { AUE_UNLOCK(sc); return; } if (aue_encap(sc, m_head, 0)) { - IF_PREPEND(&ifp->if_snd, m_head); + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_drv_flags |= IFF_DRV_OACTIVE; AUE_UNLOCK(sc); return; @@ -1350,7 +1353,7 @@ usbd_get_xfer_status(c->ue_xfer, NULL, NULL, NULL, &stat); aue_txeof(c->ue_xfer, c, stat); - if (ifp->if_snd.ifq_head != NULL) + if (!IFQ_IS_EMPTY(&ifp->if_snd)) aue_start(ifp); AUE_UNLOCK(sc); return;