[openib-general] [PATCH] ib_mad: Implementib_free_recv_mad routine

Sean Hefty sean.hefty at intel.com
Thu Sep 16 11:26:55 PDT 2004


>> Actually, this change should decrease memory usage -- saves a whole
>> pointer.
>
>Isn't that only for the first buffer ? Don't buffers 2-n have an
>unneeded WC structure ?

I'm suggesting is that instead of the ib_mad_recv_wc pointing to the first
ib_mad_recv_buf structure, it contains it.  Buffers 2-n would still be
referenced by ib_mad_recv_buf structures chained off of the recv_buf in the
ib_mad_recv_wc.  The user would only receive on ib_mad_recv_wc.

>Also, do you see a way to turn a receive buffer handed to the client
>around ? That seems to be useful for the agents in order to respond to a
>request without copying into a send buffer.

As long as the user calls ib_free_recv_mad after the send operation
completes, they should be able to reuse the data buffer from the receive.
We could also give some thought to some sort of ib_reply_to_recv_mad()
routine that could take an ib_mad_recv_wc as input (with the buffer
modified) and generate a send to the source of the receive.  The call could
allocate an address handle, format a send work request, post the send, and
deallocate the address handle once the send completed.  Something like this
could easily enough be added on later though.




More information about the general mailing list