[openib-general] [PATCH] agent: Fix agent_mad_send PCI mapping and gather address and length
Hal Rosenstock
halr at voltaire.com
Tue Nov 9 12:49:34 PST 2004
agent: Fix agent_mad_send PCI mapping and gather address and length
Index: agent.c
===================================================================
--- agent.c (revision 1183)
+++ agent.c (working copy)
@@ -116,10 +116,10 @@
/* PCI mapping */
gather_list.addr = pci_map_single(mad_agent->device->dma_device,
- &mad->grh,
- sizeof *mad - sizeof mad->header,
+ &mad->mad,
+ sizeof(struct ib_mad),
PCI_DMA_TODEVICE);
- gather_list.length = sizeof *mad - sizeof mad->header;
+ gather_list.length = sizeof(struct ib_mad);
gather_list.lkey = (*port_priv->mr).lkey;
send_wr.next = NULL;
@@ -272,8 +272,7 @@
/* Unmap PCI */
pci_unmap_single(mad_agent->device->dma_device,
pci_unmap_addr(agent_send_wr, mapping),
- sizeof(struct ib_mad_private) -
- sizeof(struct ib_mad_private_header),
+ sizeof(struct ib_mad),
PCI_DMA_TODEVICE);
ib_destroy_ah(agent_send_wr->ah);
More information about the general
mailing list