[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH 2/3] Avoid transmitting on the wrong CPU

The transmit and receive rings have DPCs and event channels affinitized
to a particular CPU. Thus, when XENNET queues a new packet at the
transmit side, make sure the packet is prepared and posted from the
CPU to which the DPC and event channel are bound to avoid lock contention.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
 src/xenvif/transmitter.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index 19636b3..95c3479 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -4007,7 +4007,9 @@ __TransmitterRingQueuePacket(
     // grab it then that's ok because whichever thread is holding it will have 
to call
     // __TransmitterRingReleaseLock() and will therefore drain the atomic 
packet list.
-    if (__TransmitterRingTryAcquireLock(Ring))
+    if (Ring->Index != KeGetCurrentProcessorNumberEx(NULL))
+        KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
+    else if (__TransmitterRingTryAcquireLock(Ring))

win-pv-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.