Roland Dreier wrote:
My rule of thumb is that we shouldn't rely on being able to allocate a
contiguous buffer bigger than 4 KB, but assuming we can allocate 4 KB
is fine.  4 KB is the lowest page size of any real architecture, and
if the kernel is out of free pages then any allocation is likely to
fail.  Allocations of larger buffers may fail because of memory
fragmentation, even with plenty of free memory.

That is: a 4 KB buffer is fine.

Given this, I think that we'll need to go with the linked list then. Maybe something like:

struct ib_mad_segment {
        struct list_head list;
        u8 data[0];
};

struct ib_mad_send_buf {
        ...
        void            *mad;   /* first segment */
        struct list_head rmpp_list;
        u32              segment_size;
        ...
};

I'm undecided about whether all MADs should use the rmpp_list, with *mad referencing the data of the first segment. This keeps the code consistent, but would result in the first segment being larger (256-bytes) than additional segments (say 220-bytes).

Users could then walk the list of buffers without calling a routine that needs to start at the beginning of the list every time.

- Sean
_______________________________________________
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to