[openib-general] Re: vapi versus openib imm_data
Pete Wyckoff
pw at osc.edu
Mon May 22 07:38:01 PDT 2006
jackm at mellanox.co.il wrote on Mon, 22 May 2006 09:30 +0300:
> On Monday 22 May 2006 08:19, Michael S. Tsirkin wrote:
> > Quoting r. Pete Wyckoff <pw at osc.edu>:
> > > is there any good way to tell if the other side has put
> > > its imm_data in network byte order or not?
> >
> > gen2 always assumes imm_data is given in network byte order.
>
> VAPI assumes that imm_data is given (i.e., supplied to the API) in host byte
> order. If the host is a little-endian host (as PCs are), the mlxhh (i.e.,
> inner) layer will convert immediate data to network byte order on the send,
> and will convert received immediate data from Network byte order to host byte
> order on receive -- and the VAPI caller will receive the immediate data in
> host byte order.
Thanks both. I'll solve this by adding htonl/ntohl, only on the
VAPI side, when sending immediate data and reading it back from
the CQ. That should undo the little-endian-only byte swap
introduced by VAPI. Much easier than trying to figure out what
the other side is doing with its immediate data.
-- Pete
More information about the general
mailing list