]> git.baikalelectronics.ru Git - kernel.git/commit
net: cbs: Fix software cbs to consider packet sending time
authorZh-yuan Ye <ye.zh-yuan@socionext.com>
Tue, 24 Mar 2020 08:28:25 +0000 (17:28 +0900)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Mar 2020 23:14:05 +0000 (16:14 -0700)
commit53e2126a242f4ff6505e3442ebe784a0ebfc61cf
treefcb396f0cf79c5b519fd171879e67ce09393eabf
parent7081811a3dc3d9a5664a08fbf822958cec77d9c4
net: cbs: Fix software cbs to consider packet sending time

Currently the software CBS does not consider the packet sending time
when depleting the credits. It caused the throughput to be
Idleslope[kbps] * (Port transmit rate[kbps] / |Sendslope[kbps]|) where
Idleslope * (Port transmit rate / (Idleslope + |Sendslope|)) = Idleslope
is expected. In order to fix the issue above, this patch takes the time
when the packet sending completes into account by moving the anchor time
variable "last" ahead to the send completion time upon transmission and
adding wait when the next dequeue request comes before the send
completion time of the previous packet.

changelog:
V2->V3:
 - remove unnecessary whitespace cleanup
 - add the checks if port_rate is 0 before division

V1->V2:
 - combine variable "send_completed" into "last"
 - add the comment for estimate of the packet sending

Fixes: 92c6bd6c8cc7 ("net/sched: Introduce Credit Based Shaper (CBS) qdisc")
Signed-off-by: Zh-yuan Ye <ye.zh-yuan@socionext.com>
Reviewed-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_cbs.c