Skip to content

Commit 5e8afb8

Browse files
mustafakismailjgunthorpe
authored andcommitted
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: b48c24c ("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>
1 parent 3234649 commit 5e8afb8

4 files changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/infiniband/hw/irdma/i40iw_hw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ void i40iw_init_hw(struct irdma_sc_dev *dev)
201201
dev->hw_attrs.uk_attrs.max_hw_read_sges = I40IW_MAX_SGE_RD;
202202
dev->hw_attrs.max_hw_device_pages = I40IW_MAX_PUSH_PAGE_COUNT;
203203
dev->hw_attrs.uk_attrs.max_hw_inline = I40IW_MAX_INLINE_DATA_SIZE;
204+
dev->hw_attrs.page_size_cap = SZ_4K | SZ_2M;
204205
dev->hw_attrs.max_hw_ird = I40IW_MAX_IRD_SIZE;
205206
dev->hw_attrs.max_hw_ord = I40IW_MAX_ORD_SIZE;
206207
dev->hw_attrs.max_hw_wqes = I40IW_MAX_WQ_ENTRIES;

drivers/infiniband/hw/irdma/icrdma_hw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ void icrdma_init_hw(struct irdma_sc_dev *dev)
139139
dev->cqp_db = dev->hw_regs[IRDMA_CQPDB];
140140
dev->cq_ack_db = dev->hw_regs[IRDMA_CQACK];
141141
dev->irq_ops = &icrdma_irq_ops;
142+
dev->hw_attrs.page_size_cap = SZ_4K | SZ_2M | SZ_1G;
142143
dev->hw_attrs.max_hw_ird = ICRDMA_MAX_IRD_SIZE;
143144
dev->hw_attrs.max_hw_ord = ICRDMA_MAX_ORD_SIZE;
144145
dev->hw_attrs.max_stat_inst = ICRDMA_MAX_STATS_COUNT;

drivers/infiniband/hw/irdma/irdma.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ struct irdma_hw_attrs {
127127
u64 max_hw_outbound_msg_size;
128128
u64 max_hw_inbound_msg_size;
129129
u64 max_mr_size;
130+
u64 page_size_cap;
130131
u32 min_hw_qp_id;
131132
u32 min_hw_aeq_size;
132133
u32 max_hw_aeq_size;

drivers/infiniband/hw/irdma/verbs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static int irdma_query_device(struct ib_device *ibdev,
3232
props->vendor_part_id = pcidev->device;
3333

3434
props->hw_ver = rf->pcidev->revision;
35-
props->page_size_cap = SZ_4K | SZ_2M | SZ_1G;
35+
props->page_size_cap = hw_attrs->page_size_cap;
3636
props->max_mr_size = hw_attrs->max_mr_size;
3737
props->max_qp = rf->max_qp - rf->used_qps;
3838
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,
27812781

27822782
if (req.reg_type == IRDMA_MEMREG_TYPE_MEM) {
27832783
iwmr->page_size = ib_umem_find_best_pgsz(region,
2784-
SZ_4K | SZ_2M | SZ_1G,
2784+
iwdev->rf->sc_dev.hw_attrs.page_size_cap,
27852785
virt);
27862786
if (unlikely(!iwmr->page_size)) {
27872787
kfree(iwmr);

0 commit comments

Comments
 (0)