1. Dec 15, 2022
    • Jason Gunthorpe's avatar
      RDMA/rxe: Fix compile warnings on 32-bit · 5fc24e60
      Jason Gunthorpe authored
      Move the conditional code into a function, with two varients so it is
      harder to make these kinds of mistakes.
      
       drivers/infiniband/sw/rxe/rxe_resp.c: In function 'atomic_write_reply':
       drivers/infiniband/sw/rxe/rxe_resp.c:794:13: error: unused variable 'payload' [-Werror=unused-variable]
         794 |         int payload = payload_size(pkt);
             |             ^~~~~~~
       drivers/infiniband/sw/rxe/rxe_resp.c:793:24: error: unused variable 'mr' [-Werror=unused-variable]
         793 |         struct rxe_mr *mr = qp->resp.mr;
             |                        ^~
       drivers/infiniband/sw/rxe/rxe_resp.c:791:19: error: unused variable 'dst' [-Werror=unused-variable]
         791 |         u64 src, *dst;
             |                   ^~~
       drivers/infiniband/sw/rxe/rxe_resp.c:791:13: error: unused variable 'src' [-Werror=unused-variable]
         791 |         u64 src, *dst;
      
      Fixes: 034e285f ("RDMA/rxe: Make responder support atomic write on RC service")
      Link: https://lore.kernel.org/linux-rdma/Y5s+EVE7eLWQqOwv@nvidia.com/
      
      
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      5fc24e60
  2. Dec 11, 2022
    • Dragos Tatulea's avatar
      IB/IPoIB: Fix queue count inconsistency for PKEY child interfaces · dbc94a0f
      Dragos Tatulea authored
      There are 2 ways to create IPoIB PKEY child interfaces:
      1) Writing a PKEY to /sys/class/net/<ib parent interface>/create_child.
      2) Using netlink with iproute.
      
      While with sysfs the child interface has the same number of tx and
      rx queues as the parent, with netlink there will always be 1 tx
      and 1 rx queue for the child interface. That's because the
      get_num_tx/rx_queues() netlink ops are missing and the default value
      of 1 is taken for the number of queues (in rtnl_create_link()).
      
      This change adds the get_num_tx/rx_queues() ops which allows for
      interfaces with multiple queues to be created over netlink. This
      constant only represents the max number of tx and rx queues on that
      net device.
      
      Fixes: 9baa0b03
      
       ("IB/ipoib: Add rtnl_link_ops support")
      Signed-off-by: default avatarDragos Tatulea <dtatulea@nvidia.com>
      Link: https://lore.kernel.org/r/f4a42c8aa43c02d5ae5559a60c3e5e0f18c82531.1670485816.git.leonro@nvidia.com
      
      
      Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
      dbc94a0f
    • Jason Gunthorpe's avatar
      RDMA: Add missed netdev_put() for the netdevice_tracker · e42f9c2e
      Jason Gunthorpe authored
      The netdev core will detect if any untracked puts are done on tracked
      pointers and throw refcount warnings:
      
        refcount_t: decrement hit 0; leaking memory.
        WARNING: CPU: 1 PID: 33 at lib/refcount.c:31 refcount_warn_saturate+0x1d7/0x1f0 lib/refcount.c:31
        Modules linked in:
        CPU: 1 PID: 33 Comm: kworker/u4:2 Not tainted 6.1.0-rc8-next-20221207-syzkaller #0
        Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
        Workqueue: ib-unreg-wq ib_unregister_work
        RIP: 0010:refcount_warn_saturate+0x1d7/0x1f0 lib/refcount.c:31
        Code: 05 5a 60 51 0a 01 e8 35 0a b5 05 0f 0b e9 d3 fe ff ff e8 6c 9b 75 fd 48 c7 c7 c0 6d a6 8a c6 05 37 60 51 0a 01 e8 16 0a b5 05 <0f> 0b e9 b4 fe
        +ff ff 48 89 ef e8 5a b5 c3 fd e9 5c fe ff ff 0f 1f
        RSP: 0018:ffffc90000aa7b30 EFLAGS: 00010082
        RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
        RDX: ffff8880172f9d40 RSI: ffffffff8166b1dc RDI: fffff52000154f58
        RBP: ffff88807906c600 R08: 0000000000000005 R09: 0000000000000000
        R10: 0000000080000001 R11: 0000000000000000 R12: 1ffff92000154f6b
        R13: 0000000000000000 R14: ffff88807906c600 R15: ffff888046894000
        FS:  0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 00007ffe350a8ff8 CR3: 000000007a9e7000 CR4: 00000000003526e0
        DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
        Call Trace:
         <TASK>
         __refcount_dec include/linux/refcount.h:344 [inline]
         refcount_dec include/linux/refcount.h:359 [inline]
         ref_tracker_free+0x539/0x6b0 lib/ref_tracker.c:118
         netdev_tracker_free include/linux/netdevice.h:4039 [inline]
         netdev_put include/linux/netdevice.h:4056 [inline]
         dev_put include/linux/netdevice.h:4082 [inline]
         free_netdevs+0x1f8/0x470 drivers/infiniband/core/device.c:2204
         __ib_unregister_device+0xa0/0x1a0 drivers/infiniband/core/device.c:1478
         ib_unregister_work+0x19/0x30 drivers/infiniband/core/device.c:1586
         process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289
         worker_thread+0x669/0x1090 kernel/workqueue.c:2436
         kthread+0x2e8/0x3a0 kernel/kthread.c:376
         ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
      
      So change the missed dev_put for pdata->netdev to also follow the tracker.
      
      Fixes: 09f530f0
      
       ("RDMA: Add netdevice_tracker to ib_device_set_netdev()")
      Reported-by: default avatar <syzbot+3fd8326d9a0812d19218@syzkaller.appspotmail.com>
      Reported-by: default avatar <syzbot+a1ed8ffe3121380cd5dd@syzkaller.appspotmail.com>
      Reported-by: default avatar <syzbot+8d0a099c8a6d1e4e601c@syzkaller.appspotmail.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      Link: https://lore.kernel.org/r/0-v1-e99919867b8d+1e2-netdev_tracker2_jgg@nvidia.com
      
      
      Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
      e42f9c2e
  3. Dec 10, 2022
  4. Dec 08, 2022
  5. Dec 07, 2022
  6. Dec 05, 2022
  7. Dec 04, 2022
  8. Dec 03, 2022