OSDN Git Service

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)
commit24877687b375f2c476ffb726ea915fc85df09e3d
treec196fec3dee5abfe735f3d729c65230caa28de13
parente5bcf0e8791375a720a5232a6c377240f85d08c2
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: bc41a6689b30 ("net: stmmac: tc: Remove the speed dependency")
Fixes: 1f705bc61aee ("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