Blob Blame History Raw
From b8864890b18903936a68cda65ed1401703a2c67f Mon Sep 17 00:00:00 2001
From: Andrea Claudi <aclaudi@redhat.com>
Date: Tue, 21 Apr 2020 14:32:49 +0200
Subject: [PATCH] man: Clarify idleslope calculation for tc-cbs

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1557461
Upstream Status: iproute2.git commit 1915af404fdbf

commit 1915af404fdbfbfef915078cec57d7425f500dd2
Author: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Date:   Fri Nov 10 14:34:36 2017 -0800

    man: Clarify idleslope calculation for tc-cbs

    In order to calculate the idleSlope parameter of CBS correctly, users
    must take into account the entire packet size, including the overhead
    from all layers.

    Add some more details to the man page to clarify that, giving one
    simple example and pointing users to the correct 802.1Q section for
    further clarifications if needed.

    Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
---
 man/man8/tc-cbs.8 | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/man/man8/tc-cbs.8 b/man/man8/tc-cbs.8
index 97e00c84ded16..32e1e0d4089fb 100644
--- a/man/man8/tc-cbs.8
+++ b/man/man8/tc-cbs.8
@@ -43,7 +43,19 @@ 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.
+algorithm and represents the bandwidth that will be consumed.
+Note that when calculating idleslope, the entire packet size must be
+considered, including headers from all layers (i.e. MAC framing and any
+overhead from the physical layer), as described by IEEE 802.1Q-2014
+section 34.4.
+
+As an example, for an ethernet frame carrying 284 bytes of payload,
+and with no VLAN tags, you must add 14 bytes for the Ethernet headers,
+4 bytes for the Frame check sequence (CRC), and 20 bytes for the L1
+overhead: 12 bytes of interpacket gap, 7 bytes of preamble and 1 byte
+of start of frame delimiter. That results in 322 bytes for the total
+packet size, which is then used for calculating the idleslope.
+
 .TP
 sendslope
 Sendslope is the rate of credits that is depleted (it should be a
-- 
2.25.3