From owner-freebsd-pf@FreeBSD.ORG Thu Jul 7 19:45:49 2011 Return-Path: Delivered-To: freebsd-pf@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F1561065672 for ; Thu, 7 Jul 2011 19:45:49 +0000 (UTC) (envelope-from calomelopensourceresearch@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 047508FC13 for ; Thu, 7 Jul 2011 19:45:48 +0000 (UTC) Received: by vxg33 with SMTP id 33so1279148vxg.13 for ; Thu, 07 Jul 2011 12:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:reply-to:references :mime-version:content-type:content-disposition:in-reply-to:errors-to :x-gpg-key-fingerprint; bh=M6mHQarf+ovVHiFwwLwWgfIvOd5p61CmmyvDmKZ60YM=; b=N1ceqR51PdmL+uQMMBBsGEqA7TS3Sa1ZSVvczBBo5gSahwyy+9g/pZhFNq3t+hH5u3 3sD7EUbBOhPs5GbTv6P+kkescyegZm/gvbh/8OmjI9u47gS5fdNr8B9DZyQJqh0JQ1dN U1tChuKTs5YkDIHSWjNm0Z7HZ7pkJ3mHs36Lw= Received: by 10.52.115.6 with SMTP id jk6mr1666637vdb.188.1310067948080; Thu, 07 Jul 2011 12:45:48 -0700 (PDT) Received: from calomel.org (pool-71-166-62-51.bltmmd.fios.verizon.net [71.166.62.51]) by mx.google.com with ESMTPS id ck16sm3406748vdb.8.2011.07.07.12.45.46 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 07 Jul 2011 12:45:46 -0700 (PDT) Sender: Calomel Org Received: by calomel.org (resilience smtpd, from userid 1000) id 5FE3F196DB; Thu, 7 Jul 2011 15:45:45 -0400 (EDT) Date: Thu, 7 Jul 2011 15:45:45 -0400 From: Calomel Org To: Ermal Lu?i Message-ID: <20110707194545.GB6463@calomel.org> References: <20110706152506.GA26334@calomel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Errors-To: infallibilismindefeasibility@calomel.org X-GPG-Key-FingerPrint: 328F 9F03 C73F 7F31 B06B FA5B C1FC A1C7 3D2E ED32 Cc: misc@openbsd.org, freebsd-pf@freebsd.org Subject: Re: pf ALTQ bandwidth limited to a 32bit value (4294Mb) X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Calomel Org 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: Thu, 07 Jul 2011 19:45:49 -0000 Ermal, Thanks for the diff. When we tried it on FreeBSD 8.2-p2, ALTq would no long start. We also looked into the source under /usr/src/sys/contrib/altq/altq. Sadly, most of the changes we made either broke altq completely or had no effect. If you have any other ideas we would be happy to try them out. -- Calomel @ https://calomel.org Open Source Research and Reference On Thu, Jul 07, 2011 at 09:28:13AM -0400, Ermal Lu?i wrote: >On Wed, Jul 6, 2011 at 5:25 PM, Calomel Org > wrote: >> ALTQ using hfsc is limited to a maximum parent bandwidth of 4294Mb. >> This value is 2^32 or 4,294,967,296 bits. If you set the bandwidth any >> higher, altq will flip back to zero. This "bug" was found when trying >> to test 10 gigabit and 40 gigabit bandwidth models. These tests were >> done on OpenBSD 32bit and 64bit as well as FreeBSD 32bit and 64bit. >> >> If anyone else can verify this independently and agree with the >> results I would be happy to register it as a bug. >> >> >> How to replicate: >> >> A quick test is setting the bandwidth to 4294Mb and doing a pfctl -sq >> to check altq. >> >> ?altq on $ExtIf bandwidth 4294Mb hfsc queue { ack, web} >> ?queue root_em0 on em0 bandwidth 4.29Gb priority 0 {ack, web} >> >> Now set the bandwidth to 4295Mb and notice altq has flip to zero and >> add the 32.70Kb difference. >> >> ?altq on $ExtIf bandwidth 4295Mb hfsc queue { ack, web } >> ?queue root_em0 on em0 bandwidth 32.70Kb priority 0 {ack, web} >> >> Again, we can set the bandwidth to a multiple of two(2) to 8589Mb. >> The bandwidth value flips to zero once and the result is 4.29Gb. >> >> ?altq on $ExtIf bandwidth 8589Mb hfsc queue { ack, web} >> ?queue root_em0 on em0 bandwidth 4.29Gb priority 0 {ack, web} >> >> If we add one more megabit to 8590Mb the value flips twice and we are >> left with 65.41Kb. >> >> ?altq on $ExtIf bandwidth 8590Mb hfsc queue { ack, web} >> ?queue root_em0 on em0 bandwidth 65.41Kb priority 0 {ack, web} >> > >It is true that there is a limit because of data type used. >Though it cannot be fixed easily on i386 but on amd64 this should work. > >Index: sys/contrib/pf/net/pfvar.h >=================================================================== >--- sys/contrib/pf/net/pfvar.h (revision 223824) >+++ sys/contrib/pf/net/pfvar.h (working copy) >@@ -1491,13 +1491,13 @@ > /* scheduler spec */ > u_int8_t scheduler; /* scheduler type */ > u_int16_t tbrsize; /* tokenbucket regulator size */ >- u_int32_t ifbandwidth; /* interface bandwidth */ >+ u_int64_t ifbandwidth; /* interface bandwidth */ > > /* queue spec */ > char qname[PF_QNAME_SIZE]; /* queue name */ > char parent[PF_QNAME_SIZE]; /* parent name */ > u_int32_t parent_qid; /* parent queue id */ >- u_int32_t bandwidth; /* queue bandwidth */ >+ u_int64_t bandwidth; /* queue bandwidth */ > u_int8_t priority; /* priority */ > #ifdef __FreeBSD__ > u_int8_t local_flags; /* dynamic interface */ > > >> >> Thanks. >> >> -- >> ? Calomel @ https://calomel.org >> ? Open Source Research and Reference >> _______________________________________________ >> freebsd-pf@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-pf >> To unsubscribe, send any mail to "freebsd-pf-unsubscribe@freebsd.org" >> > > > >-- >Ermal >_______________________________________________ >freebsd-pf@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-pf >To unsubscribe, send any mail to "freebsd-pf-unsubscribe@freebsd.org"