Does a driver perform DMA?

Hi

I’m performing some benchmark tests to high performance ethernet drivers, which receive data at about 800 Mbit/sec, on a 1Gbit PCI NIC.
It makes sense to me that such performance won’t be achived without performing DMA, but is there a way to find out if a driver performs DMA?

Thanks
Tal

Link /dump /imports <driver.sys>

Will give you the import table. Look for DMA related APIs.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Saturday, December 01, 2012 9:32 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Does a driver perform DMA?

Hi

I’m performing some benchmark tests to high performance ethernet drivers, which receive data at about 800 Mbit/sec, on a 1Gbit PCI NIC.
It makes sense to me that such performance won’t be achived without performing DMA, but is there a way to find out if a driver performs DMA?

Thanks
Tal


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</driver.sys>

It would be beyond retarded if a GigaE doesn’t use DMA but you can reliably
confirm it by using a bus analyzer. Or you could clobber the bus mastering
bit in PCI CSR to see if the NIC still works.

Calvin
Sent from my PC on WIN8

On Sat, Dec 1, 2012 at 9:31 PM, wrote:

> Hi
>
> I’m performing some benchmark tests to high performance ethernet drivers,
> which receive data at about 800 Mbit/sec, on a 1Gbit PCI NIC.
> It makes sense to me that such performance won’t be achived without
> performing DMA, but is there a way to find out if a driver performs DMA?
>
> Thanks
> Tal
>
> —
> 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
>

I worked on a driver for a 10G NIC and I can assure you that they use DMA – the hardware in question had no other way
in which to transfer data. ?Programmed I/O is a couple of orders of magnitude slower.


From: Calvin Guan (news)
>To: Windows System Software Devs Interest List
>Sent: Saturday, December 1, 2012 10:12 PM
>Subject: Re: [ntdev] Does a driver perform DMA?
>
>
>It would be beyond?retarded if a GigaE doesn’t use DMA but you can reliably confirm it by using a bus analyzer. Or you could clobber the bus mastering bit in PCI CSR to see if the NIC still works.
>?
>Calvin
>Sent from my PC on WIN8
>
>
>?
>On Sat, Dec 1, 2012 at 9:31 PM, wrote:
>
>Hi
>>
>>I’m performing some benchmark tests to high performance ethernet drivers, which receive data at about 800 Mbit/sec, on a 1Gbit PCI NIC.
>>It makes sense to me that such performance won’t be achived without performing DMA, but is there a way to find out if a driver performs DMA?
>>
>>Thanks
>>Tal
>>
>>—
>>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
>>
>—
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
>
>

Note that “using DMA” is not a definitive test. Under some conditions,
such as a device without scatter/gather capabilities, the DMA will be to a
relatively small internal buffer, and the must be copied to its target
buffer. So you need to investigate fairly closely what is going on.

Also, running under the Driver Verifier with DMA checking enabled will
also introduce a serious performance hit.

One rather gross hack might be to put a breakpoint at the place where it
allocates the DMA adapter and examine the parameters the driver has
specified. I’m on my iPad rght now and don’t have access to the
documentation.

If you have the driver source, it would much easier, but if you don’t, you
will need to examine the Adapter specifications to see what they say.
This can be very painful if you just set a breakpoint, because you only
want to see the parameters for the network device, Maybe some WinDbg
wizard can write a script that does this, but I can’t.
joe

I worked on a driver for a 10G NIC and I can assure you that they use DMA
– the hardware in question had no other way
in which to transfer data.  Programmed I/O is a couple of orders of
magnitude slower.

>________________________________
> From: Calvin Guan (news)
>>To: Windows System Software Devs Interest List
>>Sent: Saturday, December 1, 2012 10:12 PM
>>Subject: Re: [ntdev] Does a driver perform DMA?
>>
>>
>>It would be beyond retarded if a GigaE doesn’t use DMA but you can
>> reliably confirm it by using a bus analyzer. Or you could clobber the bus
>> mastering bit in PCI CSR to see if the NIC still works.
>>
>>Calvin
>>Sent from my PC on WIN8
>>
>>
>>
>>On Sat, Dec 1, 2012 at 9:31 PM, wrote:
>>
>>Hi
>>>
>>>I’m performing some benchmark tests to high performance ethernet
>>> drivers, which receive data at about 800 Mbit/sec, on a 1Gbit PCI NIC.
>>>It makes sense to me that such performance won’t be achived without
>>> performing DMA, but is there a way to find out if a driver performs DMA?
>>>
>>>Thanks
>>>Tal
>>>
>>>—
>>>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
>>>
>>—
> 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
>>
>>
> —
> 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

Hi

Thanks a lot for your help.
So, my options to test if some driver uses DMA are:

  1. use bus analyzer
  2. meddle with the PCI CSR
  3. search for DMA related APIs
  4. turn on driver verifier with DMA checking enabled and check if there is serious performance degradation.
  5. using breakpoints…

Thanks again
Tal

Not quite. What I said was that if the DMA uses “bounce buffers” then
steps 1-3 willsay “it uses DMA”, but not “it does not use DMA well”. If
you are seeing performance problems, it could be because of these
intermediate staging buffers. Also, if you are measuring performance, I
was saying that you have to be sure DV is not running with DMA
verification on. This introduces an intermediate buffering scheme managed
by DV. If the original driver required the OS to use intermediate
buffers, this would mean two levels of intermediate buffers, I think. So
knowing it uses DMA well is more important than simply knowing it uses
DMA. Detailed analysis of bus analyzer output could tell you if it
expending cycles to fetch items from a scatter/gather list, but you’d
have to know a lot about the controller chip to interpret that. And that
would tell you that the controller chip had S/G capabilities. But it
wouldn’t tell you if the driver was configured to use them.
joe

Hi

Thanks a lot for your help.
So, my options to test if some driver uses DMA are:

  1. use bus analyzer
  2. meddle with the PCI CSR
  3. search for DMA related APIs
  4. turn on driver verifier with DMA checking enabled and check if there is
    serious performance degradation.
  5. using breakpoints…

Thanks again
Tal


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

Fetching SGL and data are separate DMA transactions on the bus. It’s
usually easy to observe SGL fetch transactions because it contains physical
address the subsequent data DMA transactions will assert. I once carefully
watched my competitions’ DMA behavior without any datasheet or technical
detail from them.
Calvin Guan
Sent from my PC on WIN8
On Sun, Dec 2, 2012 at 3:51 PM, wrote:

> Not quite. What I said was that if the DMA uses “bounce buffers” then
> steps 1-3 willsay “it uses DMA”, but not “it does not use DMA well”. If
> you are seeing performance problems, it could be because of these
> intermediate staging buffers. Also, if you are measuring performance, I
> was saying that you have to be sure DV is not running with DMA
> verification on. This introduces an intermediate buffering scheme managed
> by DV. If the original driver required the OS to use intermediate
> buffers, this would mean two levels of intermediate buffers, I think. So
> knowing it uses DMA well is more important than simply knowing it uses
> DMA. Detailed analysis of bus analyzer output could tell you if it
> expending cycles to fetch items from a scatter/gather list, but you’d
> have to know a lot about the controller chip to interpret that. And that
> would tell you that the controller chip had S/G capabilities. But it
> wouldn’t tell you if the driver was configured to use them.
> joe
>
> > Hi
> >
> > Thanks a lot for your help.
> > So, my options to test if some driver uses DMA are:
> > 1) use bus analyzer
> > 2) meddle with the PCI CSR
> > 3) search for DMA related APIs
> > 4) turn on driver verifier with DMA checking enabled and check if there
> is
> > serious performance degradation.
> > 5) using breakpoints…
> >
> > Thanks again
> > Tal
> >
> > —
> > 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
> >
>
>
>
> —
> 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
>