[IB] Fix MAD layer DMA mappings to avoid touching data buffer once mapped
authorSean Hefty <sean.hefty@intel.com>
Tue, 25 Oct 2005 17:51:39 +0000 (10:51 -0700)
committerRoland Dreier <rolandd@cisco.com>
Tue, 25 Oct 2005 17:51:39 +0000 (10:51 -0700)
commit34816ad98efe4d47ffd858a0345321f9d85d9420
tree8a5ed6a9b80e667c4c02d9993711ced06d158555
parentae7971a7706384ca373fb7e212fe195698e6c5a1
[IB] Fix MAD layer DMA mappings to avoid touching data buffer once mapped

The MAD layer was violating the DMA API by touching data buffers used
for sends after the DMA mapping was done.  This causes problems on
non-cache-coherent architectures, because the device doing DMA won't
see updates to the payload buffers that exist only in the CPU cache.

Fix this by having all MAD consumers use ib_create_send_mad() to
allocate their send buffers, and moving the DMA mapping into the MAD
layer so it can be done just before calling send (and after any
modifications of the send buffer by the MAD layer).

Tested on a non-cache-coherent PowerPC 440SPe system.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 files changed:
drivers/infiniband/core/agent.c
drivers/infiniband/core/agent.h
drivers/infiniband/core/agent_priv.h [deleted file]
drivers/infiniband/core/cm.c
drivers/infiniband/core/mad.c
drivers/infiniband/core/mad_priv.h
drivers/infiniband/core/mad_rmpp.c
drivers/infiniband/core/mad_rmpp.h
drivers/infiniband/core/sa_query.c
drivers/infiniband/core/smi.h
drivers/infiniband/core/user_mad.c
drivers/infiniband/hw/mthca/mthca_mad.c
include/rdma/ib_mad.h
include/rdma/ib_verbs.h