diff options
author | Max Gurtovoy <maxg@mellanox.com> | 2017-08-28 05:52:27 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2017-08-30 08:46:10 -0400 |
commit | b925a2dc165e5ec2330ca1256704faef8ed96913 (patch) | |
tree | 544fd60925f8a4e8742b6cbf59f3d66d36d90fbe /drivers | |
parent | e9d8a0fdeacd843c85dcef480cdb2ab76bcdb6e4 (diff) |
nvme-rdma: default MR page size to 4k
Due to various page sizes in the system (IOMMU/device/kernel), we
set the fabrics controller page size to 4k and block layer boundaries
accordinglly. In architectures that uses different kernel page size
we'll have a mismatch to the MR page size that may cause a mapping error.
Update the MR page size to correspond to the core ctrl settings.
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nvme/host/rdma.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index da04df1af231..a03299d77922 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c | |||
@@ -920,7 +920,11 @@ static int nvme_rdma_map_sg_fr(struct nvme_rdma_queue *queue, | |||
920 | struct nvme_keyed_sgl_desc *sg = &c->common.dptr.ksgl; | 920 | struct nvme_keyed_sgl_desc *sg = &c->common.dptr.ksgl; |
921 | int nr; | 921 | int nr; |
922 | 922 | ||
923 | nr = ib_map_mr_sg(req->mr, req->sg_table.sgl, count, NULL, PAGE_SIZE); | 923 | /* |
924 | * Align the MR to a 4K page size to match the ctrl page size and | ||
925 | * the block virtual boundary. | ||
926 | */ | ||
927 | nr = ib_map_mr_sg(req->mr, req->sg_table.sgl, count, NULL, SZ_4K); | ||
924 | if (nr < count) { | 928 | if (nr < count) { |
925 | if (nr < 0) | 929 | if (nr < 0) |
926 | return nr; | 930 | return nr; |
@@ -1583,7 +1587,7 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl) | |||
1583 | goto out_cleanup_queue; | 1587 | goto out_cleanup_queue; |
1584 | 1588 | ||
1585 | ctrl->ctrl.max_hw_sectors = | 1589 | ctrl->ctrl.max_hw_sectors = |
1586 | (ctrl->max_fr_pages - 1) << (PAGE_SHIFT - 9); | 1590 | (ctrl->max_fr_pages - 1) << (ilog2(SZ_4K) - 9); |
1587 | 1591 | ||
1588 | error = nvme_init_identify(&ctrl->ctrl); | 1592 | error = nvme_init_identify(&ctrl->ctrl); |
1589 | if (error) | 1593 | if (error) |