Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Feb 2023 23:11:03 +0000 (15:11 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Feb 2023 23:11:03 +0000 (15:11 -0800)
Pull rdma updates from Jason Gunthorpe:
 "Quite a small cycle this time, even with the rc8. I suppose everyone
  went to sleep over xmas.

   - Minor driver updates for hfi1, cxgb4, erdma, hns, irdma, mlx5, siw,
     mana

   - inline CQE support for hns

   - Have mlx5 display device error codes

   - Pinned DMABUF support for irdma

   - Continued rxe cleanups, particularly converting the MRs to use
     xarray

   - Improvements to what can be cached in the mlx5 mkey cache"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (61 commits)
  IB/mlx5: Extend debug control for CC parameters
  IB/hfi1: Fix sdma.h tx->num_descs off-by-one errors
  IB/hfi1: Fix math bugs in hfi1_can_pin_pages()
  RDMA/irdma: Add support for dmabuf pin memory regions
  RDMA/mlx5: Use query_special_contexts for mkeys
  net/mlx5e: Use query_special_contexts for mkeys
  net/mlx5: Change define name for 0x100 lkey value
  net/mlx5: Expose bits for querying special mkeys
  RDMA/rxe: Fix missing memory barriers in rxe_queue.h
  RDMA/mana_ib: Fix a bug when the PF indicates more entries for registering memory on first packet
  RDMA/rxe: Remove rxe_alloc()
  RDMA/cma: Distinguish between sockaddr_in and sockaddr_in6 by size
  Subject: RDMA/rxe: Handle zero length rdma
  iw_cxgb4: Fix potential NULL dereference in c4iw_fill_res_cm_id_entry()
  RDMA/mlx5: Use rdma_umem_for_each_dma_block()
  RDMA/umem: Remove unused 'work' member from struct ib_umem
  RDMA/irdma: Cap MSIX used to online CPUs + 1
  RDMA/mlx5: Check reg_create() create for errors
  RDMA/restrack: Correct spelling
  RDMA/cxgb4: Fix potential null-ptr-deref in pass_establish()
  ...

1  2 
drivers/infiniband/hw/hfi1/file_ops.c
drivers/infiniband/hw/hfi1/user_exp_rcv.c
drivers/infiniband/hw/mlx5/main.c
drivers/infiniband/sw/rxe/rxe_pool.c
drivers/infiniband/ulp/ipoib/ipoib_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
include/linux/mlx4/qp.h
include/linux/mlx5/driver.h
include/linux/mlx5/mlx5_ifc.h

@@@ -403,8 -424,17 +424,17 @@@ static int hfi1_file_mmap(struct file *
                        ret = -EPERM;
                        goto done;
                }
 -              vma->vm_flags &= ~VM_MAYWRITE;
 +              vm_flags_clear(vma, VM_MAYWRITE);
-               addr = vma->vm_start;
+               /*
+                * Mmap multiple separate allocations into a single vma.  From
+                * here, dma_mmap_coherent() calls dma_direct_mmap(), which
+                * requires the mmap to exactly fill the vma starting at
+                * vma_start.  Adjust the vma start and end for each eager
+                * buffer segment mapped.  Restore the originals when done.
+                */
+               vm_start_save = vma->vm_start;
+               vm_end_save = vma->vm_end;
+               vma->vm_end = vma->vm_start;
                for (i = 0 ; i < uctxt->egrbufs.numbufs; i++) {
                        memlen = uctxt->egrbufs.buffers[i].len;
                        memvirt = uctxt->egrbufs.buffers[i].addr;
                goto done;
        }
  
 -      vma->vm_flags = flags;
 +      vm_flags_reset(vma, flags);
-       hfi1_cdbg(PROC,
-                 "%u:%u type:%u io/vf:%d/%d, addr:0x%llx, len:%lu(%lu), flags:0x%lx\n",
-                   ctxt, subctxt, type, mapio, vmf, memaddr, memlen,
-                   vma->vm_end - vma->vm_start, vma->vm_flags);
+       mmap_cdbg(ctxt, subctxt, type, mapio, vmf, memaddr, memvirt, memdma, 
+                 memlen, vma);
        if (vmf) {
                vma->vm_pgoff = PFN_DOWN(memaddr);
                vma->vm_ops = &vm_ops;
@@@ -23,17 -23,12 +23,16 @@@ static void cacheless_tid_rb_remove(str
  static bool tid_rb_invalidate(struct mmu_interval_notifier *mni,
                              const struct mmu_notifier_range *range,
                              unsigned long cur_seq);
 +static bool tid_cover_invalidate(struct mmu_interval_notifier *mni,
 +                               const struct mmu_notifier_range *range,
 +                               unsigned long cur_seq);
  static int program_rcvarray(struct hfi1_filedata *fd, struct tid_user_buf *,
-                           struct tid_group *grp,
-                           unsigned int start, u16 count,
+                           struct tid_group *grp, u16 count,
                            u32 *tidlist, unsigned int *tididx,
                            unsigned int *pmapped);
 -static int unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo,
 -                            struct tid_group **grp);
 +static int unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo);
 +static void __clear_tid_node(struct hfi1_filedata *fd,
 +                           struct tid_rb_node *node);
  static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node);
  
  static const struct mmu_interval_notifier_ops tid_mn_ops = {
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge