wdf dma throughput

My xen pvUSB driver is now working properly for USB on my test device,
so I’m looking at improving performance.

Communication between the VM where the hardware drivers are and the
Windows VM is done by a shared memory ring, and I can have multiple
outstanding requests on the ring. So when Windows gives me 65536 bytes
of data, I use the WdfDmaXxx routines to deliver it onto the ring one
packet at a time. WdfDmaXxx relies on each ring request being completed
before the next one can be delivered… I would get better performance
if I could have the next one on the ring beforehand, but I’m not sure
that that can be done in a single DMA transaction.

I’m also not sure that the ‘backend’ driver on the other side of the
rings is going to work like this anyway - in a buffer underrun condition
when I have delivered 65536 bytes worth of read requests I don’t think
it will know what to do with the rest if it only satisfies (say) 1024
bytes of data… but I’d still like to know if it’s possible for
WdfDmaXxx to handle it or do I need to create one transaction per ring
request?

Thanks

James

I would think one transaction per ring request, but in the end this is your design so you know best

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: James Harper
Sent: Friday, September 11, 2009 8:53 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] wdf dma throughput

My xen pvUSB driver is now working properly for USB on my test device,
so I’m looking at improving performance.

Communication between the VM where the hardware drivers are and the
Windows VM is done by a shared memory ring, and I can have multiple
outstanding requests on the ring. So when Windows gives me 65536 bytes
of data, I use the WdfDmaXxx routines to deliver it onto the ring one
packet at a time. WdfDmaXxx relies on each ring request being completed
before the next one can be delivered… I would get better performance
if I could have the next one on the ring beforehand, but I’m not sure
that that can be done in a single DMA transaction.

I’m also not sure that the ‘backend’ driver on the other side of the
rings is going to work like this anyway - in a buffer underrun condition
when I have delivered 65536 bytes worth of read requests I don’t think
it will know what to do with the rest if it only satisfies (say) 1024
bytes of data… but I’d still like to know if it’s possible for
WdfDmaXxx to handle it or do I need to create one transaction per ring
request?

Thanks

James


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

A DMA operation requires some initialization and if you delivery more data in one DMA operation it would definitely improve the performance of your driver . But before giving some advises I wold like to ask some questions.
How big is your packet? Is it 1024 bytes? Does a packet have fixed length?
Do you have any controls on a design of “backend” driver?

Igor Sharovar