* Direct transfer between SCSI and PCI
@ 2009-03-09 12:38 Steve Rottinger
0 siblings, 0 replies; 4+ messages in thread
From: Steve Rottinger @ 2009-03-09 12:38 UTC (permalink / raw)
To: linux-kernel
Hi All,
I am working with version 2.6.23 of the linux kernel on a custom PowerPC
board. As part
of my project, I need to be able to directly transfer data from a large
buffer that resides on
a custom PCI communications device to a SCSI disk without going through
the CPU's main
memory. Initially, it seemed like opening up the raw SCSI device in
O_DIRECT mode would
be the perfect solution. However, through some experimentation, and
reading some posts from
a few years back, it appears that O_DIRECT only works on buffer's that
reside in processor's
main memory. Does anyone have any suggestions as to how to get this to
work? My environment
is pretty well controlled, so I can patch/hack the kernel without any
problem.
Thanks in advance,
-Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
* Direct transfer between SCSI and PCI
@ 2009-03-09 13:29 Steve Rottinger
2009-03-09 23:11 ` Jiri Slaby
0 siblings, 1 reply; 4+ messages in thread
From: Steve Rottinger @ 2009-03-09 13:29 UTC (permalink / raw)
To: linux-kernel
Hi All,
I am working with version 2.6.23 of the linux kernel on a custom PowerPC
board. As part
of my project, I need to be able to directly transfer data from a large
buffer that resides on
a custom PCI communications device to a SCSI disk without going through
the CPU's main
memory. Initially, it seemed like opening up the raw SCSI device in
O_DIRECT mode would
be the perfect solution. However, through some experimentation, and
reading some posts from
a few years back, it appears that O_DIRECT only works on buffer's that
reside in processor's
main memory. Does anyone have any suggestions as to how to get this to
work? My environment
is pretty well controlled, so I can patch/hack the kernel without any
problem.
Thanks in advance,
-Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Direct transfer between SCSI and PCI
2009-03-09 13:29 Direct transfer between SCSI and PCI Steve Rottinger
@ 2009-03-09 23:11 ` Jiri Slaby
2009-03-10 13:11 ` Steve Rottinger
0 siblings, 1 reply; 4+ messages in thread
From: Jiri Slaby @ 2009-03-09 23:11 UTC (permalink / raw)
To: Steve Rottinger; +Cc: linux-kernel
On 9.3.2009 14:29, Steve Rottinger wrote:
>As part
> of my project, I need to be able to directly transfer data from a large
> buffer that resides on
> a custom PCI communications device to a SCSI disk without going through
> the CPU's main
> memory. Initially, it seemed like opening up the raw SCSI device in
> O_DIRECT mode would
> be the perfect solution. However, through some experimentation, and
> reading some posts from
> a few years back, it appears that O_DIRECT only works on buffer's that
> reside in processor's
> main memory. Does anyone have any suggestions as to how to get this to
> work?
How would you want your scsi device to get the data? I suppose they are
stored somewhere on the PCI device memory connected to its local bus or
alike. At best it can be visible as a PCI bar but I doubt it is. As you
described it here, there is no way, how would the SCSI device see the data.
Or do you want to move the data from the PCI device via DMA implemented
in it directly to the SCSI device? How would you do this? I guess SCSI
devices do standard S/G DMA so that they read data from host memory by
themselves.
Maybe if you elaborate on what exactly do you mean by the idea?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Direct transfer between SCSI and PCI
2009-03-09 23:11 ` Jiri Slaby
@ 2009-03-10 13:11 ` Steve Rottinger
0 siblings, 0 replies; 4+ messages in thread
From: Steve Rottinger @ 2009-03-10 13:11 UTC (permalink / raw)
To: Jiri Slaby; +Cc: Steve Rottinger, linux-kernel
The SCSI device would use it's DMA controller to copy the data, just as it
would if the buffer was in the processor's RAM. If I understand
correctly, if I open up the SCSI device using the O_DIRECT option, the
driver will DMA directly to/from the user buffer specified by the
write()/read() functions. Instead, of that buffer being an address
pointing to the processors RAM, I would like that buffer to point to the
PCI address of the buffer on my PCI device. Currently, when I try this on
an mmapped buffer to my PCI device, the write() routine returns a "Bad
address" error.
-Steve
> On 9.3.2009 14:29, Steve Rottinger wrote:
>>As part
>> of my project, I need to be able to directly transfer data from a large
>> buffer that resides on
>> a custom PCI communications device to a SCSI disk without going through
>> the CPU's main
>> memory. Initially, it seemed like opening up the raw SCSI device in
>> O_DIRECT mode would
>> be the perfect solution. However, through some experimentation, and
>> reading some posts from
>> a few years back, it appears that O_DIRECT only works on buffer's that
>> reside in processor's
>> main memory. Does anyone have any suggestions as to how to get this to
>> work?
>
> How would you want your scsi device to get the data? I suppose they are
> stored somewhere on the PCI device memory connected to its local bus or
> alike. At best it can be visible as a PCI bar but I doubt it is. As you
> described it here, there is no way, how would the SCSI device see the
> data.
>
> Or do you want to move the data from the PCI device via DMA implemented
> in it directly to the SCSI device? How would you do this? I guess SCSI
> devices do standard S/G DMA so that they read data from host memory by
> themselves.
>
> Maybe if you elaborate on what exactly do you mean by the idea?
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-03-10 13:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-09 13:29 Direct transfer between SCSI and PCI Steve Rottinger
2009-03-09 23:11 ` Jiri Slaby
2009-03-10 13:11 ` Steve Rottinger
-- strict thread matches above, loose matches on Subject: below --
2009-03-09 12:38 Steve Rottinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox