1. 03 4月, 2015 4 次提交
  2. 19 2月, 2015 1 次提交
  3. 18 2月, 2015 2 次提交
  4. 06 2月, 2015 1 次提交
  5. 14 1月, 2015 1 次提交
    • A
      infiniband: mlx5: avoid a compile-time warning · 7835bfb5
      Arnd Bergmann 提交于
      The return type of find_first_bit() is architecture specific,
      on ARM it is 'unsigned int', while the asm-generic code used
      on x86 and a lot of other architectures returns 'unsigned long'.
      
      When building the mlx5 driver on ARM, we get a warning about
      this:
      
      infiniband/hw/mlx5/mem.c: In function 'mlx5_ib_cont_pages':
      infiniband/hw/mlx5/mem.c:84:143: warning: comparison of distinct pointer types lacks a cast
           m = min(m, find_first_bit(&tmp, sizeof(tmp)));
      
      This patch changes the driver to use min_t to make it behave
      the same way on all architectures.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NEli Cohen <eli@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7835bfb5
  6. 16 12月, 2014 10 次提交
  7. 09 12月, 2014 2 次提交
  8. 22 11月, 2014 1 次提交
  9. 09 10月, 2014 8 次提交
  10. 04 10月, 2014 1 次提交
  11. 13 8月, 2014 1 次提交
  12. 31 7月, 2014 3 次提交
  13. 17 7月, 2014 1 次提交
  14. 29 5月, 2014 1 次提交
  15. 28 5月, 2014 3 次提交
    • Y
      IB/mlx5: add missing padding at end of struct mlx5_ib_create_srq · 43bc8893
      Yann Droneaud 提交于
      The i386 ABI disagrees with most other ABIs regarding alignment of
      data type larger than 4 bytes: on most ABIs a padding must be added at
      end of the structures, while it is not required on i386.
      
      So for most ABIs struct mlx5_ib_create_srq gets implicitly padded to be
      aligned on a 8 bytes multiple, while for i386, such padding is not
      added.
      
      Tool pahole could be used to find such implicit padding:
      
        $ pahole --anon_include \
                 --nested_anon_include \
                 --recursive \
                 --class_name mlx5_ib_create_srq \
                 drivers/infiniband/hw/mlx5/mlx5_ib.o
      
      Then, structure layout can be compared between i386 and x86_64:
      
        +++ obj-i386/drivers/infiniband/hw/mlx5/mlx5_ib.o.pahole.txt    2014-03-28 11:43:07.386413682 +0100
        --- obj-x86_64/drivers/infiniband/hw/mlx5/mlx5_ib.o.pahole.txt  2014-03-27 13:06:17.788472721 +0100
        @@ -69,7 +68,6 @@ struct mlx5_ib_create_srq {
                __u64                      db_addr;              /*     8     8 */
                __u32                      flags;                /*    16     4 */
      
        -       /* size: 20, cachelines: 1, members: 3 */
        -       /* last cacheline: 20 bytes */
        +       /* size: 24, cachelines: 1, members: 3 */
        +       /* padding: 4 */
        +       /* last cacheline: 24 bytes */
         };
      
      ABI disagreement will make an x86_64 kernel try to read past
      the buffer provided by an i386 binary.
      
      When boundary check will be implemented, the x86_64 kernel will
      refuse to read past the i386 userspace provided buffer and the
      uverb will fail.
      
      Anyway, if the structure lay in memory on a page boundary and
      next page is not mapped, ib_copy_from_udata() will fail and the
      uverb will fail.
      
      This patch makes create_srq_user() takes care of the input
      data size to handle the case where no padding was provided.
      
      This way, x86_64 kernel will be able to handle struct mlx5_ib_create_srq
      as sent by unpatched and patched i386 libmlx5.
      
      Link: http://marc.info/?i=cover.1399309513.git.ydroneaud@opteya.com
      Cc: <stable@vger.kernel.org>
      Fixes: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapter")
      Signed-off-by: NYann Droneaud <ydroneaud@opteya.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      43bc8893
    • Y
      IB/mlx5: add missing padding at end of struct mlx5_ib_create_cq · a8237b32
      Yann Droneaud 提交于
      The i386 ABI disagrees with most other ABIs regarding alignment of
      data type larger than 4 bytes: on most ABIs a padding must be added at
      end of the structures, while it is not required on i386.
      
      So for most ABI struct mlx5_ib_create_cq get padded to be aligned on a
      8 bytes multiple, while for i386, such padding is not added.
      
      The tool pahole can be used to find such implicit padding:
      
        $ pahole --anon_include \
        	 --nested_anon_include \
        	 --recursive \
        	 --class_name mlx5_ib_create_cq \
        	 drivers/infiniband/hw/mlx5/mlx5_ib.o
      
      Then, structure layout can be compared between i386 and x86_64:
      
        +++ obj-i386/drivers/infiniband/hw/mlx5/mlx5_ib.o.pahole.txt    2014-03-28 11:43:07.386413682 +0100
        --- obj-x86_64/drivers/infiniband/hw/mlx5/mlx5_ib.o.pahole.txt  2014-03-27 13:06:17.788472721 +0100
        @@ -34,9 +34,8 @@ struct mlx5_ib_create_cq {
                __u64                      db_addr;              /*     8     8 */
                __u32                      cqe_size;             /*    16     4 */
      
        -       /* size: 20, cachelines: 1, members: 3 */
        -       /* last cacheline: 20 bytes */
        +       /* size: 24, cachelines: 1, members: 3 */
        +       /* padding: 4 */
        +       /* last cacheline: 24 bytes */
         };
      
      This ABI disagreement will make an x86_64 kernel try to read past the
      buffer provided by an i386 binary.
      
      When boundary check will be implemented, a x86_64 kernel will refuse
      to read past the i386 userspace provided buffer and the uverb will
      fail.
      
      Anyway, if the structure lies in memory on a page boundary and next
      page is not mapped, ib_copy_from_udata() will fail when trying to read
      the 4 bytes of padding and the uverb will fail.
      
      This patch makes create_cq_user() takes care of the input data size to
      handle the case where no padding is provided.
      
      This way, x86_64 kernel will be able to handle struct
      mlx5_ib_create_cq as sent by unpatched and patched i386 libmlx5.
      
      Link: http://marc.info/?i=cover.1399309513.git.ydroneaud@opteya.com
      Cc: <stable@vger.kernel.org>
      Fixes: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapter")
      Signed-off-by: NYann Droneaud <ydroneaud@opteya.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      a8237b32
    • S
      IB/mlx5: Refactor UMR to have its own context struct · a74d2416
      Shachar Raindel 提交于
      Instead of having the UMR context part of each memory region, allocate
      a struct on the stack.  This allows queuing multiple UMRs that access
      the same memory region.
      Signed-off-by: NShachar Raindel <raindel@mellanox.com>
      Signed-off-by: NHaggai Eran <haggaie@mellanox.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      a74d2416