Hi all,
In my project i am trying to measure performance of a
PCIe Core.
For that, in the driver the 8kb Core RAM is written and
read through DMA.

The data is written from appln to driver continuously
and then DMA is done and the same data is read back in the application.


Could you pls suggest which is best way for interaction
and synchronisation betn appln and driver. Presently I am trying with
shared mem using zwcreatesection and createfilemapping of 8kb.
Can i also use IOCTLs or other routines.
And how do i synchronise as appln should wait writing,
till driver does dma to read and write to the core, and then appln read
should happen, then again write and so on.

Re: Which is the best way for KM-UM interaction by soviet_bloke

soviet_bloke
Mon Sep 11 00:53:14 CDT 2006

Hi mate

You asked the same question just 2 days ago, and we told you what can
be done.
However, now you made 2(!!!) new posts on the same subject. I believe
that the best thing to do in your situation is just to pend and IOCTL
and complete it after operation is done -at this point you can send a
new one. As far as I understand, you driver does not depend on app's
decisions, so that you don't have to worry about synchronization
between driver and application, and you*DEFINITELY* do not need
sections here

Anton Bassov


Chin wrote:
> Hi all,
> In my project i am trying to measure performance of a
> PCIe Core.
> For that, in the driver the 8kb Core RAM is written and
> read through DMA.
>
> The data is written from appln to driver continuously
> and then DMA is done and the same data is read back in the application.
>
>
> Could you pls suggest which is best way for interaction
> and synchronisation betn appln and driver. Presently I am trying with
> shared mem using zwcreatesection and createfilemapping of 8kb.
> Can i also use IOCTLs or other routines.
> And how do i synchronise as appln should wait writing,
> till driver does dma to read and write to the core, and then appln read
> should happen, then again write and so on.


Re: Which is the best way for KM-UM interaction by Calvin

Calvin
Mon Sep 11 03:07:32 CDT 2006

If your goal is to "measure performance of a PCIe Core", my take is that you
are trying to measure the raw DMA performance instead of overall performance
"driver/hw".

If that's what you mean, adding complicated OS and drivers wouldn't give
exactly what you want. You need as less involved s/w component as possible.
Typically, these type of work is done in DOS mode diag program (with
extension so that can access memory above 1M RAM).

If you mean windows driver, the pending IOCTL works.

--
Calvin Guan (DDK MVP)
Sr. Staff Engineer
NetXtreme Vista/Longhorn Server Miniport
Broadcom Corporation
Connecting Everything(r)


"Chin" <chintin@gmail.com> wrote in message
news:1157952117.220802.218070@d34g2000cwd.googlegroups.com...
>
> Hi all,
> In my project i am trying to measure performance of a
> PCIe Core.
> For that, in the driver the 8kb Core RAM is written and
> read through DMA.
>
> The data is written from appln to driver continuously
> and then DMA is done and the same data is read back in the application.
>
>
> Could you pls suggest which is best way for interaction
> and synchronisation betn appln and driver. Presently I am trying with
> shared mem using zwcreatesection and createfilemapping of 8kb.
> Can i also use IOCTLs or other routines.
> And how do i synchronise as appln should wait writing,
> till driver does dma to read and write to the core, and then appln read
> should happen, then again write and so on.
>



RE: Which is the best way for KM-UM interaction by pavel_a

pavel_a
Mon Sep 11 05:19:01 CDT 2006

"Chin" wrote:
>
> Hi all,
> In my project i am trying to measure performance of a
> PCIe Core.
> For that, in the driver the 8kb Core RAM is written and
> read through DMA.
>
> The data is written from appln to driver continuously
> and then DMA is done and the same data is read back in the application.
>
>
> Could you pls suggest which is best way for interaction
> and synchronisation betn appln and driver. Presently I am trying with
> shared mem using zwcreatesection and createfilemapping of 8kb.
> Can i also use IOCTLs or other routines.
> And how do i synchronise as appln should wait writing,
> till driver does dma to read and write to the core, and then appln read
> should happen, then again write and so on.

Perhaps in this case you don't need user mode app at all.
Your goal is testing the bus performance and not app to driver data transfers.
So you could do everything in the driver; use DPCs and work items for time
delays, waiting for i/o completion etc.

--PA


Re: Which is the best way for KM-UM interaction by Chin

Chin
Mon Sep 11 05:34:33 CDT 2006

One more thing, I ve not added, i ve to chart the performance on a GUI
graph,
So i need the application, also could anyone give me an info on
charting libraries eg, line graph: bandwidth vs time

Thanks,
Chin

Pavel A. wrote:
> "Chin" wrote:
> >
> > Hi all,
> > In my project i am trying to measure performance of a
> > PCIe Core.
> > For that, in the driver the 8kb Core RAM is written and
> > read through DMA.
> >
> > The data is written from appln to driver continuously
> > and then DMA is done and the same data is read back in the application.
> >
> >
> > Could you pls suggest which is best way for interaction
> > and synchronisation betn appln and driver. Presently I am trying with
> > shared mem using zwcreatesection and createfilemapping of 8kb.
> > Can i also use IOCTLs or other routines.
> > And how do i synchronise as appln should wait writing,
> > till driver does dma to read and write to the core, and then appln read
> > should happen, then again write and so on.
>
> Perhaps in this case you don't need user mode app at all.
> Your goal is testing the bus performance and not app to driver data transfers.
> So you could do everything in the driver; use DPCs and work items for time
> delays, waiting for i/o completion etc.
>
> --PA


Re: Which is the best way for KM-UM interaction by pavel_a

pavel_a
Mon Sep 11 07:52:01 CDT 2006

"Chin" wrote:
> One more thing, I ve not added, i ve to chart the performance on a GUI
> graph,
> So i need the application, also could anyone give me an info on
> charting libraries eg, line graph: bandwidth vs time

Save your test run data in a text file (again, creating text file is
possible in kernel mode). Then import the file into Excel and display as
chart.

--PA


Re: Which is the best way for KM-UM interaction by Chris

Chris
Mon Sep 11 08:23:31 CDT 2006

If you need to display the results in while the test is running, then just
communicate the results back to the application. Don't use the application
as part of the test. You can get the test results in the same way that
others have suggested pending an IOCTL.

Possibly useful tip: You should be able to call an IOCTL from an Excel macro
(following declares should get you started).

Public Declare Function DeviceIoControl Lib "kernel32" Alias
"DeviceIoControl" (ByVal hDevice As Long, ByVal dwIoControlCode As Long,
lpInBuffer As Any, ByVal nInBufferSize As Long, lpOutBuffer As Any, ByVal
nOutBufferSize As Long, lpBytesReturned As Long, lpOverlapped As OVERLAPPED)
As Long

Public Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal
lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As
Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, ByVal
dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal
hTemplateFile As Long) As Long


...Chris

"Chin" <chintin@gmail.com> wrote in message
news:1157970873.638519.280810@i42g2000cwa.googlegroups.com...
> One more thing, I ve not added, i ve to chart the performance on a GUI
> graph,
> So i need the application, also could anyone give me an info on
> charting libraries eg, line graph: bandwidth vs time
>
> Thanks,
> Chin
>
> Pavel A. wrote:
>> "Chin" wrote:
>> >
>> > Hi all,
>> > In my project i am trying to measure performance of a
>> > PCIe Core.
>> > For that, in the driver the 8kb Core RAM is written and
>> > read through DMA.
>> >
>> > The data is written from appln to driver continuously
>> > and then DMA is done and the same data is read back in the application.
>> >
>> >
>> > Could you pls suggest which is best way for interaction
>> > and synchronisation betn appln and driver. Presently I am trying with
>> > shared mem using zwcreatesection and createfilemapping of 8kb.
>> > Can i also use IOCTLs or other routines.
>> > And how do i synchronise as appln should wait writing,
>> > till driver does dma to read and write to the core, and then appln read
>> > should happen, then again write and so on.
>>
>> Perhaps in this case you don't need user mode app at all.
>> Your goal is testing the bus performance and not app to driver data
>> transfers.
>> So you could do everything in the driver; use DPCs and work items for
>> time
>> delays, waiting for i/o completion etc.
>>
>> --PA
>