mlx5_core: Store MR attributes in mlx5_mr_core during creation and after UMR
authorHaggai Eran <haggaie@mellanox.com>
Thu, 22 May 2014 11:50:10 +0000 (14:50 +0300)
committerRoland Dreier <roland@purestorage.com>
Tue, 27 May 2014 18:53:06 +0000 (11:53 -0700)
The patch stores iova, pd and size during mr creation and after UMRs
that modify them.  It removes the unused access flags field.

Signed-off-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/mlx5/mr.c
drivers/net/ethernet/mellanox/mlx5/core/mr.c
include/linux/mlx5/driver.h

index 9d932a2aa9f48c4b3c183072c7570250d09f6fab..f472ab246d94faf87ba5991f2b27847aa58e89ed 100644 (file)
@@ -794,6 +794,10 @@ static struct mlx5_ib_mr *reg_umr(struct ib_pd *pd, struct ib_umem *umem,
                err = -EFAULT;
        }
 
+       mr->mmr.iova = virt_addr;
+       mr->mmr.size = len;
+       mr->mmr.pd = to_mpd(pd)->pdn;
+
 unmap_dma:
        up(&umrc->sem);
        dma_unmap_single(ddev, mr->dma, size, DMA_TO_DEVICE);
index 4cc92764940477c4f9622fc0cbc4238a08d81283..ac52a0fe2d3af12ccda01d858a4f78d9eb7e2343 100644 (file)
@@ -82,7 +82,11 @@ int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr,
                return mlx5_cmd_status_to_err(&lout.hdr);
        }
 
+       mr->iova = be64_to_cpu(in->seg.start_addr);
+       mr->size = be64_to_cpu(in->seg.len);
        mr->key = mlx5_idx_to_mkey(be32_to_cpu(lout.mkey) & 0xffffff) | key;
+       mr->pd = be32_to_cpu(in->seg.flags_pd) & 0xffffff;
+
        mlx5_core_dbg(dev, "out 0x%x, key 0x%x, mkey 0x%x\n",
                      be32_to_cpu(lout.mkey), key, mr->key);
 
index 93cef6313e72d2a63e2eb1c8e5c6347ae5664cad..2bce4aad257094ae16398c3cdd946405f4f2427d 100644 (file)
@@ -427,7 +427,6 @@ struct mlx5_core_mr {
        u64                     size;
        u32                     key;
        u32                     pd;
-       u32                     access;
 };
 
 struct mlx5_core_srq {