aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/irdma/verbs.c
diff options
context:
space:
mode:
authorMustafa Ismail <mustafa.ismail@intel.com>2022-07-05 18:08:36 -0500
committerJason Gunthorpe <jgg@nvidia.com>2022-07-11 03:03:50 -0300
commit5e8afb8792f3b6ae7ccf700f8c19225382636401 (patch)
tree65487077af3cff3a63b117b55b26f164e9643a1c /drivers/infiniband/hw/irdma/verbs.c
parentLinux 5.19-rc6 (diff)
downloadlinux-dev-5e8afb8792f3b6ae7ccf700f8c19225382636401.tar.xz
linux-dev-5e8afb8792f3b6ae7ccf700f8c19225382636401.zip
RDMA/irdma: Do not advertise 1GB page size for x722
x722 does not support 1GB page size but the irdma driver incorrectly advertises 1GB page size support for x722 device to ib_core to compute the best page size to use on this MR. This could lead to incorrect start offsets computed by hardware on the MR. Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to '')
-rw-r--r--drivers/infiniband/hw/irdma/verbs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index c4412ece5a6d..96135a228f26 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -32,7 +32,7 @@ static int irdma_query_device(struct ib_device *ibdev,
props->vendor_part_id = pcidev->device;
props->hw_ver = rf->pcidev->revision;
- props->page_size_cap = SZ_4K | SZ_2M | SZ_1G;
+ props->page_size_cap = hw_attrs->page_size_cap;
props->max_mr_size = hw_attrs->max_mr_size;
props->max_qp = rf->max_qp - rf->used_qps;
props->max_qp_wr = hw_attrs->max_qp_wr;
@@ -2781,7 +2781,7 @@ static struct ib_mr *irdma_reg_user_mr(struct ib_pd *pd, u64 start, u64 len,
if (req.reg_type == IRDMA_MEMREG_TYPE_MEM) {
iwmr->page_size = ib_umem_find_best_pgsz(region,
- SZ_4K | SZ_2M | SZ_1G,
+ iwdev->rf->sc_dev.hw_attrs.page_size_cap,
virt);
if (unlikely(!iwmr->page_size)) {
kfree(iwmr);