提交 908d4bb7 编写于 作者: M Manish Chopra 提交者: David S. Miller

qede: fix interrupt coalescing configuration

On default driver load device gets configured with unexpected
higher interrupt coalescing values instead of default expected
values as memory allocated from krealloc() is not supposed to
be zeroed out and may contain garbage values.

Fix this by allocating the memory of required size first with
kcalloc() and then use krealloc() to resize and preserve the
contents across down/up of the interface.
Signed-off-by: NManish Chopra <manishc@marvell.com>
Fixes: b0ec5489 ("qede: preserve per queue stats across up/down of interface")
Cc: stable@vger.kernel.org
Cc: Bhaskar Upadhaya <bupadhaya@marvell.com>
Cc: David S. Miller <davem@davemloft.net>
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2160054Signed-off-by: NAlok Prasad <palok@marvell.com>
Signed-off-by: NAriel Elior <aelior@marvell.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 475f9ff6
......@@ -970,8 +970,15 @@ static int qede_alloc_fp_array(struct qede_dev *edev)
goto err;
}
mem = krealloc(edev->coal_entry, QEDE_QUEUE_CNT(edev) *
sizeof(*edev->coal_entry), GFP_KERNEL);
if (!edev->coal_entry) {
mem = kcalloc(QEDE_MAX_RSS_CNT(edev),
sizeof(*edev->coal_entry), GFP_KERNEL);
} else {
mem = krealloc(edev->coal_entry,
QEDE_QUEUE_CNT(edev) * sizeof(*edev->coal_entry),
GFP_KERNEL);
}
if (!mem) {
DP_ERR(edev, "coalesce entry allocation failed\n");
kfree(edev->coal_entry);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册