Skip to content

Commit 908d4bb

Browse files
manishc88davem330
authored andcommitted
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: Manish Chopra <[email protected]> Fixes: b0ec548 ("qede: preserve per queue stats across up/down of interface") Cc: [email protected] Cc: Bhaskar Upadhaya <[email protected]> Cc: David S. Miller <[email protected]> Link: https://bugzilla.redhat.com/show_bug.cgi?id=2160054 Signed-off-by: Alok Prasad <[email protected]> Signed-off-by: Ariel Elior <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 475f9ff commit 908d4bb

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/net/ethernet/qlogic/qede/qede_main.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -970,8 +970,15 @@ static int qede_alloc_fp_array(struct qede_dev *edev)
970970
goto err;
971971
}
972972

973-
mem = krealloc(edev->coal_entry, QEDE_QUEUE_CNT(edev) *
974-
sizeof(*edev->coal_entry), GFP_KERNEL);
973+
if (!edev->coal_entry) {
974+
mem = kcalloc(QEDE_MAX_RSS_CNT(edev),
975+
sizeof(*edev->coal_entry), GFP_KERNEL);
976+
} else {
977+
mem = krealloc(edev->coal_entry,
978+
QEDE_QUEUE_CNT(edev) * sizeof(*edev->coal_entry),
979+
GFP_KERNEL);
980+
}
981+
975982
if (!mem) {
976983
DP_ERR(edev, "coalesce entry allocation failed\n");
977984
kfree(edev->coal_entry);

0 commit comments

Comments
 (0)