[openib-general] [PATCH] ib_mad.c: Fix request/response matching

Sean Hefty mshefty at ichips.intel.com
Tue Oct 5 14:01:06 PDT 2004


On Tue, 05 Oct 2004 16:57:58 -0400
Hal Rosenstock <halr at voltaire.com> wrote:

> > > 		mad_send_wr->tid = ((struct ib_mad_hdr*)
> > >-
> > bus_to_virt(cur_send_wr->sg_list->addr))->tid;
> > >+				   bus_to_virt(cur_send_wr->sg_list->addr))-
> > >>tid.id;
> > 
> > A response MAD should have exactly the same TID as what was sent.  Not sure
> > why we aren't matching against the entire TID.
> 
> It's only done for comparison purposes (taking the TID off the wire in
> network endian and converting to CPU endian);

The sender of the request should be able to set the TID to whatever value it wants.  The responder should just echo that TID.  I don't understand why byte-swapping is needed at all on the TID.
 
> > >-		hi_tid = mad->mad_hdr.tid >> 32;
> > >+		hi_tid = be32_to_cpu(mad->mad_hdr.tid.tid_field.hi_tid);
> > 
> > This shouldn't be necessary:
> 
> The comparison failed when the code was without the conversion.

Why did the comparison fail?  Was the client setting the upper 32-bits of the TID correctly, or was the client swapping the bits when setting it?
 



More information about the general mailing list