diff options
author | Haggai Eran <haggaie@mellanox.com> | 2014-05-22 07:50:09 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-05-27 14:53:05 -0400 |
commit | 8605933a22796243982e7ed838deca5549c64c62 (patch) | |
tree | d3c90a75a57109d5aa5a7f5e23f52c0962d14336 | |
parent | 096f7e72c604e983e14b84b84fc37593fc433585 (diff) |
IB/mlx5: Add MR to radix tree in reg_mr_callback
For memory regions that are allocated using reg_umr, the suffix of
mlx5_core_create_mkey isn't being called. Instead the creation is
completed in a callback function (reg_mr_callback). This means that
these MRs aren't being added to the MR radix tree. Add them in the
callback.
Signed-off-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r-- | drivers/infiniband/hw/mlx5/mr.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index ad5898592016..9d932a2aa9f4 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c | |||
@@ -73,6 +73,8 @@ static void reg_mr_callback(int status, void *context) | |||
73 | struct mlx5_cache_ent *ent = &cache->ent[c]; | 73 | struct mlx5_cache_ent *ent = &cache->ent[c]; |
74 | u8 key; | 74 | u8 key; |
75 | unsigned long flags; | 75 | unsigned long flags; |
76 | struct mlx5_mr_table *table = &dev->mdev.priv.mr_table; | ||
77 | int err; | ||
76 | 78 | ||
77 | spin_lock_irqsave(&ent->lock, flags); | 79 | spin_lock_irqsave(&ent->lock, flags); |
78 | ent->pending--; | 80 | ent->pending--; |
@@ -107,6 +109,13 @@ static void reg_mr_callback(int status, void *context) | |||
107 | ent->cur++; | 109 | ent->cur++; |
108 | ent->size++; | 110 | ent->size++; |
109 | spin_unlock_irqrestore(&ent->lock, flags); | 111 | spin_unlock_irqrestore(&ent->lock, flags); |
112 | |||
113 | write_lock_irqsave(&table->lock, flags); | ||
114 | err = radix_tree_insert(&table->tree, mlx5_base_mkey(mr->mmr.key), | ||
115 | &mr->mmr); | ||
116 | if (err) | ||
117 | pr_err("Error inserting to mr tree. 0x%x\n", -err); | ||
118 | write_unlock_irqrestore(&table->lock, flags); | ||
110 | } | 119 | } |
111 | 120 | ||
112 | static int add_keys(struct mlx5_ib_dev *dev, int c, int num) | 121 | static int add_keys(struct mlx5_ib_dev *dev, int c, int num) |