Commit 436a3f75 authored by Fengyan Mu's avatar Fengyan Mu Committed by Jie Liu
Browse files

unic: Change the max frame size sent to firmware

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


CVE: NA

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

Fix the problem that during driver initialization, the max
frame size sent to firmware is different from the value recorded
in driver in UB mode.
This patch change the max frame size configured in firmware
to 1500 from 1526.

Signed-off-by: default avatarFengyan Mu <mufengyan@hisilicon.com>
parent 7d7d4274
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -11162,6 +11162,10 @@ static int hclge_set_mac_mtu(struct hclge_dev *hdev, int new_mps)
	req = (struct hclge_config_max_frm_size_cmd *)desc.data;
	req = (struct hclge_config_max_frm_size_cmd *)desc.data;
	req->max_frm_size = cpu_to_le16(new_mps);
	req->max_frm_size = cpu_to_le16(new_mps);
	req->min_frm_size = HCLGE_MAC_MIN_FRAME;
	req->min_frm_size = HCLGE_MAC_MIN_FRAME;
#ifdef CONFIG_HNS3_UBL
	if (hnae3_dev_ubl_supported(hdev->ae_dev))
		req->min_frm_size = UB_MIN_MTU;
#endif


	return hclge_cmd_send(&hdev->hw, &desc, 1);
	return hclge_cmd_send(&hdev->hw, &desc, 1);
}
}
@@ -12351,6 +12355,10 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)


	/* HW supprt 2 layer vlan */
	/* HW supprt 2 layer vlan */
	hdev->mps = ETH_FRAME_LEN + ETH_FCS_LEN + 2 * VLAN_HLEN;
	hdev->mps = ETH_FRAME_LEN + ETH_FCS_LEN + 2 * VLAN_HLEN;
#ifdef CONFIG_HNS3_UBL
	if (hnae3_dev_ubl_supported(ae_dev))
		hdev->mps = UB_DATA_LEN;
#endif


	mutex_init(&hdev->vport_lock);
	mutex_init(&hdev->vport_lock);
	spin_lock_init(&hdev->fd_rule_lock);
	spin_lock_init(&hdev->fd_rule_lock);