I've been looking at the code and it seems as though Sean is correct.
    The data comes in from userland through a
    if(copy_from_user(&packet->mad,buf,
        sizeof(struct ib_user_mad) + IB_MGMT_RMPP_HDR))

    BTW - why is IB_MGMT_RMPP_HDR an enum? Why not a sizeof ?

    In any case the data element will be aligned in the packet->mad through 
compiler padding. The raw ib_user_mad comming in will not, or may be 
depending on how it was created etc. If it's allocated seperatly or just 
declared then it's not going to work.

    ....JW

----- Original Message ----- 
From: "Michael S. Tsirkin" <[EMAIL PROTECTED]>
To: "Sean Hefty" <[EMAIL PROTECTED]>
Cc: "Ralph Campbell" <[EMAIL PROTECTED]>; "John W. Marland" 
<[EMAIL PROTECTED]>; "openib-general" <[email protected]>
Sent: Thursday, January 18, 2007 12:01 PM
Subject: Re: [openib-general] [PATCH] IB/core - ib_umad can cause address 
alignment fault onia64


>> Quoting r. Sean Hefty <[EMAIL PROTECTED]>:
>> Subject: Re: [openib-general] [PATCH] IB/core - ib_umad can cause address 
>> alignment fault onia64
>>
>> > But I thought it is the data field which is cast to ib_mad_hdr
>> > and not ib_user_mad? If so Jason's suggestion of using
>> > u64 data[0]
>> > makes more sense.
>>
>> I don't think that you can change struct ib_user_mad or struct 
>> ib_user_mad_hdr
>> without breaking the ABI.
>
> This won't break ABI, since data is aligned already relative to start of 
> struct.
> We only force the struct itself to be aligned, which has no ABI 
> implications.
>
> -- 
> MST
>
> _______________________________________________
> openib-general mailing list
> [email protected]
> http://openib.org/mailman/listinfo/openib-general
>
> To unsubscribe, please visit 
> http://openib.org/mailman/listinfo/openib-general
> 


_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to