15 Jul, 2008

1 commit


10 Oct, 2007

2 commits

  • The declaration of struct ib_user_mad_reg_req.method_mask[] exported
    to userspace was an array of __u32, but the kernel internally treated
    it as a bitmap made up of longs. This makes a difference for 64-bit
    big-endian kernels, where numbering the bits in an array of__u32 gives:

    |31.....0|63....31|95....64|127...96|

    while numbering the bits in an array of longs gives:

    |63..............0|127............64|

    64-bit userspace can handle this by just treating method_mask[] as an
    array of longs, but 32-bit userspace is really stuck: the meaning of
    the bits in method_mask[] depends on whether the kernel is 32-bit or
    64-bit, and there's no sane way for userspace to know that.

    Fix this by updating to make it clear that
    method_mask[] is an array of longs, and using a compat_ioctl method to
    convert to an array of 64-bit longs to handle the 32-on-64 problem.
    This fixes the interface description to match existing behavior (so
    working binaries continue to work) in almost all situations, and gives
    consistent semantics in the case of 32-bit userspace that can run on
    either a 32-bit or 64-bit kernel, so that the same binary can work for
    both 32-on-32 and 32-on-64 systems.

    Signed-off-by: Roland Dreier

    Roland Dreier
     
  • Add support for setting the P_Key index of sent MADs and getting the
    P_Key index of received MADs. This requires a change to the layout of
    the ABI structure struct ib_user_mad_hdr, so to avoid breaking
    compatibility, we default to the old (unchanged) ABI and add a new
    ioctl IB_USER_MAD_ENABLE_PKEY that allows applications that are aware
    of the new ABI to opt into using it.

    We plan on switching to the new ABI by default in a year or so, and
    this patch adds a warning that is printed when an application uses the
    old ABI, to push people towards converting to the new ABI.

    Signed-off-by: Roland Dreier
    Reviewed-by: Sean Hefty
    Reviewed-by: Hal Rosenstock

    Roland Dreier
     

05 Feb, 2007

1 commit

  • Make the untyped data region in ib_user_mad have type u64 so that it
    gets aligned properly. This avoids alignment faults in ib_umad when
    casting the data field to an rmpp_mad and accessing the 64-bit tid
    field on architectures like ia64.

    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Roland Dreier

    Jason Gunthorpe
     

27 Aug, 2005

1 commit