|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 3/3] Avoid requeuing QueueDpc during ring swizzles
If a ring is paused by xennet, __ReceiverRingSwizzle immediately queues
another QueueDpc. In low-resource conditions where NDIS is unable to
process traffic, this will cause an infinite cascade of DPCs and lock up
the system.
Stop doing that in __ReceiverRingSwizzle. Instead, requeue QueueDpc from
ReceiverReturnPacket after incrementing Receiver->Returned to reevaluate
the paused status. This ensures that incoming traffic storms can be
safely handled.
Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
src/xenvif/receiver.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 29bd325..95a4f5c 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -1560,11 +1560,12 @@ __ReceiverRingSwizzle(
Pause = FALSE;
}
+ // If there will be no more returns then we can't pause either
+ if (Pause && Receiver->Loaned == Receiver->Returned)
+ Pause = FALSE;
+
if (Pause) {
Ring->Paused = TRUE;
-
- if (KeInsertQueueDpc(&Ring->QueueDpc, NULL, NULL))
- Ring->QueueDpcs++;
} else {
BOOLEAN Paused = Ring->Paused;
@@ -3796,6 +3797,9 @@ ReceiverReturnPacket(
ASSERT3S(Loaned - Returned, >=, 0);
+ if (KeInsertQueueDpc(&Ring->QueueDpc, NULL, NULL))
+ Ring->QueueDpcs++;
+
KeSetEvent(&Receiver->Event, 0, FALSE);
}
--
2.54.0.windows.1
--
Ngoc Tu Dinh | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |