[openib-general] [PATCH][SDP] AIO buffer corruption

Libor Michalek libor at topspin.com
Fri May 6 16:27:13 PDT 2005


On Fri, May 06, 2005 at 12:41:12PM -0700, Libor Michalek wrote:
> On Fri, May 06, 2005 at 06:28:42PM +0100, Steven Wooding wrote:
> 
> > I'm away for two weeks, so I'll get back to you with any further info 
> > you require when I get back.
> 
>   Here is the patch to fix the problem, the fix exposes another problem,
> where the send pipeline stalls and is not restarted, which I'm working on.
> The problem was caused by copying more data from the iocb then it contained
> sending the size of the iocb to negative.

  Here is a patch to fix the pipeline stall I was seeing. It removes a
check which should not be made. When moving data from the send_queue to
the posted queue, there is no need to check the amount of queued data.

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

Index: sdp_send.c
===================================================================
--- sdp_send.c	(revision 2271)
+++ sdp_send.c	(working copy)
@@ -768,16 +768,13 @@
 {
 	struct sdpc_buff *buff;
 	int result;
-	int copy;
 
 	if (conn->src_sent > 0)
 		return ENOBUFS;
 	/*
 	 * loop through queued buffers and copy them to the destination
 	 */
-	copy = min(sdp_inet_write_space(conn, 0), iocb->len);
-
-	while (copy > 0 &&
+	while (iocb->len > 0 &&
 	       conn->r_recv_bf > 2 &&
 	       conn->send_cq_size > conn->s_wq_size) {
 		/*
@@ -812,8 +809,6 @@
 		}
 
 		conn->send_qud += buff->data_size;
-		copy           -= buff->data_size;
-
 		conn->nond_send++;
 		/*
 		 * transmision time. An update of send_pipe is not needed,



More information about the general mailing list