]> 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)
commitc5be83edd9a7d365e3b622bf0e011d4358abf0f0
treec196fec3dee5abfe735f3d729c65230caa28de13
parent67ef158f6477dbe86fc8c6e51ea49fa0a6c84981
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: c7f305f4e520 ("net: stmmac: tc: Remove the speed dependency")
Fixes: b90b7d94040f ("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