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

Fab Tillier ftillier at silverstorm.com
Thu Jun 30 14:41:56 PDT 2005


> From: Sean Hefty [mailto:mshefty at ichips.intel.com]
> Sent: Thursday, June 30, 2005 2:32 PM
> 
> Roland Dreier wrote:
> > 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.
> 
> Unless the MAD layer modifies the received MAD, the length may not be set in
> the header.  Setting this doesn't seem like a big deal.  If it is set, then
> I'm guessing that we'd want to set the PayloadLength to the value indicated
> by the spec, but that's not the easiest value to use in order to determine
> the size of the read.
> 
> Given that, I think that it makes more sense to add a length field to the
> ib_user_mad_hdr.

Why not just expect the user to read a MAD until the read returns zero?

I'm thinking something like this:

read( offset = 0, len = 256 )
read( offset 256, len = <value determined by first read?> )

So a read at offset 0 would block waiting for the next MAD, but a read with a
non-zero offset would return EOF if the full MAD was read.

Thoughts?

- Fab




More information about the general mailing list