[openib-general] Re: ib_mad.h ib_mad_post_send PCI mapping

Roland Dreier roland at topspin.com
Tue Sep 7 12:44:06 PDT 2004


    Grant> pci_pool_alloc() is NOT a substitute for pci_map/unmap.
    Grant> See drivers/base/dmapool.c: * dma_pool_create - Creates a
    Grant> pool of consistent memory blocks, for dma.

It's not a direct substitute but at a high level, both pci_map and
pci_pool_alloc are a way to get a usable DMA address for a chunk of
kernel memory.

    Grant> The HCA driver can use pci_pool_alloc() to manage data
    Grant> shared with the HCA.  But payload data needs to be
    Grant> mapped/unmapped for each DMA.

Actually that's up to the consumer.  It might be more convenient for a
consumer to use the pci_pool stuff to keep some consistent buffers
around and use them instead of dynamically mapping for every DMA.

    Grant> In April/May I exchanged emails on this topic as well.  The
    Grant> thinking then was the client (eg IPoIB) would handle DMA
    Grant> mapping to be more like a traditional (NIC) driver. I'm
    Grant> still not sure that's the right approach but see no reason
    Grant> why that can't work.

It is working in the sense of both IPoIB and the MAD layer
implementing that approach and working on a large range of Linux
archs.

 - Roland



More information about the general mailing list