[openib-general] Nitpicking: IB spec 1.2

Michael S. Tsirkin mst at mellanox.co.il
Mon Jan 3 23:56:14 PST 2005


Hello!
I was looking at IB spec rev 1.2 and I noted a difference with
how gen2 behaves.

11.4.2 COMPLETION QUEUE OPERATIONS
11.4.2.1 POLL FOR COMPLETION

The following appeared in IB spec rev 1.1 first, actually:

The number of bytes transferred.
The number of bytes transferred is returned in Work Completions
for Receive Work Requests for incoming Sends and
RDMA Writes with Immediate Data. This does not include the
length of any immediate data.
The number of bytes transferred is returned in Work Completions
for Send Work Requests for RDMA Read and Atomic Operations.
For the RQ of a UD QP that is not associated with an SRQ or
for an SRQ that is associated with a UD QP, the number of
bytes transferred is the payload of the message plus the 40
bytes reserved for the GRH. For the RQ of a UD QP that is not
associated with an SRQ or for an SRQ that is associated with
a UD QP, the 40 bytes is always included, whether or not the
GRH is present.

However, when local_completions() generates a wc from software,
the byte_len field does not include the grh. Here's a patch.
By the way, does someone know of a way to generate diffs with -p
with svn diff?

thanks,
mst

Index: core/mad.c
===================================================================
--- core/mad.c  (revision 1399)
+++ core/mad.c  (working copy)
@@ -2017,7 +2043,7 @@ static void local_completions(void *data)
                        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(ib_grh);
                        wc.src_qp = IB_QP0;
                        wc.wc_flags = 0;
                        wc.pkey_index = 0;


MST



More information about the general mailing list