Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2d9308a authored by Jack Morgenstein's avatar Jack Morgenstein Committed by Roland Dreier
Browse files

mlx4_core: Don't set MTT address in dMPT entries with PA set



If a dMPT entry has the PA flag (direct physical address) set, then
the (unused) MTT base address field has to be set to 0.

Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent fe40900f
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -324,14 +324,16 @@ int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr)
				       MLX4_MPT_FLAG_MIO	 |
				       MLX4_MPT_FLAG_REGION	 |
				       mr->access);
	if (mr->mtt.order < 0)
		mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_PHYSICAL);

	mpt_entry->key	       = cpu_to_be32(key_to_hw_index(mr->key));
	mpt_entry->pd	       = cpu_to_be32(mr->pd);
	mpt_entry->start       = cpu_to_be64(mr->iova);
	mpt_entry->length      = cpu_to_be64(mr->size);
	mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift);
	if (mr->mtt.order < 0) {
		mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_PHYSICAL);
		mpt_entry->mtt_seg = 0;
	} else
		mpt_entry->mtt_seg = cpu_to_be64(mlx4_mtt_addr(dev, &mr->mtt));

	err = mlx4_SW2HW_MPT(dev, mailbox,