Subject: Re: [PATCH net v2] net: cbs: Fix software cbs to consider packet sending time

From: Vinicius Costa Gomes <[email-masked]>
Date: Mon, 23 Mar 2020 12:39:37 -0700

Hi,

Zh-yuan Ye <[email-masked]> writes:

> 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.

Yeah, this improves (a lot) the accuracy of the software mode when
dealing with larger packets:

| Idleslope (packet size) | Old (bps) | New (bps) |
|-------------------------+-----------+-----------|
| 500mbps (100bytes)      | 528M      | 492M      |
| 500mbps (1500bytes)     | 622M      | 499M      |
| 1mbps (100bytes)        | 1007k     | 1006k     |
| 1mbps (1500bytes)       | 1010k     | 1010k     |

(Sorry for the mess of units)

So, when the comments from Jakub are addressed:

Reviewed-by: Vinicius Costa Gomes <[email-masked]>

Cheers,
-- 
Vinicius