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

net/sched: taprio: fix picos_per_byte miscalculation

The Time Aware Priority Scheduler is heavily dependent to link speed,
it relies on it to calculate transmission bytes per cycle, we can't
properly calculate the so called budget if the device has failed
to report the link speed.

In that case we can't dequeue packets assuming a wrong budget.
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 re calculate the budget whenever the link speed is
changed.

Fixes: 5a781ccb

 ("tc: Add support for configuring the taprio scheduler")
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 93e21254
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