Skip to content
Commit e0a7683d authored by Leandro Dorileo's avatar Leandro Dorileo Committed by David S. Miller
Browse files

net/sched: cbs: fix port_rate miscalculation



The Credit Based Shaper heavily depends on link speed to calculate
the scheduling credits, we can't properly calculate the credits if the
device has failed to report the link speed.

In that case we can't dequeue packets assuming a wrong port rate that will
result into an inconsistent credit distribution.

This patch makes sure we fail to dequeue case:

1) __ethtool_get_link_ksettings() reports error or 2) the ethernet driver
failed to set the ksettings' speed value (setting link speed to
SPEED_UNKNOWN).

Additionally we properly re calculate the port rate whenever the link speed
is changed.

Fixes: 3d0bd028 ("net/sched: Add support for HW offloading for CBS")
Signed-off-by: default avatarLeandro Dorileo <leandro.maciel.dorileo@intel.com>
Reviewed-by: default avatarVedang Patel <vedang.patel@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7b9eba7b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment