From owner-freebsd-pf@freebsd.org Wed Aug 10 09:30:26 2016 Return-Path: Delivered-To: freebsd-pf@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0620BB261F for ; Wed, 10 Aug 2016 09:30:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA6CB1446 for ; Wed, 10 Aug 2016 09:30:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [150.158.232.205] (vega.codepro.be [IPv6:2a01:4f8:162:1127::3]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 9621E9F28; Wed, 10 Aug 2016 11:30:24 +0200 (CEST) From: "Kristof Provost" To: "Radek =?utf-8?q?Krej=C4=8Da?=" Cc: "freebsd-pf@freebsd.org" Subject: Re: Max altq bandwidth 4.26 Gbit Date: Wed, 10 Aug 2016 11:30:23 +0200 Message-ID: <13955BA9-910E-4C4A-B86A-5A355F8A10C9@FreeBSD.org> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-Mailer: MailMate (2.0BETAr6044) X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.22 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: Wed, 10 Aug 2016 09:30:27 -0000 On 10 Aug 2016, at 11:19, Radek Krejča wrote: >> That looks like you might be hitting the maximum of an unsigned >> integer. >> Try using relative specifications (i.e. as a percentage) instead. >> > Yes, I think so. But I dont know, that I can say relative > specification for inteface bandwidth. Could you show me how? > I don’t run ALTQ myself, so all I can say is what the man page says: bandwidth ⟨bw⟩ The maximum bitrate for all queues on an interface may be specified using the bandwidth keyword. The value can be specified as an absolute value or as a percentage of the interface bandwidth. When using an absolute value, the suffixes b, Kb, Mb, and Gb are used to represent bits, kilobits, megabits, and gigabits per second, respectively. The value must not exceed the interface bandwidth. If bandwidth is not specified, the interface bandwidth is used (but take note that some interfaces do not know their bandwidth, or can adapt their bandwidth rates). I’d expect that ‘altq on $int_if cbq bandwidth 85% queue { default_nat.........’ would do what you want. Looking at the code, I’m not at all sure that it’ll end up working either, but it’s worth a try. Fundamentally, we’ll have to change pf (and worse, the interface to user space) to use 64-bit integers to carry bandwidth information, not 32-bit ones. Can you file a bug so this doesn’t get forgotten? > I have 10Gb line and I need to shape my client with exact bandwidth. > How can I manage with your advice? > You can only specify integer percentages (so 85%, not 85.5%), so I’m afraid you’ll lose some accuracy. Regards, Kristof