Unverified Commit 7534c47e authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!3301 unic: Change the max frame size sent to firmware

Merge Pull Request from: @mufengyan 
 
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>
 
Link:https://gitee.com/openeuler/kernel/pulls/3301

 

Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 917584d1 436a3f75
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -11222,6 +11222,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->max_frm_size = cpu_to_le16(new_mps);
	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);
}
@@ -12411,6 +12415,10 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)

	/* HW supprt 2 layer vlan */
	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);
	spin_lock_init(&hdev->fd_rule_lock);