[openib-general] [PATCH] [MAD] changes to ib_create_send_mad

Sean Hefty sean.hefty at intel.com
Wed May 4 18:26:45 PDT 2005


>On Wed, 2005-05-04 at 20:05, Sean Hefty wrote:
>> If the class defined data would not divide evenly into
>> + * RMPP segments, then space must be allocated at the end of the referenced
>> + * buffer for any required padding.
>
>This could be the source of the problem with PayloadLength. I need to
>see if the buffer meets the criteria and if not, how to make it do this.
>I will try this in the AM as well as your two related MAD patches.

I calculate the padding in get_buf_length() in mad.c for ib_create_send_mad().
Basically:

seg_size = sizeof(struct ib_mad) - hdr_len;
pad = seg_size - data_len % seg_size;
if (pad == seg_size)
	pad = 0;

I then allocate a buffer sized to hdr_len + data_len + pad.

- Sean




More information about the general mailing list