[429] in linux-scsi channel archive
Grrr: Grrr: Reading more than buffersize
daemon@ATHENA.MIT.EDU (David S. Miller)
Wed Jul 26 05:52:14 1995
Date: Tue, 25 Jul 1995 18:59:56 -0400
From: "David S. Miller" <davem@caip.rutgers.edu>
To: ralf@mailhost.uni-koblenz.de
CC: submit-linux-dev-scsi@ratatosk.yggdrasil.com
In-reply-to: <3v2n33$j16@info4.rus.uni-stuttgart.de>
(ralf@mailhost.uni-koblenz.de)
From: ralf@mailhost.uni-koblenz.de (Ralf Baechle)
Date: 25 Jul 1995 12:12:19 GMT
|> As an interesting aside, on certain architectures the DMA used with
|> the SCSI subsystem does it's transfers via virtual address, and as
|> such this virt->phys address acquisition would not even be necessary.
|> Sparc has this, the ESP Scsi chip has what is called DVMA where all
|> transfers are virtually addressed. Only problem with this is that
|> once needs to flush the relevant pages on DVMA writes since Sparc uses
|> virtual cache tagged with context keys.
Does that mean that the ESP chip is being fed with the same memory managment
data like the CPU's MMU itself? Or does has it to use own page tables?
There are two methods available. On sun4c machines the CPU MMU
translations are what is visible to ESP's dvma gate array. On the
sun4m's and above you can do the same thing, but an iommu is available
which can keep track of mappings for any 1MB. The idea with this
extra mmu is that you can keep all your scsi/lance/whatever buffers
mapped in this 1MB (virtual) area and never worry about things (ie. no
alias problems with what the CPU sees, but during writes a cache flush
is of course needed... uhh... maybe during reads two have to think
about this one).
Linux/MIPS for Olivetti M700/Mips Magnum 4000/Acer Pica 61 targets already
uses the DMA to virtual address approach. On those boards it is impossible
to use DMA (not even for floppy or similar trivial) with physical addresses
as destinations.
Yes, same here, DMA based upon physical address is impossible. That
is why it is called DVMA ;-) As another aside, my floppy has no DMA
available in any form, so I have to do slow pseudo-dma ;(
The approach of doing scatter/gather DMA to a continous virtual address space
that is translated into possibly throughout the whole core scattered physical
addresses is also about %30 faster compared with the simple approach of just
mapping DMA virtual addresses 1:1 to physical addresses. It even reduces
CPU usage during the scatter/gather-ed SCSI command to zero.
Yes, and this is a technique that Sun imploys, keeping all SCSI
data-in and data-out buffers in this magic IOMMU space. The
performance between straight normal CPU mmu translation and IOMMU is
not really that much of a win though, and adds quite a bit of
complexity in certain situations of the code. I will probably not
even consider using it for quite some time.
(No, I have never seen sun's code, nor will I ever, but I spend a lot
of time tracing through their kernels with kadb to see what is going
on... it gets boring reading assembly code of complex functions, but
you learn a lot)
Later,
David S. Miller
davem@caip.rutgers.edu