From patchwork Wed Oct 11 00:46:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinicius Costa Gomes X-Patchwork-Id: 824155 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=osuosl.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yBb0d5B7Bz9t5x for ; Wed, 11 Oct 2017 11:47:13 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1B50B88BA0; Wed, 11 Oct 2017 00:47:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Vx7ZHLksMAJK; Wed, 11 Oct 2017 00:47:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8E0E688B67; Wed, 11 Oct 2017 00:47:10 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 2CAF71C0FDB for ; Wed, 11 Oct 2017 00:47:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2742589012 for ; Wed, 11 Oct 2017 00:47:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lcKxeH4FsOqy for ; Wed, 11 Oct 2017 00:47:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by whitealder.osuosl.org (Postfix) with ESMTPS id A619B89520 for ; Wed, 11 Oct 2017 00:47:08 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Oct 2017 17:47:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,359,1503385200"; d="scan'208";a="908716157" Received: from ellie.jf.intel.com (HELO localhost.localdomain) ([10.24.13.71]) by FMSMGA003.fm.intel.com with ESMTP; 10 Oct 2017 17:47:07 -0700 From: Vinicius Costa Gomes To: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org Date: Tue, 10 Oct 2017 17:46:52 -0700 Message-Id: <20171011004652.15630-3-vinicius.gomes@intel.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171011004652.15630-1-vinicius.gomes@intel.com> References: <20171011004652.15630-1-vinicius.gomes@intel.com> Cc: rodney.cummings@ni.com, andre.guedes@intel.com, jiri@resnulli.us, ivan.briano@intel.com, richardcochran@gmail.com, henrik@austad.us, jhs@mojatatu.com, levipearson@gmail.com, boon.leong.ong@intel.com, xiyou.wangcong@gmail.com, jesus.sanchez-palencia@intel.com Subject: [Intel-wired-lan] [iproute2 net-next v2 3/3] man: Add initial manpage for tc-cbs(8) X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Signed-off-by: Vinicius Costa Gomes --- man/man8/tc-cbs.8 | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 man/man8/tc-cbs.8 diff --git a/man/man8/tc-cbs.8 b/man/man8/tc-cbs.8 new file mode 100644 index 00000000..97e00c84 --- /dev/null +++ b/man/man8/tc-cbs.8 @@ -0,0 +1,112 @@ +.TH CBS 8 "18 Sept 2017" "iproute2" "Linux" +.SH NAME +CBS \- Credit Based Shaper (CBS) Qdisc +.SH SYNOPSIS +.B tc qdisc ... dev +dev +.B parent +classid +.B [ handle +major: +.B ] cbs idleslope +idleslope +.B sendslope +sendslope +.B hicredit +hicredit +.B locredit +locredit +.B [ offload +0|1 +.B ] + +.SH DESCRIPTION +The CBS (Credit Based Shaper) qdisc implements the shaping algorithm +defined by the IEEE 802.1Q-2014 Section 8.6.8.2, which applies a well +defined rate limiting method to the traffic. + +This queueing discipline is intended to be used by TSN (Time Sensitive +Networking) applications, the CBS parameters are derived directly by +what is described by the Annex L of the IEEE 802.1Q-2014 +Sepcification. The algorithm and how it affects the latency are +detailed there. + +CBS is meant to be installed under another qdisc that maps packet +flows to traffic classes, one example is +.BR mqprio(8). + +.SH PARAMETERS +.TP +idleslope +Idleslope is the rate of credits that is accumulated (in kilobits per +second) when there is at least one packet waiting for transmission. +Packets are transmitted when the current value of credits is equal or +greater than zero. When there is no packet to be transmitted the +amount of credits is set to zero. This is the main tunable of the CBS +algorithm. +.TP +sendslope +Sendslope is the rate of credits that is depleted (it should be a +negative number of kilobits per second) when a transmission is +ocurring. It can be calculated as follows, (IEEE 802.1Q-2014 Section +8.6.8.2 item g): + +sendslope = idleslope - port_transmit_rate + +.TP +hicredit +Hicredit defines the maximum amount of credits (in bytes) that can be +accumulated. Hicredit depends on the characteristics of interfering +traffic, 'max_interference_size' is the maximum size of any burst of +traffic that can delay the transmission of a frame that is available +for transmission for this traffic class, (IEEE 802.1Q-2014 Annex L, +Equation L-3): + +hicredit = max_interference_size * (idleslope / port_transmit_rate) + +.TP +locredit +Locredit is the minimum amount of credits that can be reached. It is a +function of the traffic flowing through this qdisc (IEEE 802.1Q-2014 +Annex L, Equation L-2): + +locredit = max_frame_size * (sendslope / port_transmit_rate) + +.TP +offload +When +.B offload +is 1, +.BR cbs(8) +will try to configure the network interface so the CBS algorithm runs +in the controller. The default is 0. + +.SH EXAMPLES + +CBS is used to enforce a Quality of Service by limiting the data rate +of a traffic class, to separate packets into traffic classes the user +may choose +.BR mqprio(8), +and configure it like this: + +.EX +# tc qdisc add dev eth0 handle 100: parent root mqprio num_tc 3 \\ + map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \\ + queues 1@0 1@1 2@2 \\ + hw 0 +.EE +.P +To replace the current queuing disciple by CBS in the current queueing +discipline connected to traffic class number 0, issue: +.P +.EX +# tc qdisc replace dev eth0 parent 100:4 cbs \\ + locredit -1470 hicredit 30 sendslope -980000 idleslope 20000 +.EE + +These values are obtained from the following parameters, idleslope is +20mbit/s, the transmission rate is 1Gbit/s and the maximum interfering +frame size is 1500 bytes. + +.SH AUTHORS +Vinicius Costa Gomes