]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: fix CBS idleslope and sendslope calculation
authorSong, Yoong Siang <yoong.siang.song@intel.com>
Thu, 18 Feb 2021 13:40:53 +0000 (21:40 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 23 Feb 2021 03:06:01 +0000 (19:06 -0800)
commit4a8f6db8d86c6b7ea2aa3df4eb92d8836c975217
treec196fec3dee5abfe735f3d729c65230caa28de13
parent4d776cb24784980a27dc2423fbb76110b2519019
net: stmmac: fix CBS idleslope and sendslope calculation

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: 09152c4d54f3 ("net: stmmac: tc: Remove the speed dependency")
Fixes: a53e7ca3ded6 ("net: stmmac: Add support for CBS QDISC")
Signed-off-by: Song, 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: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c