aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaggai Eran <haggaie@mellanox.com>2014-05-22 07:50:10 -0400
committerRoland Dreier <roland@purestorage.com>2014-05-27 14:53:06 -0400
commitb475598aec63f2efbc78f0ff1895d917d2370846 (patch)
treea4c0b13aa5cbe15a1ac5fb50bddc2c9208a0c193
parent8605933a22796243982e7ed838deca5549c64c62 (diff)
mlx5_core: Store MR attributes in mlx5_mr_core during creation and after UMR
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>
-rw-r--r--drivers/infiniband/hw/mlx5/mr.c4
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/mr.c4
-rw-r--r--include/linux/mlx5/driver.h1
3 files changed, 8 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index 9d932a2aa9f4..f472ab246d94 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -794,6 +794,10 @@ static struct mlx5_ib_mr *reg_umr(struct ib_pd *pd, struct ib_umem *umem,
794 err = -EFAULT; 794 err = -EFAULT;
795 } 795 }
796 796
797 mr->mmr.iova = virt_addr;
798 mr->mmr.size = len;
799 mr->mmr.pd = to_mpd(pd)->pdn;
800
797unmap_dma: 801unmap_dma:
798 up(&umrc->sem); 802 up(&umrc->sem);
799 dma_unmap_single(ddev, mr->dma, size, DMA_TO_DEVICE); 803 dma_unmap_single(ddev, mr->dma, size, DMA_TO_DEVICE);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mr.c b/drivers/net/ethernet/mellanox/mlx5/core/mr.c
index 4cc927649404..ac52a0fe2d3a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/mr.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/mr.c
@@ -82,7 +82,11 @@ int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr,
82 return mlx5_cmd_status_to_err(&lout.hdr); 82 return mlx5_cmd_status_to_err(&lout.hdr);
83 } 83 }
84 84
85 mr->iova = be64_to_cpu(in->seg.start_addr);
86 mr->size = be64_to_cpu(in->seg.len);
85 mr->key = mlx5_idx_to_mkey(be32_to_cpu(lout.mkey) & 0xffffff) | key; 87 mr->key = mlx5_idx_to_mkey(be32_to_cpu(lout.mkey) & 0xffffff) | key;
88 mr->pd = be32_to_cpu(in->seg.flags_pd) & 0xffffff;
89
86 mlx5_core_dbg(dev, "out 0x%x, key 0x%x, mkey 0x%x\n", 90 mlx5_core_dbg(dev, "out 0x%x, key 0x%x, mkey 0x%x\n",
87 be32_to_cpu(lout.mkey), key, mr->key); 91 be32_to_cpu(lout.mkey), key, mr->key);
88 92
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 93cef6313e72..2bce4aad2570 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -427,7 +427,6 @@ struct mlx5_core_mr {
427 u64 size; 427 u64 size;
428 u32 key; 428 u32 key;
429 u32 pd; 429 u32 pd;
430 u32 access;
431}; 430};
432 431
433struct mlx5_core_srq { 432struct mlx5_core_srq {