[openib-general] Usage of ib_mad_recv_wc.recv_buf?

Sean Hefty mshefty at ichips.intel.com
Mon Oct 18 09:10:39 PDT 2004


On Sun, 17 Oct 2004 17:59:22 -0700
Roland Dreier <roland at topspin.com> wrote:

> I'm working with the new MAD code, and I'm wondering what the
> intendend usage of ib_mad_recv_wc.recv_buf is, specifically in the
> RMPP case.  I see that struct ib_mad_recv_buf has a struct list_head
> member, but struct ib_mad_recv_wc just has a struct ib_mad_recv_buf *
> member.  I assume that the idea is for multiple MAD packets to be
> passed as a linked list, so it would seem that struct ib_mad_recv_wc
> should just have a struct list_head where the MAD buffers are linked.
> Am I missing something or does this need to be changed?

Your assumption is correct.  For RMPP, the idea is to pass back a linked list of received segments (duplicated MAD headers and all), in order to avoid data copies.

I think that the current API is a result of changes to ib_mad_recv_buf.  At one point I think that it had a *recv_buf field, which was changed to list_head, but ib_mad_recv_wc was left alone.

I'm not sure that we gain any advantage to using a doubly-linked list over a singly-linked one, so I would be fine with converting it back to *recv_buf.  If we do decide to keep list_head, then list_head should be added into ib_mad_recv_wc as you suggest.

- Sean



More information about the general mailing list