[openib-general] Re: ANNOUNCE: First usable version of userspace verbs
Libor Michalek
libor at topspin.com
Thu Feb 24 11:21:32 PST 2005
On Thu, Feb 24, 2005 at 10:40:09AM -0800, Roland Dreier wrote:
> Michael> The pingpong test fails for me, on x86_64. (The
> Michael> executable being a 64 bit one). My kernel is 2.6.10.
>
> OK, I installed x86_64 userspace and got user verbs working. The
> first problem you ran into was because on a 32-bit arch,
>
> struct {
> uint64_t a;
> uint32_t b;
> };
>
> has size 12 but on a 64-bit arch it has size 16. Because of the way I
> tested sizes of parameters passed into the kernel, it was basically
> looking for userspace to pass a size of 12. I fixed this by padding
> all the structs to a multiple of 8 bytes so we don't run into this.
I'm curious, why pad the structure instead of using the packed attribute?
struct {
uint64_t a;
uint32_t b;
} __attribute__ ((packed));
Thanks.
-Libor
More information about the general
mailing list