Commit ae9425eb authored by Peiyang Wang's avatar Peiyang Wang Committed by Jiantao Xiao
Browse files

net: hns3: restore user pause configure when disable autoneg

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7B8SA


CVE: NA

----------------------------------------------------------------------

Restore the mac pause state to user configuration when autoneg is disabled

Fixes: 1770a7a3 ("net: hns3: add support to update flow control settings after autoneg")
Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarPeiyang Wang <wangpeiyang1@huawei.com>
parent 68023e07
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -11392,9 +11392,12 @@ int hclge_cfg_flowctrl(struct hclge_dev *hdev)
	u32 rx_pause, tx_pause;
	u8 flowctl;

	if (!phydev->link || !phydev->autoneg)
	if (!phydev->link)
		return 0;

	if (!phydev->autoneg)
		return hclge_mac_pause_setup_hw(hdev);

	local_advertising = linkmode_adv_to_lcl_adv_t(phydev->advertising);

	if (phydev->pause)
+1 −1
Original line number Diff line number Diff line
@@ -1552,7 +1552,7 @@ static int hclge_bp_setup_hw(struct hclge_dev *hdev, u8 tc)
	return 0;
}

static int hclge_mac_pause_setup_hw(struct hclge_dev *hdev)
int hclge_mac_pause_setup_hw(struct hclge_dev *hdev)
{
	bool tx_en, rx_en;

+1 −0
Original line number Diff line number Diff line
@@ -247,6 +247,7 @@ int hclge_pfc_pause_en_cfg(struct hclge_dev *hdev, u8 tx_rx_bitmap,
int hclge_pause_param_cfg(struct hclge_dev *hdev, const u8 *addr,
			  u8 pause_trans_gap, u16 pause_trans_time);
int hclge_pause_addr_cfg(struct hclge_dev *hdev, const u8 *mac_addr);
int hclge_mac_pause_setup_hw(struct hclge_dev *hdev);
void hclge_pfc_rx_stats_get(struct hclge_dev *hdev, u64 *stats);
void hclge_pfc_tx_stats_get(struct hclge_dev *hdev, u64 *stats);
int hclge_tm_qs_shaper_cfg(struct hclge_vport *vport, int max_tx_rate);