提交 f6a24955 编写于 作者: C Chiqijun 提交者: Yang Yingliang

net/hinic: Add the maximum value of the module parameter poll_weight

driver inclusion
category: bugfix
bugzilla: 4472

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

When the module parameter poll_weight is set to 2^32-1, driver cannot
receive packets. We limit the maximum value of poll weight with
queue depth(4K).
Signed-off-by: NChiqijun <chiqijun@huawei.com>
Reviewed-by: NZengweiliang <zengweiliang.zengweiliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 7b075e22
...@@ -2527,12 +2527,23 @@ static int hinic_validate_parameters(struct hinic_lld_dev *lld_dev) ...@@ -2527,12 +2527,23 @@ static int hinic_validate_parameters(struct hinic_lld_dev *lld_dev)
bp_upper_thd = HINIC_RX_BP_UPPER_THD; bp_upper_thd = HINIC_RX_BP_UPPER_THD;
} }
/* Check poll_weight value, default poll_weight is 64.
* The poll_weight isn't more than max queue depth,
* so the valid value range is 1~4096.
*/
if (!poll_weight) { if (!poll_weight) {
nic_warn(&pdev->dev, "Module Parameter poll_weight can not be 0, resetting to %d\n", nic_warn(&pdev->dev, "Module Parameter poll_weight can not be 0, resetting to %d\n",
DEFAULT_POLL_WEIGHT); DEFAULT_POLL_WEIGHT);
poll_weight = DEFAULT_POLL_WEIGHT; poll_weight = DEFAULT_POLL_WEIGHT;
} }
if (poll_weight > HINIC_MAX_QUEUE_DEPTH) {
nic_warn(&pdev->dev, "Module Parameter poll_weight value %u is out of 1~%d, resetting to max value %d\n",
poll_weight, HINIC_MAX_QUEUE_DEPTH,
HINIC_MAX_QUEUE_DEPTH);
poll_weight = HINIC_MAX_QUEUE_DEPTH;
}
/* check rx_buff value, default rx_buff is 2KB. /* check rx_buff value, default rx_buff is 2KB.
* Invalid rx_buff include 2KB/4KB/8KB/16KB. * Invalid rx_buff include 2KB/4KB/8KB/16KB.
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册