aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/mlx4/mr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/mlx4/mr.c b/drivers/net/mlx4/mr.c
index b33864dab179..d0808fa3ec82 100644
--- a/drivers/net/mlx4/mr.c
+++ b/drivers/net/mlx4/mr.c
@@ -324,15 +324,17 @@ int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr)
324 MLX4_MPT_FLAG_MIO | 324 MLX4_MPT_FLAG_MIO |
325 MLX4_MPT_FLAG_REGION | 325 MLX4_MPT_FLAG_REGION |
326 mr->access); 326 mr->access);
327 if (mr->mtt.order < 0)
328 mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_PHYSICAL);
329 327
330 mpt_entry->key = cpu_to_be32(key_to_hw_index(mr->key)); 328 mpt_entry->key = cpu_to_be32(key_to_hw_index(mr->key));
331 mpt_entry->pd = cpu_to_be32(mr->pd); 329 mpt_entry->pd = cpu_to_be32(mr->pd);
332 mpt_entry->start = cpu_to_be64(mr->iova); 330 mpt_entry->start = cpu_to_be64(mr->iova);
333 mpt_entry->length = cpu_to_be64(mr->size); 331 mpt_entry->length = cpu_to_be64(mr->size);
334 mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift); 332 mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift);
335 mpt_entry->mtt_seg = cpu_to_be64(mlx4_mtt_addr(dev, &mr->mtt)); 333 if (mr->mtt.order < 0) {
334 mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_PHYSICAL);
335 mpt_entry->mtt_seg = 0;
336 } else
337 mpt_entry->mtt_seg = cpu_to_be64(mlx4_mtt_addr(dev, &mr->mtt));
336 338
337 err = mlx4_SW2HW_MPT(dev, mailbox, 339 err = mlx4_SW2HW_MPT(dev, mailbox,
338 key_to_hw_index(mr->key) & (dev->caps.num_mpts - 1)); 340 key_to_hw_index(mr->key) & (dev->caps.num_mpts - 1));