提交 511a5491 编写于 作者: S shenjian 提交者: Xie XiuQi

net: hns3: fix flow control configure issue for fibre port

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

Flow control autoneg is unsupported for fibre port. It takes no
effect for flow control when restart autoneg. This patch fixes
it, return -EOPNOTSUPP whn user tries to enable flow control
autoneg.

Feature or Bugfix:Bugfix
Signed-off-by: Nshenjian (K) <shenjian15@huawei.com>
Reviewed-by: Nlipeng <lipeng321@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 7366234e
...@@ -8265,8 +8265,9 @@ static void hclge_get_pauseparam(struct hnae3_handle *handle, u32 *auto_neg, ...@@ -8265,8 +8265,9 @@ static void hclge_get_pauseparam(struct hnae3_handle *handle, u32 *auto_neg,
{ {
struct hclge_vport *vport = hclge_get_vport(handle); struct hclge_vport *vport = hclge_get_vport(handle);
struct hclge_dev *hdev = vport->back; struct hclge_dev *hdev = vport->back;
struct phy_device *phydev = hdev->hw.mac.phydev;
*auto_neg = hclge_get_autoneg(handle); *auto_neg = phydev ? hclge_get_autoneg(handle) : 0;
if (hdev->tm_info.fc_mode == HCLGE_FC_PFC) { if (hdev->tm_info.fc_mode == HCLGE_FC_PFC) {
*rx_en = 0; *rx_en = 0;
...@@ -8297,11 +8298,13 @@ static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg, ...@@ -8297,11 +8298,13 @@ static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg,
struct phy_device *phydev = hdev->hw.mac.phydev; struct phy_device *phydev = hdev->hw.mac.phydev;
u32 fc_autoneg; u32 fc_autoneg;
fc_autoneg = hclge_get_autoneg(handle); if (phydev) {
if (auto_neg != fc_autoneg) { fc_autoneg = hclge_get_autoneg(handle);
dev_info(&hdev->pdev->dev, if (auto_neg != fc_autoneg) {
"To change autoneg please use: ethtool -s <dev> autoneg <on|off>\n"); dev_info(&hdev->pdev->dev,
return -EOPNOTSUPP; "To change autoneg please use: ethtool -s <dev> autoneg <on|off>\n");
return -EOPNOTSUPP;
}
} }
if (hdev->tm_info.fc_mode == HCLGE_FC_PFC) { if (hdev->tm_info.fc_mode == HCLGE_FC_PFC) {
...@@ -8312,16 +8315,13 @@ static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg, ...@@ -8312,16 +8315,13 @@ static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg,
hclge_set_flowctrl_adv(hdev, rx_en, tx_en); hclge_set_flowctrl_adv(hdev, rx_en, tx_en);
if (!fc_autoneg) if (!auto_neg)
return hclge_cfg_pauseparam(hdev, rx_en, tx_en); return hclge_cfg_pauseparam(hdev, rx_en, tx_en);
if (phydev) if (phydev)
return phy_start_aneg(phydev); return phy_start_aneg(phydev);
if (hdev->pdev->revision == 0x20) return -EOPNOTSUPP;
return -EOPNOTSUPP;
return hclge_restart_autoneg(handle);
} }
static void hclge_get_ksettings_an_result(struct hnae3_handle *handle, static void hclge_get_ksettings_an_result(struct hnae3_handle *handle,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册