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

From: Roland Dreier
Date: Wed Jan 12 2005 - 19:38:40 EST


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@xxxxxxxxxxxx>
Signed-off-by: Roland Dreier <roland@xxxxxxxxxxx>

--- 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;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/