[ofa-general] Re: why does ibv_device_attr.*_guid are in network order?

Roland Dreier rdreier at cisco.com
Wed Jan 23 20:20:43 PST 2008


 > I noticed that the following attributes in ibv_device_attr are in
 > network order:
 >    node_guid
 >    sys_image_guid
 > 
 > What is the reason for this?

It's hard for me to see any reason to byte-swap them.  GUIDs are
really byte-strings and it seems sensible to keep them into network
order, since you're not likely to do any arithmetic with them.
Another point in favor of network byte order is that GIDs are IPv6
addresses, and so they should be stored in network byte order by the
verbs just as IP addresses are kept in network byte order everywhere
else.  Given that GIDs are in network byte order, I think it would be
very confusing and error-prone if GUIDs were in host byte order.



More information about the general mailing list