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@citrix.com>
// 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))
__TransmitterRingReleaseLock(Ring);
}