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

Dotan Barak dotanb at dev.mellanox.co.il
Wed Jan 23 22:10:20 PST 2008


Roland Dreier wrote:
>  > 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.
>
>   
I wanted to clarify this issue, thanks.

I will add to the man page that those attributes are in network order to 
prevent any confusion in the future ...
(i tried to use them and noticed that they are not in host order in the 
first place ...)

thanks again
Dotan




More information about the general mailing list