[openib-general] [PATCH][SDP] address for fmr must be page aligned

Libor Michalek libor at topspin.com
Thu May 12 14:15:54 PDT 2005


  The IO address passed ib_fmr_pool_map_phys must be page aligned, here
is a patch to make AIO with unaligned buffers work. By default ttcp.aio.c
aligns buffers on page boundaries, which is why it was not noticed before.

Signed-off-by: Libor Michalek <libor at topspin.com>

Index: sdp_iocb.c
===================================================================
--- sdp_iocb.c	(revision 2326)
+++ sdp_iocb.c	(working copy)
@@ -432,12 +432,12 @@ int sdp_iocb_register(struct sdpc_iocb *
 	/*
 	 * prime io address with physical address of first byte?
 	 */
-	iocb->io_addr = iocb->addr_array[0] + iocb->page_offset;
+	iocb->io_addr = iocb->addr_array[0];
 	/*
 	 * register IOCBs physical memory
 	 */
 	iocb->mem = ib_fmr_pool_map_phys(conn->fmr_pool,
-					 (u64 *)iocb->addr_array,
+					 iocb->addr_array,
 					 iocb->page_count,
 					 &iocb->io_addr);
 	if (IS_ERR(iocb->mem)) {
@@ -458,6 +458,7 @@ int sdp_iocb_register(struct sdpc_iocb *
 	 * some data may have already been consumed, adjust the io address
 	 * to take this into account
 	 */
+	iocb->io_addr += iocb->page_offset;
 	iocb->io_addr += iocb->post;
 	iocb->flags   |= SDP_IOCB_F_REG;
 



More information about the general mailing list