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

Fab Tillier ftillier at infiniconsys.com
Wed Oct 6 09:04:49 PDT 2004


> From: Hal Rosenstock [mailto:halr at voltaire.com]
> Sent: Wednesday, October 06, 2004 7:36 AM
> 
> 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.

The TID on the wire is opaque to any recipient.  A response to a MAD should
have exactly the same TID.  The recipient of the response (original client)
will then correctly decode the hi_tid and user_tid since the transaction ID
is received exactly how it was sent.  You only need byte swapping if the
value needs to be interpreted by some other node with unknown endianness.
If the recipient just blindly echoes the value back, the TID is effectively
just a 64-bit data blob that it cares not about - byte ordering doesn't
matter one bit.  The endianness of the TID does not change for the client -
it is sent in host order, and is received in host order.  The only time this
could cause problems is if your client's CPU changes endianness between the
time the request is sent and the response received.  I don't think we should
bother coding for that possibility.

- Fab





More information about the general mailing list