Reusing IRP buffer for DMA transfer

Hi,
Is it possible to use a queue of IRPs
for DMA and when the last IRP is finished go back
to the first one and so on.
That means that these buffers are always locked and the IRPs are not
completed
can the user perform process on the buffer
in between ?

thanks,
Tomer Goldberg

No.
After you have filled the IRP's buffer with data, you must notify the app on this.
This notification can be done by IoCompleteRequest only.

And you cannot touch the IRP after IoCompleteRequest.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com

----- Original Message -----
From: Tomer Goldberg
To: Windows System Software Devs Interest List
Sent: Tuesday, July 27, 2004 1:40 PM
Subject: [ntdev] Reusing IRP buffer for DMA transfer

Hi,
Is it possible to use a queue of IRPs
for DMA and when the last IRP is finished go back
to the first one and so on.
That means that these buffers are always locked and the IRPs are not
completed
can the user perform process on the buffer
in between ?

thanks,
Tomer Goldberg

Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

What do you want to achieve?

good luck,

yogi

From: “Tomer Goldberg”

>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Reusing IRP buffer for DMA transfer
>Date: Tue, 27 Jul 2004 11:40:25 +0200
>
>
>Hi,
>Is it possible to use a queue of IRPs
>for DMA and when the last IRP is finished go back
>to the first one and so on.
>That means that these buffers are always locked and the IRPs are not
>completed
>can the user perform process on the buffer
>in between ?
>
>thanks,
>Tomer Goldberg
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


Get head-hunted by 10,000 recruiters. Post your CV on naukri.com today.

Yes but this is not a standard way to do things on WIndows. You would have
to invent your own side-channel notification facility in order to inform
your application that a buffer had valid data and equivalently to inform
your driver that this data had been consumed.

Your approach is the "shared user-mode/kernel-mode buffer" design pattern,
and it has been discussed ad nauseum. Search this list and the newsgroups
for more information.

Many of us are of the opinion that except in rare circumstances this design
pattern is One Big Waste Of Time, but your mileage may vary and/or your
particular design may be the exception that proves the rule.


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tomer Goldberg
Sent: Tuesday, July 27, 2004 5:40 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Reusing IRP buffer for DMA transfer

Hi,
Is it possible to use a queue of IRPs
for DMA and when the last IRP is finished go back
to the first one and so on.
That means that these buffers are always locked and the IRPs are not
completed
can the user perform process on the buffer
in between ?

thanks,
Tomer Goldberg

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

I don't know if this helps, but when I did 3D graphics for a living we had a
chain of common buffers, as large as we could afford (minimum 4Mb, typically
way more than that, and we were talking about 64Mb systems) and the driver
would append chip commands to the end of the current buffer. We treated it
as a kind of circular queue, so, one single I/O would transfer a huge amount
of stuff down to the graphics chip, and we'd try to keep that one I/O open
for as long as we could. But we did it on the iron, inside the graphics DLL
which was not a device driver per se, and we barely if ever used the OS
except for setup purposes.

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Tomer Goldberg
Sent: Tuesday, July 27, 2004 5:40 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Reusing IRP buffer for DMA transfer

Hi,
Is it possible to use a queue of IRPs
for DMA and when the last IRP is finished go back
to the first one and so on.
That means that these buffers are always locked and the IRPs are not
completed
can the user perform process on the buffer
in between ?

thanks,
Tomer Goldberg

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

Thanks all,
Regarding the notification there is a "side channel" event that
notifies the user. that is done via an interrupt.
The purpose is a circular queue like described below
only that the user allocates the buffers (about 2M)
not the driver, so I still need the direct IO method.
The thing I wasnt sure about is keepijng the buffers locked
for DMA/user-access, each at a time.

Tomer Goldberg
----- Original Message -----
From: Moreira, Alberto
To: Windows System Software Devs Interest List
Sent: Tuesday, July 27, 2004 5:20 PM
Subject: RE: [ntdev] Reusing IRP buffer for DMA transfer

I don't know if this helps, but when I did 3D graphics for a living we had a chain of common buffers, as large as we could afford (minimum 4Mb, typically way more than that, and we were talking about 64Mb systems) and the driver would append chip commands to the end of the current buffer. We treated it as a kind of circular queue, so, one single I/O would transfer a huge amount of stuff down to the graphics chip, and we'd try to keep that one I/O open for as long as we could. But we did it on the iron, inside the graphics DLL which was not a device driver per se, and we barely if ever used the OS except for setup purposes.

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]On Behalf Of Tomer Goldberg
Sent: Tuesday, July 27, 2004 5:40 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Reusing IRP buffer for DMA transfer

Hi,
Is it possible to use a queue of IRPs
for DMA and when the last IRP is finished go back
to the first one and so on.
That means that these buffers are always locked and the IRPs are not
completed
can the user perform process on the buffer
in between ?

thanks,
Tomer Goldberg

Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: tomerg22@012.net.il
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.

#####################################################################################
This Mail Was Scanned by 012.net Anti Virus Service - Powered by TrendMicro Interscan

We asked the 2D Display Driver Miniport to allocate and map that space for
us, at startup time. This was all done on the kernel side, the user was
unaware of it and reached into us through the OpenGL API, which got into the
kernel side through DrvEscapes.

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Tomer Goldberg
Sent: Tuesday, July 27, 2004 7:06 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Reusing IRP buffer for DMA transfer

Thanks all,
Regarding the notification there is a “side channel” event that
notifies the user. that is done via an interrupt.
The purpose is a circular queue like described below
only that the user allocates the buffers (about 2M)
not the driver, so I still need the direct IO method.
The thing I wasnt sure about is keepijng the buffers locked
for DMA/user-access, each at a time.

Tomer Goldberg

----- Original Message -----
From: Moreira, Alberto mailto:xxxxx
To: Windows System Software Devs Interest mailto:xxxxx List

Sent: Tuesday, July 27, 2004 5:20 PM
Subject: RE: [ntdev] Reusing IRP buffer for DMA transfer

I don’t know if this helps, but when I did 3D graphics for a living we had a
chain of common buffers, as large as we could afford (minimum 4Mb, typically
way more than that, and we were talking about 64Mb systems) and the driver
would append chip commands to the end of the current buffer. We treated it
as a kind of circular queue, so, one single I/O would transfer a huge amount
of stuff down to the graphics chip, and we’d try to keep that one I/O open
for as long as we could. But we did it on the iron, inside the graphics DLL
which was not a device driver per se, and we barely if ever used the OS
except for setup purposes.

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Tomer Goldberg
Sent: Tuesday, July 27, 2004 5:40 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Reusing IRP buffer for DMA transfer

Hi,
Is it possible to use a queue of IRPs
for DMA and when the last IRP is finished go back
to the first one and so on.
That means that these buffers are always locked and the IRPs are not
completed
can the user perform process on the buffer
in between ?

thanks,
Tomer Goldberg

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: tomerg22@012.net.il
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

############################################################################
#########
This Mail Was Scanned by 012.net Anti Virus Service - Powered by TrendMicro
Interscan


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.</mailto:xxxxx></mailto:xxxxx>

Alberto,

You raised some fundamental questions !. And these are decisions an OS maker has to choose. Windows is not an educational OS, and I bet lot of Researcher(s) at top schools are also bitching about it…

There is also that mine is better, or this is the way it should be, and I heard a lot because for quite sometime I was a contract kernel swat engineer, basically I had two mopper ( windbg and softice) and make money out of it… I heard stories almost always that ours is better.

What I learnt from some 8 to ten fairly good size companies ( ie, IBM, Bell Labs, HP, compaq, sun, Boreland, Informix, Oracle … ) are -

  1. Never tell a mother that your son is bad
  2. Dont be a biochemist, since they talk about biology when there is a chemists gathering, and vice versa …

But the fact of the matter is that Windows wins by popular choice votes !. Hell do we have a choice ???

-pro