Commit 054fc483 authored by Song, Yoong Siang's avatar Song, Yoong Siang Committed by Zheng Zengkai
Browse files

net: stmmac: fix CBS idleslope and sendslope calculation



stable inclusion
from stable-5.10.20
commit ba817c1766086d8eb0502299a245a3c1547f655a
bugzilla: 50608

--------------------------------

[ Upstream commit 24877687 ]

When link speed is not 100 Mbps, port transmit rate and speed divider
are set to 8 and 1000000 respectively. These values are incorrect for
CBS idleslope and sendslope HW values calculation if the link speed is
not 1 Gbps.

This patch adds switch statement to set the values of port transmit rate
and speed divider for 10 Gbps, 5 Gbps, 2.5 Gbps, 1 Gbps, and 100 Mbps.
Note that CBS is not supported at 10 Mbps.

Fixes: bc41a668 ("net: stmmac: tc: Remove the speed dependency")
Fixes: 1f705bc6 ("net: stmmac: Add support for CBS QDISC")
Signed-off-by: default avatarSong, Yoong Siang <yoong.siang.song@intel.com>
Link: https://lore.kernel.org/r/1613655653-11755-1-git-send-email-yoong.siang.song@intel.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 409b25f4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment