Re: [openib-general] Suggestions for how to remove bus_to_virt()
From: Stefan Richter
Date: Sat Jul 15 2006 - 09:43:46 EST
Ralph Campbell wrote:
> On Fri, 2006-07-14 at 15:35 -0700, David Miller wrote:
...
>> The dma_mapping_ops idea will never get accepted by folks like Linus,
>> for reasons I've outlined in previous emails in this thread. So, it's
>> best to look elsewhere for solutions to your problem, such as the
>> ideas used by the USB and IEE1394 device layers.
>
> The USB code won't work in my case because the USB system is
> the one doing the memory allocation and IOMMU setup so it
> can remember the kernel virtual address or physical pages used
> to create the mapping.
Side note: The same is true with the DMA stuff in the ieee1394
subsystem. And the SCSI subsystem doesn't allocate (all) buffers but
leaves DMA mapping and unmapping to the low-level drivers --- i.e. Ralph
can't rip bus_to_virt replacements from there either, because:
> In my case, the infiniband (SRP) code is doing the mapping and
> only passing the dma_addr_t to the device driver at which point
> I have no way to convert it back to a kernel virtual address.
> I need to either change the IB device API to include mapping functions
> or intercept the dma_* functions so I can save the inputs.
On the other hand, ieee1394/dma is the rather obvious example of a
generic layer which keeps book of virtual address and bus address of
mapped memory regions, for above or below layers to use as they need.
Ralph, do you think you can arrange your required API change as a pure
_extension_ of the IB API? I.e. add fields to data structs or add fields
to callback templates or add calls into the SRP layer... (I haven't
bothered to look at the API yet.)
--
Stefan Richter
-=====-=-==- -=== -====
http://arcgraph.de/sr/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/