[openib-general] Re: RMPP Message Format Errors

Hal Rosenstock halr at voltaire.com
Thu Aug 25 19:54:54 PDT 2005


Hi Sean,

In mad.c::ib_create_send_mad, if rmpp is active, the payload length is
calculated as follows:

        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.

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. 

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

-- Hal




More information about the general mailing list