[openib-general] RE: [PATCH 1 of 3] mad: large RMPP support
Sean Hefty
sean.hefty at intel.com
Tue Feb 7 17:01:25 PST 2006
Based on what you've done, I'd like to suggest changing interface similar to
that shown below. I believe that this could be done with minor changes to the
current patches. Detailed comments that led to suggesting this change are
inline in my responses.
struct ib_mad_segments {
u32 num_segments;
u32 segment_size;
void *segment[0];
};
struct ib_mad_send_buf {
...
void *mad; /* First MAD segment */
struct ib_mad_segments *segments; /* RMPP segments > 1 */
...
};
This will avoid walking through a list to find segments, and allows for
efficient allocation of the segment data buffers. Multiple segments could be
allocated through a single kzalloc. (For example, every n-th segment would
start a new allocation, making deallocation easy as well.)
>+struct ib_mad_multipacket_seg {
>+ struct list_head list;
>+ u32 size;
>+ u8 data[0];
>+};
Should we ensure that the data alignment is on a 64-byte boundary?
> struct ib_mad_send_buf {
> struct ib_mad_send_buf *next;
>- void *mad;
>+ void *mad; /* RMPP: first segment,
>+ including the MAD header */
>+ void *mad_payload; /* RMPP: changed per segment */
Mad_payload doesn't appear to be directly accessible directly by the user. It
should be hidden.
- Sean
More information about the general
mailing list