20 Jan, 2021

4 commits

  • commit 2cb091f6293df898b47f4e0f2e54324e2bbaf816 upstream.

    When set_has_smi_cap() fails, multiport master cleanup is missed. Fix it
    by doing the correct error unwinding goto.

    Fixes: a989ea01cb10 ("RDMA/mlx5: Move SMI caps logic")
    Link: https://lore.kernel.org/r/20210113121703.559778-3-leon@kernel.org
    Signed-off-by: Parav Pandit
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Greg Kroah-Hartman

    Parav Pandit
     
  • commit 1c3aa6bd0b823105c2030af85d92d158e815d669 upstream.

    If the allocation of the fast path blue flame register fails, the driver
    should free the regular blue flame register allocated a statement above,
    not the one that it just failed to allocate.

    Fixes: 16c1975f1032 ("IB/mlx5: Create profile infrastructure to add and remove stages")
    Link: https://lore.kernel.org/r/20210113121703.559778-6-leon@kernel.org
    Reported-by: Hans Petter Selasky
    Signed-off-by: Mark Bloch
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Greg Kroah-Hartman

    Mark Bloch
     
  • commit a306aba9c8d869b1fdfc8ad9237f1ed718ea55e6 upstream.

    If usnic_ib_qp_grp_create() fails at the first call, dev_list
    will not be freed on error, which leads to memleak.

    Fixes: e3cf00d0a87f ("IB/usnic: Add Cisco VIC low-level hardware driver")
    Link: https://lore.kernel.org/r/20201226074248.2893-1-dinghao.liu@zju.edu.cn
    Signed-off-by: Dinghao Liu
    Reviewed-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Greg Kroah-Hartman

    Dinghao Liu
     
  • commit f2bc3af6353cb2a33dfa9d270d999d839eef54cb upstream.

    In ocrdma_dealloc_ucontext_pd() uctx->cntxt_pd is assigned to the variable
    pd and then after uctx->cntxt_pd is freed, the variable pd is passed to
    function _ocrdma_dealloc_pd() which dereferences pd directly or through
    its call to ocrdma_mbx_dealloc_pd().

    Reorder the free using the variable pd.

    Cc: stable@vger.kernel.org
    Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core")
    Link: https://lore.kernel.org/r/20201230024653.1516495-1-trix@redhat.com
    Signed-off-by: Tom Rix
    Reviewed-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Greg Kroah-Hartman

    Tom Rix
     

17 Jan, 2021

1 commit

  • [ Upstream commit 94a8c4dfcdb2b4fcb3dfafc39c1033a0b4637c86 ]

    Only the low 12 bits of vlan_id is valid, and service level has been
    filled in Address Vector. So there is no need to fill sl in vlan_id in
    Address Vector.

    Fixes: 7406c0036f85 ("RDMA/hns: Only record vlan info for HIP08")
    Link: https://lore.kernel.org/r/1607650657-35992-5-git-send-email-liweihang@huawei.com
    Signed-off-by: Weihang Li
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Weihang Li
     

30 Dec, 2020

14 commits

  • [ Upstream commit e89938902927a54abebccc9537991aca5237dfaf ]

    If the MR cache entry invalidation failed, then we detach this entry from
    the cache, therefore we must to free the memory as well.

    Allcation backtrace for the leaker:

    [] alloc_cache_mr+0x23/0xc0 [mlx5_ib]
    [] create_cache_mr+0x3f/0xf0 [mlx5_ib]
    [] mlx5_ib_alloc_implicit_mr+0x41/0×210 [mlx5_ib]
    [] mlx5_ib_reg_user_mr+0x9e/0×6e0 [mlx5_ib]
    [] create_qp+0x2fc/0xf00 [ib_uverbs]
    [] ib_uverbs_handler_UVERBS_METHOD_COUNTERS_READ+0x1d9/0×230 [ib_uverbs]
    [] rdma_alloc_commit_uobject+0xb5/0×120 [ib_uverbs]
    [] uverbs_alloc+0x2b/0xf0 [ib_uverbs]
    [] ksysioctl+0x234/0×7d0
    [] __x64_sys_ioctl+0x16/0×20
    [] do_syscall_64+0x59/0×2e0

    Fixes: 1769c4c57548 ("RDMA/mlx5: Always remove MRs from the cache before destroying them")
    Link: https://lore.kernel.org/r/20201213132940.345554-2-leon@kernel.org
    Signed-off-by: Maor Gottlieb
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Maor Gottlieb
     
  • [ Upstream commit 603bee935f38080a3674c763c50787751e387779 ]

    The high 6 bits of traffic class in GRH is DSCP (Differentiated Services
    Codepoint), the driver should shift it before the hardware gets it when
    using RoCEv2.

    Fixes: 606bf89e98ef ("RDMA/hns: Refactor for hns_roce_v2_modify_qp function")
    Fixes: fba429fcf9a5 ("RDMA/hns: Fix missing fields in address vector")
    Link: https://lore.kernel.org/r/1607650657-35992-4-git-send-email-liweihang@huawei.com
    Signed-off-by: Weihang Li
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Weihang Li
     
  • [ Upstream commit 4ddeacf68a3dd05f346b63f4507e1032a15cc3cc ]

    Whether to enable the these features should better depend on the enable
    flags, not the value of related fields.

    Fixes: 5c1f167af112 ("RDMA/hns: Init SRQ table for hip08")
    Fixes: 3cb2c996c9dc ("RDMA/hns: Add support for SCCC in size of 64 Bytes")
    Link: https://lore.kernel.org/r/1607650657-35992-3-git-send-email-liweihang@huawei.com
    Signed-off-by: Wenpeng Liang
    Signed-off-by: Weihang Li
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Wenpeng Liang
     
  • [ Upstream commit 1c0ca9cd1741687f529498ddb899805fc2c51caa ]

    For ib_copy_from_user(), the length of udata may not be the same as that
    of cmd. For ib_copy_to_user(), the length of udata may not be the same as
    that of resp. So limit the length to prevent out-of-bounds read and write
    operations from ib_copy_from_user() and ib_copy_to_user().

    Fixes: de77503a5940 ("RDMA/hns: RDMA/hns: Assign rq head pointer when enable rq record db")
    Fixes: 633fb4d9fdaa ("RDMA/hns: Use structs to describe the uABI instead of opencoding")
    Fixes: ae85bf92effc ("RDMA/hns: Optimize qp param setup flow")
    Fixes: 6fd610c5733d ("RDMA/hns: Support 0 hop addressing for SRQ buffer")
    Fixes: 9d9d4ff78884 ("RDMA/hns: Update the kernel header file of hns")
    Link: https://lore.kernel.org/r/1607650657-35992-2-git-send-email-liweihang@huawei.com
    Signed-off-by: Wenpeng Liang
    Signed-off-by: Weihang Li
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Wenpeng Liang
     
  • [ Upstream commit d34895c319faa1e0fc1a48c3b06bba6a8a39ba44 ]

    Page alignment is required when setting the number of extended sge
    according to the hardware's achivement. If the space of needed extended
    sge is greater than one page, the roundup_pow_of_two() can ensure
    that. But if the needed extended sge isn't 0 and can not be filled in a
    whole page, the driver should align it specifically.

    Fixes: 54d6638765b0 ("RDMA/hns: Optimize WQE buffer size calculating process")
    Link: https://lore.kernel.org/r/1606558959-48510-3-git-send-email-liweihang@huawei.com
    Signed-off-by: Yangyang Li
    Signed-off-by: Weihang Li
    Reviewed-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Yangyang Li
     
  • [ Upstream commit 0fd0175e30e487f8d70ecb2cdd67fbb514fdf50f ]

    One RC SQ WQE can store 2 sges but UD can't, so ignore 2 valid sges of
    wr.sglist for RC which have been filled in WQE before setting extended
    sge. Either of RC and UD can not contain 0-length sges, so these 0-length
    sges should be skipped.

    Fixes: 54d6638765b0 ("RDMA/hns: Optimize WQE buffer size calculating process")
    Link: https://lore.kernel.org/r/1606558959-48510-2-git-send-email-liweihang@huawei.com
    Signed-off-by: Lang Cheng
    Signed-off-by: Weihang Li
    Reviewed-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Lang Cheng
     
  • [ Upstream commit 3631dadfb118821236098a215e59fb5d3e1c30a8 ]

    The loopback flag will be set to 1 by the hardware when the source mac
    address is same as the destination mac address. So the driver don't need
    to compare them.

    Fixes: d6a3627e311c ("RDMA/hns: Optimize wqe buffer set flow for post send")
    Link: https://lore.kernel.org/r/1605526408-6936-4-git-send-email-liweihang@huawei.com
    Signed-off-by: Weihang Li
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Weihang Li
     
  • [ Upstream commit fba429fcf9a5e0c4ec2523ecf4cf18bc0507fcbc ]

    Traffic class and hop limit in address vector is not assigned from GRH,
    but it will be filled into UD SQ WQE. So the hardware will get a wrong
    value.

    Fixes: 82e620d9c3a0 ("RDMA/hns: Modify the data structure of hns_roce_av")
    Link: https://lore.kernel.org/r/1605526408-6936-3-git-send-email-liweihang@huawei.com
    Signed-off-by: Weihang Li
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Weihang Li
     
  • [ Upstream commit 7406c0036f851ee1cd93cb08349f24b051b4cbf8 ]

    Information about vlan is stored in GMV(GID/MAC/VLAN) table for HIP09, so
    there is no need to copy it to address vector.

    Link: https://lore.kernel.org/r/1605526408-6936-2-git-send-email-liweihang@huawei.com
    Signed-off-by: Weihang Li
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Weihang Li
     
  • [ Upstream commit 6d8285e604e0221b67bd5db736921b7ddce37d00 ]

    Before create CQ, make sure that the requested number of CQEs is in the
    supported range.

    Fixes: cfdda9d76436 ("RDMA/cxgb4: Add driver for Chelsio T4 RNIC")
    Link: https://lore.kernel.org/r/20201108132007.67537-1-kamalheib1@gmail.com
    Signed-off-by: Kamal Heib
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Kamal Heib
     
  • [ Upstream commit fbb7dc5db6dee553b5a07c27e86364a5223e244c ]

    gcc points out a suspicious mixing of enum types in a function that
    converts from MTHCA_OPCODE_* values to IB_WC_* values:

    drivers/infiniband/hw/mthca/mthca_cq.c: In function 'mthca_poll_one':
    drivers/infiniband/hw/mthca/mthca_cq.c:607:21: warning: implicit conversion from 'enum ' to 'enum ib_wc_opcode' [-Wenum-conversion]
    607 | entry->opcode = MTHCA_OPCODE_INVALID;

    Nothing seems to ever check for MTHCA_OPCODE_INVALID again, no idea if
    this is meaningful, but it seems harmless as it deals with an invalid
    input.

    Remove MTHCA_OPCODE_INVALID and set the ib_wc_opcode to 0xFF, which is
    still bogus, but at least doesn't make compiler warnings.

    Fixes: 2a4443a69934 ("[PATCH] IB/mthca: fill in opcode field for send completions")
    Link: https://lore.kernel.org/r/20201026211311.3887003-1-arnd@kernel.org
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Arnd Bergmann
     
  • [ Upstream commit fc3325701a6353594083f08e297d4c1965c601aa ]

    reg_pages should always contain mr->npage since when the mr is finally
    de-reg'd it is always subtracted out.

    If there were any error exits then mlx5_ib_rereg_user_mr() would leave the
    reg_pages adjusted and this will cause it to be double subtracted
    eventually.

    The manipulation of reg_pages is inherently connected to the umem, so lift
    it out of set_mr_fields() and only adjust it around creating/destroying a
    umem.

    reg_pages is only used for diagnostics in sysfs.

    Fixes: 7d0cc6edcc70 ("IB/mlx5: Add MR cache for large UMR regions")
    Link: https://lore.kernel.org/r/20201026131936.1335664-3-leon@kernel.org
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Jason Gunthorpe
     
  • [ Upstream commit b898d5c50cab1f985e77d053eb5c4d2c4a7694ae ]

    Only static WQE is supported for SRQ. So always use the max supported SGEs
    while calculating SRQ entry size.

    Fixes: 2bb3c32c5c5f ("RDMA/bnxt_re: Change wr posting logic to accommodate variable wqes")
    Link: https://lore.kernel.org/r/1602569752-12745-1-git-send-email-selvin.xavier@broadcom.com
    Signed-off-by: Devesh Sharma
    Signed-off-by: Selvin Xavier
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Selvin Xavier
     
  • [ Upstream commit 53839b51a7671eeb3fb44d479d541cf3a0f2dd45 ]

    The API for ib_query_qp requires the driver to set cur_qp_state on return,
    add the missing set.

    Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
    Link: https://lore.kernel.org/r/20201021114952.38876-1-kamalheib1@gmail.com
    Signed-off-by: Kamal Heib
    Acked-by: Selvin Xavier
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin

    Kamal Heib
     

02 Dec, 2020

2 commits

  • The local variables cur_state and new_state hold the state that should be
    used for the modify QP operation instead of the ones in the ib_qp_attr
    struct.

    Fixes: 40909f664d27 ("RDMA/efa: Add EFA verbs implementation")
    Link: https://lore.kernel.org/r/20201201091724.37016-1-galpress@amazon.com
    Reviewed-by: Firas JahJah
    Reviewed-by: Yossi Leybovich
    Signed-off-by: Gal Pressman
    Signed-off-by: Jason Gunthorpe

    Gal Pressman
     
  • This patch fixes issue introduced by a previous commit where iWARP
    doorbell address wasn't initialized, causing call trace when any RDMA
    application wants to use this interface:

    Illegal doorbell address: 0000000000000000. Legal range for doorbell addresses is [0000000011431e08..00000000ec3799d3]
    WARNING: CPU: 11 PID: 11990 at drivers/net/ethernet/qlogic/qed/qed_dev.c:93 qed_db_rec_sanity.isra.12+0x48/0x70 [qed]
    ...
    hpsa scsi_transport_sas [last unloaded: crc8]
    CPU: 11 PID: 11990 Comm: rping Tainted: G S 5.10.0-rc1 #29
    Hardware name: HP ProLiant DL380 Gen9/ProLiant DL380 Gen9, BIOS P89 01/22/2018
    RIP: 0010:qed_db_rec_sanity.isra.12+0x48/0x70 [qed]
    ...
    RSP: 0018:ffffafc28458fa88 EFLAGS: 00010286
    RAX: 0000000000000000 RBX: ffff8d0d4c620000 RCX: 0000000000000000
    RDX: ffff8d10afde7d50 RSI: ffff8d10afdd8b40 RDI: ffff8d10afdd8b40
    RBP: ffffafc28458fe38 R08: 0000000000000003 R09: 0000000000007fff
    R10: 0000000000000001 R11: ffffafc28458f888 R12: 0000000000000000
    R13: 0000000000000000 R14: ffff8d0d43ccbbd0 R15: ffff8d0d48dae9c0
    FS: 00007fbd5267e740(0000) GS:ffff8d10afdc0000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007fbd4f258fb8 CR3: 0000000108d96003 CR4: 00000000001706e0
    Call Trace:
    qed_db_recovery_add+0x6d/0x1f0 [qed]
    qedr_create_user_qp+0x57e/0xd30 [qedr]
    qedr_create_qp+0x5f3/0xab0 [qedr]
    ? lookup_get_idr_uobject.part.12+0x45/0x90 [ib_uverbs]
    create_qp+0x45d/0xb30 [ib_uverbs]
    ? ib_uverbs_cq_event_handler+0x30/0x30 [ib_uverbs]
    ib_uverbs_create_qp+0xb9/0xe0 [ib_uverbs]
    ib_uverbs_write+0x3f9/0x570 [ib_uverbs]
    ? security_mmap_file+0x62/0xe0
    vfs_write+0xb7/0x200
    ksys_write+0xaf/0xd0
    ? syscall_trace_enter.isra.25+0x152/0x200
    do_syscall_64+0x2d/0x40
    entry_SYSCALL_64_after_hwframe+0x44/0xa9

    Fixes: 06e8d1df46ed ("RDMA/qedr: Add support for user mode XRC-SRQ's")
    Link: https://lore.kernel.org/r/20201127163251.14533-1-palok@marvell.com
    Signed-off-by: Michal Kalderon
    Signed-off-by: Igor Russkikh
    Signed-off-by: Alok Prasad
    Signed-off-by: Jason Gunthorpe

    Alok Prasad
     

26 Nov, 2020

4 commits

  • When a memory window is bound to a memory region, the local write access
    should be set for its mtpt table.

    Fixes: c7c28191408b ("RDMA/hns: Add MW support for hip08")
    Link: https://lore.kernel.org/r/1606386372-21094-1-git-send-email-liweihang@huawei.com
    Signed-off-by: Yixian Liu
    Signed-off-by: Weihang Li
    Signed-off-by: Jason Gunthorpe

    Yixian Liu
     
  • The maximum number of retransmission should be returned when querying QP,
    not the value of retransmission counter.

    Fixes: 99fcf82521d9 ("RDMA/hns: Fix the wrong value of rnr_retry when querying qp")
    Fixes: 926a01dc000d ("RDMA/hns: Add QP operations support for hip08 SoC")
    Link: https://lore.kernel.org/r/1606382977-21431-1-git-send-email-liweihang@huawei.com
    Signed-off-by: Wenpeng Liang
    Signed-off-by: Weihang Li
    Signed-off-by: Jason Gunthorpe

    Wenpeng Liang
     
  • The SRQ capacity is got from the firmware, whose field should be ended at
    bit 19.

    Fixes: ba6bb7e97421 ("RDMA/hns: Add interfaces to get pf capabilities from firmware")
    Link: https://lore.kernel.org/r/1606382812-23636-1-git-send-email-liweihang@huawei.com
    Signed-off-by: Wenpeng Liang
    Signed-off-by: Weihang Li
    Signed-off-by: Jason Gunthorpe

    Wenpeng Liang
     
  • Two earlier bug fixes have created a security problem in the hfi1
    driver. One fix aimed to solve an issue where current->mm was not valid
    when closing the hfi1 cdev. It attempted to do this by saving a cached
    value of the current->mm pointer at file open time. This is a problem if
    another process with access to the FD calls in via write() or ioctl() to
    pin pages via the hfi driver. The other fix tried to solve a use after
    free by taking a reference on the mm.

    To fix this correctly we use the existing cached value of the mm in the
    mmu notifier. Now we can check in the insert, evict, etc. routines that
    current->mm matched what the notifier was registered for. If not, then
    don't allow access. The register of the mmu notifier will save the mm
    pointer.

    Since in do_exit() the exit_mm() is called before exit_files(), which
    would call our close routine a reference is needed on the mm. We rely on
    the mmgrab done by the registration of the notifier, whereas before it was
    explicit. The mmu notifier deregistration happens when the user context is
    torn down, the creation of which triggered the registration.

    Also of note is we do not do any explicit work to protect the interval
    tree notifier. It doesn't seem that this is going to be needed since we
    aren't actually doing anything with current->mm. The interval tree
    notifier stuff still has a FIXME noted from a previous commit that will be
    addressed in a follow on patch.

    Cc:
    Fixes: e0cf75deab81 ("IB/hfi1: Fix mm_struct use after free")
    Fixes: 3faa3d9a308e ("IB/hfi1: Make use of mm consistent")
    Link: https://lore.kernel.org/r/20201125210112.104301.51331.stgit@awfm-01.aw.intel.com
    Suggested-by: Jann Horn
    Reported-by: Jason Gunthorpe
    Reviewed-by: Ira Weiny
    Reviewed-by: Mike Marciniszyn
    Signed-off-by: Dennis Dalessandro
    Signed-off-by: Jason Gunthorpe

    Dennis Dalessandro
     

25 Nov, 2020

1 commit

  • i40iw_mmap manipulates the vma->vm_pgoff to differentiate a push page mmap
    vs a doorbell mmap, and uses it to compute the pfn in remap_pfn_range
    without any validation. This is vulnerable to an mmap exploit as described
    in: https://lore.kernel.org/r/20201119093523.7588-1-zhudi21@huawei.com

    The push feature is disabled in the driver currently and therefore no push
    mmaps are issued from user-space. The feature does not work as expected in
    the x722 product.

    Remove the push module parameter and all VMA attribute manipulations for
    this feature in i40iw_mmap. Update i40iw_mmap to only allow DB user
    mmapings at offset = 0. Check vm_pgoff for zero and if the mmaps are bound
    to a single page.

    Cc:
    Fixes: d37498417947 ("i40iw: add files for iwarp interface")
    Link: https://lore.kernel.org/r/20201125005616.1800-2-shiraz.saleem@intel.com
    Reported-by: Di Zhu
    Signed-off-by: Shiraz Saleem
    Signed-off-by: Jason Gunthorpe

    Shiraz Saleem
     

24 Nov, 2020

1 commit

  • We return 'err' in the error branch, but this variable may be set as zero
    by the above code. Fix it by setting 'err' as a negative value before we
    goto the error label.

    Fixes: 74c2174e7be5 ("IB uverbs: add mthca user CQ support")
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Link: https://lore.kernel.org/r/1605837422-42724-1-git-send-email-wangxiongfeng2@huawei.com
    Reported-by: Hulk Robot
    Signed-off-by: Xiongfeng Wang
    Signed-off-by: Jason Gunthorpe

    Xiongfeng Wang
     

14 Nov, 2020

1 commit

  • Fix to return a negative error code from the error handling case instead
    of 0, as done elsewhere in this function.

    Fixes: 4730f4a6c6b2 ("IB/hfi1: Activate the dummy netdev")
    Link: https://lore.kernel.org/r/1605249747-17942-1-git-send-email-zhangchangzhong@huawei.com
    Reported-by: Hulk Robot
    Signed-off-by: Zhang Changzhong
    Acked-by: Mike Marciniszyn
    Signed-off-by: Jason Gunthorpe

    Zhang Changzhong
     

13 Nov, 2020

1 commit

  • Fix missing kfree in pvrdma_register_device() when failure from
    ib_device_set_netdev().

    Fixes: 4b38da75e089 ("RDMA/drivers: Convert easy drivers to use ib_device_set_netdev()")
    Link: https://lore.kernel.org/r/20201111032202.17925-1-miaoqinglang@huawei.com
    Reported-by: Hulk Robot
    Signed-off-by: Qinglang Miao
    Signed-off-by: Jason Gunthorpe

    Qinglang Miao
     

03 Nov, 2020

1 commit

  • The pvrdma_port_attr structure is ABI toward the hypervisor, changing it
    breaks the ability to report the speed properly. Revert the change to u16.

    Fixes: 376ceb31ff87 ("RDMA: Fix link active_speed size")
    Link: https://lore.kernel.org/r/20201102225437.26557-1-aditr@vmware.com
    Reviewed-by: Vishnu Dasa
    Signed-off-by: Adit Ranadive
    Signed-off-by: Jason Gunthorpe

    Adit Ranadive
     

28 Oct, 2020

1 commit

  • Fixes memory leak in iWARP CM

    Fixes: e411e0587e0d ("RDMA/qedr: Add iWARP connection management functions")
    Link: https://lore.kernel.org/r/20201021115008.28138-1-palok@marvell.com
    Signed-off-by: Michal Kalderon
    Signed-off-by: Igor Russkikh
    Signed-off-by: Alok Prasad
    Signed-off-by: Jason Gunthorpe

    Alok Prasad
     

27 Oct, 2020

1 commit

  • When a mlx5 core devlink instance is reloaded in different net namespace,
    its associated IB device is deleted and recreated.

    Example sequence is:
    $ ip netns add foo
    $ devlink dev reload pci/0000:00:08.0 netns foo
    $ ip netns del foo

    mlx5 IB device needs to attach and detach the netdevice to it through the
    netdev notifier chain during load and unload sequence. A below call graph
    of the unload flow.

    cleanup_net()
    down_read(&pernet_ops_rwsem);
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe

    Parav Pandit
     

18 Oct, 2020

1 commit

  • Pull rdma updates from Jason Gunthorpe:
    "A usual cycle for RDMA with a typical mix of driver and core subsystem
    updates:

    - Driver minor changes and bug fixes for mlx5, efa, rxe, vmw_pvrdma,
    hns, usnic, qib, qedr, cxgb4, hns, bnxt_re

    - Various rtrs fixes and updates

    - Bug fix for mlx4 CM emulation for virtualization scenarios where
    MRA wasn't working right

    - Use tracepoints instead of pr_debug in the CM code

    - Scrub the locking in ucma and cma to close more syzkaller bugs

    - Use tasklet_setup in the subsystem

    - Revert the idea that 'destroy' operations are not allowed to fail
    at the driver level. This proved unworkable from a HW perspective.

    - Revise how the umem API works so drivers make fewer mistakes using
    it

    - XRC support for qedr

    - Convert uverbs objects RWQ and MW to new the allocation scheme

    - Large queue entry sizes for hns

    - Use hmm_range_fault() for mlx5 On Demand Paging

    - uverbs APIs to inspect the GID table instead of sysfs

    - Move some of the RDMA code for building large page SGLs into
    lib/scatterlist"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (191 commits)
    RDMA/ucma: Fix use after free in destroy id flow
    RDMA/rxe: Handle skb_clone() failure in rxe_recv.c
    RDMA/rxe: Move the definitions for rxe_av.network_type to uAPI
    RDMA: Explicitly pass in the dma_device to ib_register_device
    lib/scatterlist: Do not limit max_segment to PAGE_ALIGNED values
    IB/mlx4: Convert rej_tmout radix-tree to XArray
    RDMA/rxe: Fix bug rejecting all multicast packets
    RDMA/rxe: Fix skb lifetime in rxe_rcv_mcast_pkt()
    RDMA/rxe: Remove duplicate entries in struct rxe_mr
    IB/hfi,rdmavt,qib,opa_vnic: Update MAINTAINERS
    IB/rdmavt: Fix sizeof mismatch
    MAINTAINERS: CISCO VIC LOW LATENCY NIC DRIVER
    RDMA/bnxt_re: Fix sizeof mismatch for allocation of pbl_tbl.
    RDMA/bnxt_re: Use rdma_umem_for_each_dma_block()
    RDMA/umem: Move to allocate SG table from pages
    lib/scatterlist: Add support in dynamic allocation of SG table from pages
    tools/testing/scatterlist: Show errors in human readable form
    tools/testing/scatterlist: Rejuvenate bit-rotten test
    RDMA/ipoib: Set rtnl_link_ops for ipoib interfaces
    RDMA/uverbs: Expose the new GID query API to user space
    ...

    Linus Torvalds
     

17 Oct, 2020

1 commit

  • The code in setup_dma_device has become rather convoluted, move all of
    this to the drivers. Drives now pass in a DMA capable struct device which
    will be used to setup DMA, or drivers must fully configure the ibdev for
    DMA and pass in NULL.

    Other than setting the masks in rvt all drivers were doing this already
    anyhow.

    mthca, mlx4 and mlx5 were already setting up maximum DMA segment size for
    DMA based on their hardweare limits in:
    __mthca_init_one()
    dma_set_max_seg_size (1G)

    __mlx4_init_one()
    dma_set_max_seg_size (1G)

    mlx5_pci_init()
    set_dma_caps()
    dma_set_max_seg_size (2G)

    Other non software drivers (except usnic) were extended to UINT_MAX [1, 2]
    instead of 2G as was before.

    [1] https://lore.kernel.org/linux-rdma/20200924114940.GE9475@nvidia.com/
    [2] https://lore.kernel.org/linux-rdma/20200924114940.GE9475@nvidia.com/

    Link: https://lore.kernel.org/r/20201008082752.275846-1-leon@kernel.org
    Link: https://lore.kernel.org/r/6b2ed339933d066622d5715903870676d8cc523a.1602590106.git.mchehab+huawei@kernel.org
    Suggested-by: Christoph Hellwig
    Signed-off-by: Parav Pandit
    Signed-off-by: Leon Romanovsky
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Jason Gunthorpe

    Jason Gunthorpe
     

14 Oct, 2020

1 commit


09 Oct, 2020

1 commit

  • Was missed during the initial review of the below patch

    Fixes: 227a0e142e37 ("IB/mlx4: Add support for REJ due to timeout")
    Link: https://lore.kernel.org/r/1602253482-6718-1-git-send-email-haakon.bugge@oracle.com
    Signed-off-by: Håkon Bugge
    Signed-off-by: Jason Gunthorpe

    Håkon Bugge
     

07 Oct, 2020

2 commits

  • An incorrect sizeof is being used, u64 * is not correct, it should be just
    u64 for a table of umem_pgs number of u64 items in the pbl_tbl. Use the
    idiom sizeof(*pbl_tbl) to get the object type without the need to
    explicitly use u64.

    Link: https://lore.kernel.org/r/20201006114700.537916-1-colin.king@canonical.com
    Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)")
    Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
    Signed-off-by: Colin Ian King
    Signed-off-by: Jason Gunthorpe

    Colin Ian King
     
  • This driver is taking the SGL out of the umem and passing it through a
    struct bnxt_qplib_sg_info. Instead of passing the SGL pass the umem and
    then use rdma_umem_for_each_dma_block() directly.

    Move the calls of ib_umem_num_dma_blocks() closer to their actual point of
    use, npages is only set for non-umem pbl flows.

    Link: https://lore.kernel.org/r/0-v1-b37437a73f35+49c-bnxt_re_dma_block_jgg@nvidia.com
    Acked-by: Selvin Xavier
    Tested-by: Selvin Xavier
    Signed-off-by: Jason Gunthorpe

    Jason Gunthorpe
     

02 Oct, 2020

2 commits

  • Separate IB_GID_TYPE_IB and IB_GID_TYPE_ROCE to two different values, so
    enum ib_gid_type will match the gid types of the new query GID table API
    which will be introduced in the following patches.

    This change in enum ib_gid_type requires to change also enum
    rdma_network_type by separating RDMA_NETWORK_IB and RDMA_NETWORK_ROCE_V1
    values.

    Link: https://lore.kernel.org/r/20200923165015.2491894-3-leon@kernel.org
    Signed-off-by: Avihai Horon
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe

    Avihai Horon
     
  • Making a change to fix following sparse warnings reported by kbuild bot.

    CHECK drivers/infiniband/hw/qedr/verbs.c

    drivers/infiniband/hw/qedr/verbs.c:3872:59: warning: incorrect type in assignment (different base types)
    drivers/infiniband/hw/qedr/verbs.c:3872:59: expected restricted __le32 [usertype] sge_prod
    drivers/infiniband/hw/qedr/verbs.c:3872:59: got unsigned int [usertype] sge_prod
    drivers/infiniband/hw/qedr/verbs.c:3875:59: warning: incorrect type in assignment (different base types)
    drivers/infiniband/hw/qedr/verbs.c:3875:59: expected restricted __le32 [usertype] wqe_prod
    drivers/infiniband/hw/qedr/verbs.c:3875:59: got unsigned int [usertype] wqe_prod

    Link: https://lore.kernel.org/r/20201001100959.19940-1-palok@marvell.com
    Reported-by: kbuild test robot
    Fixes: acca72e2b031 ("RDMA/qedr: SRQ's bug fixes")
    Signed-off-by: Igor Russkikh
    Signed-off-by: Michal Kalderon
    Signed-off-by: Alok Prasad
    Signed-off-by: Jason Gunthorpe

    Alok Prasad