]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
net: stmmac: replace priv->speed with the portTransmitRate from the tc-cbs parameters
authorXiaolei Wang <xiaolei.wang@windriver.com>
Sat, 8 Jun 2024 14:35:24 +0000 (22:35 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 12 Jun 2024 02:58:18 +0000 (19:58 -0700)
commitbe27b896529787e23a35ae4befb6337ce73fcca0
tree2433b6854a071183ba17b94a7178e33247c054a8
parent1b9f756344416e02b41439bf2324b26aa25e141c
net: stmmac: replace priv->speed with the portTransmitRate from the tc-cbs parameters

The current cbs parameter depends on speed after uplinking,
which is not needed and will report a configuration error
if the port is not initially connected. The UAPI exposed by
tc-cbs requires userspace to recalculate the send slope anyway,
because the formula depends on port_transmit_rate (see man tc-cbs),
which is not an invariant from tc's perspective. Therefore, we
use offload->sendslope and offload->idleslope to derive the
original port_transmit_rate from the CBS formula.

Fixes: 1f705bc61aee ("net: stmmac: Add support for CBS QDISC")
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20240608143524.2065736-1-xiaolei.wang@windriver.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c