[openib-general] Re: RMPP Message Format Errors

Sean Hefty sean.hefty at intel.com
Thu Aug 25 22:16:40 PDT 2005


>        if (rmpp_active) {
>		...
>                rmpp_mad->rmpp_hdr.paylen_newwin = cpu_to_be32(hdr_len -
>                        offsetof(struct ib_rmpp_mad, data) + data_len);
>
>Then in mad_rmpp.c::send_next_seg, I see:
>
>        if (mad_send_wr->seg_num == 1) {
>                rmpp_mad->rmpp_hdr.rmpp_rtime_flags |= IB_MGMT_RMPP_FLAG_FIRST;
>                rmpp_mad->rmpp_hdr.paylen_newwin =
>                        cpu_to_be32(mad_send_wr->total_seg *
>                                    (sizeof(struct ib_rmpp_mad) -
>                                       offsetof(struct ib_rmpp_mad, data)));
>That appears to me to overwrite the initial paylen but I might have
>missed something here.

The payload is being overridden, but that's necessary.  The payload that's set
when creating the MAD is used to indicate the size of the buffer.  The payload
set with the 1st segment indicates the size of the transfer.  They differ
because the headers are duplicated in each segment, but only a single copy is
provided in the send buffer.

>In any case, doesn't the initial payload length need to be the number of
>segments times (hdr_len - offsetof(struct ib_rmpp_mad, data)) + data_len
>? If so, that's part of the problem.

I believe that the payload is being calculated correctly.  It should be the
number of segments * 220 bytes per packet, or at least that was my
interpretation of the spec.

>Another alternative would be not to set paylen in the first segment.

That would work.  I tried to set the value to allow future optimization on the
receive side.

- Sean





More information about the general mailing list