net: hns3: fix tm port shapping of fibre port is incorrect after driver initialization
authorGuangbin Huang <huangguangbin2@huawei.com>
Sat, 11 Jun 2022 12:25:29 +0000 (20:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jun 2022 12:22:01 +0000 (14:22 +0200)
commit21dda97d095cdb7b1681ccc51f83b5679e8adfd9
tree8db523c3577ca69da2d12b50e28a1777419d2fa0
parent36c95d9bd2ade9a36fc765060496e2f322efbac1
net: hns3: fix tm port shapping of fibre port is incorrect after driver initialization

[ Upstream commit 12a3670887725df364cc3e030cf3bede6f13b364 ]

Currently in driver initialization process, driver will set shapping
parameters of tm port to default speed read from firmware. However, the
speed of SFP module may not be default speed, so shapping parameters of
tm port may be incorrect.

To fix this problem, driver sets new shapping parameters for tm port
after getting exact speed of SFP module in this case.

Fixes: 88d10bd6f730 ("net: hns3: add support for multiple media type")
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h