[openib-general] [PATCH][8/18] InfiniBand/core: set byte_cnt correctly in MAD completion

Roland Dreier roland at topspin.com
Wed Jan 12 13:47:51 PST 2005


Integrate Michael Tsirkin's patch to local_completion to set the WC
byte_cnt according to the IBA 1.1 spec (include the GRH size
regardless of whether it is present or not).

Signed-off-by: Hal Rosenstock <halr at voltaire.com>
Signed-off-by: Roland Dreier <roland at topspin.com>

--- linux/drivers/infiniband/core/mad.c	(revision 1458)
+++ linux/drivers/infiniband/core/mad.c	(revision 1459)
@@ -2018,9 +2018,10 @@
 			wc.status = IB_WC_SUCCESS;
 			wc.opcode = IB_WC_RECV;
 			wc.vendor_err = 0;
-			wc.byte_len = sizeof(struct ib_mad);
+			wc.byte_len = sizeof(struct ib_mad) +
+				      sizeof(struct ib_grh);
 			wc.src_qp = IB_QP0;
-			wc.wc_flags = 0;
+			wc.wc_flags = 0;	/* No GRH */
 			wc.pkey_index = 0;
 			wc.slid = IB_LID_PERMISSIVE;
 			wc.sl = 0;




More information about the general mailing list