Re: [PATCH 06/20] RDMA/mlx5: Implement mlx5_ib_map_mr_sg_pi and mlx5_ib_alloc_mr_integrity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 6/4/2019 10:38 AM, Christoph Hellwig wrote:
  int mlx5_ib_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
  {
-	dereg_mr(to_mdev(ibmr->device), to_mmr(ibmr));
+	struct mlx5_ib_mr *mmr = to_mmr(ibmr);
+
+	if (ibmr->type == IB_MR_TYPE_INTEGRITY)
+		dereg_mr(to_mdev(mmr->pi_mr->ibmr.device), mmr->pi_mr);
+
+	dereg_mr(to_mdev(ibmr->device), mmr);
Just curious: how could the device for the PI MR be different?  In other
words, why can't this just be:

The device is not different but we need to do both dereg_mr(mdev, mmr->pi_mr) and dereg_mr(mdev, mmr).


	struct mlx5_ib_mr *mmr = to_mmr(ibmr);

	if (ibmr->type == IB_MR_TYPE_INTEGRITY)
		mmr = mmr->pi_mr;
	dereg_mr(to_mdev(ibmr->device), mmr);




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux