[ewg] [PATCH] libibverbs - return valid bad_wr from ibv_cmd_post_send()

Ralph Campbell ralph.campbell at qlogic.com
Mon Nov 12 15:15:02 PST 2007


There are error cases in ib_uverbs_post_send() where the return
value is negative (i.e., an error) and yet a non-zero resp.bad_wr
is not written back to ibv_cmd_post_send().  In this case,
ibv_cmd_post_send() should still set the bad_wr pointer.

It seems to me that this should go into OFED 1.3.
I will leave the mechanics of how that happens to Roland and Vlad.

Signed-off-by: Ralph Campbell <ralph.campbell at qlogic.com>

diff --git a/src/cmd.c b/src/cmd.c
index 6d4331f..305e263 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -884,7 +884,8 @@ int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
 		while (--wr_count)
 			i = i->next;
 		*bad_wr = i;
-	}
+	} else if (ret)
+		*bad_wr = wr;
 
 	return ret;
 }





More information about the ewg mailing list