Commit d221df4e authored by Yunsheng Lin's avatar Yunsheng Lin Committed by David S. Miller
Browse files

net: hns3: Fix for DEFAULT_DV when dev doesn't support DCB



When ae_dev doesn't support DCB, DEFAULT_DV must be set to
a lower value, otherwise the buffer allocation process will
fail.
This patch fix it by setting it to 30K bytes.

Fixes: 46a3df9f ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: default avatarYunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2daf4a65
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -688,6 +688,7 @@ struct hclge_reset_tqp_queue {
#define HCLGE_DEFAULT_TX_BUF		0x4000	 /* 16k  bytes */
#define HCLGE_TOTAL_PKT_BUF		0x108000 /* 1.03125M bytes */
#define HCLGE_DEFAULT_DV		0xA000	 /* 40k byte */
#define HCLGE_DEFAULT_NON_DCB_DV	0x7800	/* 30K byte */

#define HCLGE_TYPE_CRQ			0
#define HCLGE_TYPE_CSQ			1
+5 −1
Original line number Diff line number Diff line
@@ -1444,7 +1444,11 @@ static bool hclge_is_rx_buf_ok(struct hclge_dev *hdev, u32 rx_all)
	tc_num = hclge_get_tc_num(hdev);
	pfc_enable_num = hclge_get_pfc_enalbe_num(hdev);

	if (hnae3_dev_dcb_supported(hdev))
		shared_buf_min = 2 * hdev->mps + HCLGE_DEFAULT_DV;
	else
		shared_buf_min = 2 * hdev->mps + HCLGE_DEFAULT_NON_DCB_DV;

	shared_buf_tc = pfc_enable_num * hdev->mps +
			(tc_num - pfc_enable_num) * hdev->mps / 2 +
			hdev->mps;