Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Resource Manager performance issue for a PCI driver: (3 Items)
   
Resource Manager performance issue for a PCI driver  
Hi, I've written a QNX PCI driver for a board that contains three duplex links so the driver has to service 6 high 
volume data streams concurrently. I implemented the driver using a Resource Manager and everything is great except for 
the performance. Is it sensible to use a Resource Manager for a high data volume PCI driver?
When testing our device with calls to read() of 1000 bytes, performance can be ~75% of max but this drops to 20% of max 
with read() calls of 100 bytes. I am convinced that the Resource Manager is the culprit because I can test the device 
without using the Resource Manager and achieve performance of 99% of maximum with read calls 100-10000 bytes.
Our Resource Manager read() function calls our driver read directly  so the only difference between the two tests is the
 Resource Manager messaging system.

Any help or advice woudl be greatly appreciated.
Re: Resource Manager performance issue for a PCI driver  
Hi,

bottelnecks are multiple copying of data and context switches. Copying 
memory is not very fast with QNX6.

A better approach is to "abuse" the resource manager just to open up the 
PCI interface in order to get access to device memory at user space.
You could request the physical addresses (base registers) when you do an 
initial "open" of the device ... then map the device memory into user space.
So you have direct access to device memory without context switches 
(message passing) and multiple copies of the same data.

An other alternative could be to use shared memory for the exchange of 
data and just to transfer references to that memory areas by very small 
read and write messages.

Best Regards

--Armin

http://www.steinhoff-automation.com


Iain Martin wrote:
> Hi, I've written a QNX PCI driver for a board that contains three duplex links so the driver has to service 6 high 
volume data streams concurrently. I implemented the driver using a Resource Manager and everything is great except for 
the performance. Is it sensible to use a Resource Manager for a high data volume PCI driver?
> When testing our device with calls to read() of 1000 bytes, performance can be ~75% of max but this drops to 20% of 
max with read() calls of 100 bytes. I am convinced that the Resource Manager is the culprit because I can test the 
device without using the Resource Manager and achieve performance of 99% of maximum with read calls 100-10000 bytes.
> Our Resource Manager read() function calls our driver read directly  so the only difference between the two tests is 
the Resource Manager messaging system.
>
> Any help or advice woudl be greatly appreciated.
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post88478
>
>
Re: Resource Manager performance issue for a PCI driver  
Hi, thanks for your quick and helpful reply. The Resource Manager seemed like an attractive wrapper for our PCI driver 
because it enables seperate processes to accesses links independantly and handles mutliple devices. e.g. One process 
could read from a link while another could write independantly.

I liked you idea of "abusing" the Resource Manager. I think that the key would be to have the driver device context (PCI
 register mappings, DMA channel queues, state machine, mutexes etc) in shared memory created in the Resource Manager's 
main(). We use an OpenChannel and CloseChannel idea (implemented using an ioctl()) to give an application exclusive 
access to either read from or write to a data link with data buffered in contiguous driver buffers for dma. Maybe it 
would be possible for the OpenChannel ioctl() to return a pointer to the driver device context from shared memory which 
would enable the application to directly call the driver's read and write functions.

I'll try to implement this.

Many thanks,
Iain