]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 19 Dec 2014 04:10:44 +0000 (20:10 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 19 Dec 2014 04:10:44 +0000 (20:10 -0800)
Pull infiniband updates from Roland Dreier:
 "Main batch of InfiniBand/RDMA changes for 3.19:

   - On-demand paging support in core midlayer and mlx5 driver.  This
     lets userspace create non-pinned memory regions and have the
     adapter HW trigger page faults.
   - iSER and IPoIB updates and fixes.
   - Low-level HW driver updates for cxgb4, mlx4 and ocrdma.
   - Other miscellaneous fixes"

* tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (56 commits)
  IB/mlx5: Implement on demand paging by adding support for MMU notifiers
  IB/mlx5: Add support for RDMA read/write responder page faults
  IB/mlx5: Handle page faults
  IB/mlx5: Page faults handling infrastructure
  IB/mlx5: Add mlx5_ib_update_mtt to update page tables after creation
  IB/mlx5: Changes in memory region creation to support on-demand paging
  IB/mlx5: Implement the ODP capability query verb
  mlx5_core: Add support for page faults events and low level handling
  mlx5_core: Re-add MLX5_DEV_CAP_FLAG_ON_DMND_PG flag
  IB/srp: Allow newline separator for connection string
  IB/core: Implement support for MMU notifiers regarding on demand paging regions
  IB/core: Add support for on demand paging regions
  IB/core: Add flags for on demand paging support
  IB/core: Add support for extended query device caps
  IB/mlx5: Add function to read WQE from user-space
  IB/core: Add umem function to read data from user-space
  IB/core: Replace ib_umem's offset field with a full address
  IB/mlx5: Enhance UMR support to allow partial page table update
  IB/mlx5: Remove per-MR pas and dma pointers
  RDMA/ocrdma: Always resolve destination mac from GRH for UD QPs
  ...

1  2 
drivers/net/ethernet/mellanox/mlx4/main.c

index b935bf3d0bb347350bcd5479462b60eced814d5d,629f9f1435a5976cc63613ac57df7532a73ab52c..943cbd47d832bb98719e355a727e8451c68bfbbe
@@@ -171,9 -171,9 +171,9 @@@ int mlx4_check_port_params(struct mlx4_
  {
        int i;
  
-       for (i = 0; i < dev->caps.num_ports - 1; i++) {
-               if (port_type[i] != port_type[i + 1]) {
-                       if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP)) {
+       if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP)) {
+               for (i = 0; i < dev->caps.num_ports - 1; i++) {
+                       if (port_type[i] != port_type[i + 1]) {
                                mlx4_err(dev, "Only same port types supported on this HCA, aborting\n");
                                return -EINVAL;
                        }
@@@ -305,7 -305,6 +305,7 @@@ static int mlx4_dev_cap(struct mlx4_de
                mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting\n");
                return err;
        }
 +      mlx4_dev_cap_dump(dev, dev_cap);
  
        if (dev_cap->min_page_sz > PAGE_SIZE) {
                mlx4_err(dev, "HCA minimum page size of %d bigger than kernel PAGE_SIZE of %ld, aborting\n",
@@@ -2489,42 -2488,41 +2489,42 @@@ static u64 mlx4_enable_sriov(struct mlx
                             u8 total_vfs, int existing_vfs)
  {
        u64 dev_flags = dev->flags;
 +      int err = 0;
  
 -      dev->dev_vfs = kzalloc(
 -                      total_vfs * sizeof(*dev->dev_vfs),
 -                      GFP_KERNEL);
 +      atomic_inc(&pf_loading);
 +      if (dev->flags &  MLX4_FLAG_SRIOV) {
 +              if (existing_vfs != total_vfs) {
 +                      mlx4_err(dev, "SR-IOV was already enabled, but with num_vfs (%d) different than requested (%d)\n",
 +                               existing_vfs, total_vfs);
 +                      total_vfs = existing_vfs;
 +              }
 +      }
 +
 +      dev->dev_vfs = kzalloc(total_vfs * sizeof(*dev->dev_vfs), GFP_KERNEL);
        if (NULL == dev->dev_vfs) {
                mlx4_err(dev, "Failed to allocate memory for VFs\n");
                goto disable_sriov;
 -      } else if (!(dev->flags &  MLX4_FLAG_SRIOV)) {
 -              int err = 0;
 -
 -              atomic_inc(&pf_loading);
 -              if (existing_vfs) {
 -                      if (existing_vfs != total_vfs)
 -                              mlx4_err(dev, "SR-IOV was already enabled, but with num_vfs (%d) different than requested (%d)\n",
 -                                       existing_vfs, total_vfs);
 -              } else {
 -                      mlx4_warn(dev, "Enabling SR-IOV with %d VFs\n", total_vfs);
 -                      err = pci_enable_sriov(pdev, total_vfs);
 -              }
 -              if (err) {
 -                      mlx4_err(dev, "Failed to enable SR-IOV, continuing without SR-IOV (err = %d)\n",
 -                               err);
 -                      atomic_dec(&pf_loading);
 -                      goto disable_sriov;
 -              } else {
 -                      mlx4_warn(dev, "Running in master mode\n");
 -                      dev_flags |= MLX4_FLAG_SRIOV |
 -                              MLX4_FLAG_MASTER;
 -                      dev_flags &= ~MLX4_FLAG_SLAVE;
 -                      dev->num_vfs = total_vfs;
 -              }
 +      }
 +
 +      if (!(dev->flags &  MLX4_FLAG_SRIOV)) {
 +              mlx4_warn(dev, "Enabling SR-IOV with %d VFs\n", total_vfs);
 +              err = pci_enable_sriov(pdev, total_vfs);
 +      }
 +      if (err) {
 +              mlx4_err(dev, "Failed to enable SR-IOV, continuing without SR-IOV (err = %d)\n",
 +                       err);
 +              goto disable_sriov;
 +      } else {
 +              mlx4_warn(dev, "Running in master mode\n");
 +              dev_flags |= MLX4_FLAG_SRIOV |
 +                      MLX4_FLAG_MASTER;
 +              dev_flags &= ~MLX4_FLAG_SLAVE;
 +              dev->num_vfs = total_vfs;
        }
        return dev_flags;
  
  disable_sriov:
 +      atomic_dec(&pf_loading);
        dev->num_vfs = 0;
        kfree(dev->dev_vfs);
        return dev_flags & ~MLX4_FLAG_MASTER;
@@@ -2608,10 -2606,8 +2608,10 @@@ static int mlx4_load_one(struct pci_de
                }
  
                if (total_vfs) {
 -                      existing_vfs = pci_num_vf(pdev);
                        dev->flags = MLX4_FLAG_MASTER;
 +                      existing_vfs = pci_num_vf(pdev);
 +                      if (existing_vfs)
 +                              dev->flags |= MLX4_FLAG_SRIOV;
                        dev->num_vfs = total_vfs;
                }
        }
@@@ -2647,7 -2643,6 +2647,7 @@@ slave_start
        }
  
        if (mlx4_is_master(dev)) {
 +              /* when we hit the goto slave_start below, dev_cap already initialized */
                if (!dev_cap) {
                        dev_cap = kzalloc(sizeof(*dev_cap), GFP_KERNEL);
  
        if (mlx4_is_master(dev) && dev->num_vfs)
                atomic_dec(&pf_loading);
  
 +      kfree(dev_cap);
        return 0;
  
  err_port: