[openib-general] [PATCH] user_mad: Add receive side RMPP support

Roland Dreier rolandd at cisco.com
Thu Jun 30 11:45:51 PDT 2005


Looking at the code, I have to say that I don't like the strategy of
returning the actual length of the MAD but not copying anything if the
MAD is too big.  It seems error prone to return a length bigger than
the user passed in to read(), and it doesn't feel right either.

I understand and agree with the sentiment of not wanting to add
another ioctl() to get the length.  Instead, how about returning a
ib_user_mad_hdr with a status of ENOSPC and putting the actual length
somewhere.  I'm not sure if it's better to change the ABI and add a
length field to ib_user_mad_hdr, or if we want to return the first 36
bytes of an RMPP MAD so the user can figure out the correct length.

Also, since we check if the MAD at the head of the receive queue won't
fit in the user's buffer when we're about to pop it off the queue,
instead of dequeuing and then requeuing it, we can just leave it at
the head of the queue.  (I'm not sure if this buys us anything but it
seems there might be a race MADs get out of order)

Sorry for not bringing this up when you asked about how to handle
too-big MADs a few days ago -- I didn't understand your question
really.

 - R.



More information about the general mailing list