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

Hal Rosenstock halr at voltaire.com
Wed Oct 6 07:36:09 PDT 2004


On Tue, 2004-10-05 at 16:34, Sean Hefty wrote:
> A response MAD should have exactly the same TID as what was sent.

It does.

> Not sure why we aren't matching against the entire TID.

Because we just want to first find the right MAD agent.

> > 	if (solicited) {
> > 		/* Routing is based on high 32 bits of transaction ID of MAD
> >*/
> >-		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:
> 
> Sender of request (system 1):
> mad.tid = (mad_agent.hi_tid << 32) | user_tid;
> send mad

The problem with this is that when this is done on a little endian
machine it shows up byte swapped on the network and not in network
endian.

So if hi_tid = 1 and user tid = 0x9abcdef0
then the transaction ID in the MAD is 0xf0debc9a01000000

I don't think that is what we want.

> Receiver of response (system 1):
> hi_tid = mad.tid >> 32

> The receiver of the request should just return the same TID that it
> received.

Yes and it does.

> >+union ib_tid {
> >+	u64	id;
> >+	struct {
> >+		u32	hi_tid;
> >+		u32	lo_tid;
> >+	} tid_field;
> >+};
> >+
> 
> I don't see why TID can't be u64 everywhere.  We shouldn't have to make it a
> union.

I did this for convenience. I can remove it once we settle the
endianness issue.

-- Hal




More information about the general mailing list