From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: Re: [PATCH iproute2/net-next v2]tc: B.W limits can now be specified in %. Date: Wed, 15 Nov 2017 00:13:28 -0800 Message-ID: <20171115001328.2ef6bf11@cakuba> References: <20171115013618.GA19575@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: stephen@networkplumber.org, netdev@vger.kernel.org, doucette@bu.edu, michel.machado@gmail.com To: Nishanth Devarajan Return-path: Received: from mail-pf0-f174.google.com ([209.85.192.174]:45366 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754291AbdKOINb (ORCPT ); Wed, 15 Nov 2017 03:13:31 -0500 Received: by mail-pf0-f174.google.com with SMTP id d28so16489916pfe.2 for ; Wed, 15 Nov 2017 00:13:31 -0800 (PST) In-Reply-To: <20171115013618.GA19575@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 15 Nov 2017 07:06:21 +0530, Nishanth Devarajan wrote: > This patch adapts the tc command line interface to allow bandwidth limits > to be specified as a percentage of the interface's capacity. > > For this purpose, we've modified and moved int read_prop() from > ip/iptuntap.c to lib.utils.c to make it accessible to tc. > > Additionally, adding this functionality requires passing the specified > device string to each class/qdisc which changes the prototype for a > couple of functions: the .parse_qopt and .parse_copt interfaces. The > device string is a required parameter for tc-qdisc and tc-class, and when > not specified, the kernel returns ENODEV. In this patch, if the user tries > to specify a bandwidth percentage without naming the device, we return an > error from userspace. > > Signed-off by: Nishanth Devarajan IMHO you need to at least add a big warning in the man page that the per cent speed means the fraction of *current* speed, and if the speed changes the value will not be recalculated.