Pull rdma fixes from Jason Gunthorpe: "Two bug fixes for irdma: - x722 does not support 1GB pages, trying to configure them will corrupt the dma mapping - Fix a sleep while holding a spinlock" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/irdma: Fix sleep from invalid context BUG RDMA/irdma: Do not advertise 1GB page size for x722
Unified · Split
| @@ -4231,10 +4231,6 @@ void irdma_cm_teardown_connections(struct irdma_device *iwdev, u32 *ipaddr, · 4230 unmodified lines | ||
| 4231 | 4231 | struct irdma_cm_node *cm_node; |
| 4232 | 4232 | struct list_head teardown_list; |
| 4233 | 4233 | struct ib_qp_attr attr; |
| 4234 | − struct irdma_sc_vsi *vsi = &iwdev->vsi; | |
| 4235 | − struct irdma_sc_qp *sc_qp; | |
| 4236 | − struct irdma_qp *qp; | |
| 4237 | − int i; | |
| 4238 | 4234 | |
| 4239 | 4235 | INIT_LIST_HEAD(&teardown_list); |
| 4240 | 4236 | |
| @@ -4251,52 +4247,6 @@ void irdma_cm_teardown_connections(struct irdma_device *iwdev, u32 *ipaddr, · 10 unmodified lines | ||
| 4251 | 4247 | irdma_cm_disconn(cm_node->iwqp); |
| 4252 | 4248 | irdma_rem_ref_cm_node(cm_node); |
| 4253 | 4249 | } |
| 4254 | − if (!iwdev->roce_mode) | |
| 4255 | − return; | |
| 4256 | − | |
| 4257 | − INIT_LIST_HEAD(&teardown_list); | |
| 4258 | − for (i = 0; i < IRDMA_MAX_USER_PRIORITY; i++) { | |
| 4259 | − mutex_lock(&vsi->qos[i].qos_mutex); | |
| 4260 | − list_for_each_safe (list_node, list_core_temp, | |
| 4261 | − &vsi->qos[i].qplist) { | |
| 4262 | − u32 qp_ip[4]; | |
| 4263 | − | |
| 4264 | − sc_qp = container_of(list_node, struct irdma_sc_qp, | |
| 4265 | − list); | |
| 4266 | − if (sc_qp->qp_uk.qp_type != IRDMA_QP_TYPE_ROCE_RC) | |
| 4267 | − continue; | |
| 4268 | − | |
| 4269 | − qp = sc_qp->qp_uk.back_qp; | |
| 4270 | − if (!disconnect_all) { | |
| 4271 | − if (nfo->ipv4) | |
| 4272 | − qp_ip[0] = qp->udp_info.local_ipaddr[3]; | |
| 4273 | − else | |
| 4274 | − memcpy(qp_ip, | |
| 4275 | − &qp->udp_info.local_ipaddr[0], | |
| 4276 | − sizeof(qp_ip)); | |
| 4277 | − } | |
| 4278 | − | |
| 4279 | − if (disconnect_all || | |
| 4280 | − (nfo->vlan_id == (qp->udp_info.vlan_tag & VLAN_VID_MASK) && | |
| 4281 | − !memcmp(qp_ip, ipaddr, nfo->ipv4 ? 4 : 16))) { | |
| 4282 | − spin_lock(&iwdev->rf->qptable_lock); | |
| 4283 | − if (iwdev->rf->qp_table[sc_qp->qp_uk.qp_id]) { | |
| 4284 | − irdma_qp_add_ref(&qp->ibqp); | |
| 4285 | − list_add(&qp->teardown_entry, | |
| 4286 | − &teardown_list); | |
| 4287 | − } | |
| 4288 | − spin_unlock(&iwdev->rf->qptable_lock); | |
| 4289 | − } | |
| 4290 | − } | |
| 4291 | − mutex_unlock(&vsi->qos[i].qos_mutex); | |
| 4292 | − } | |
| 4293 | − | |
| 4294 | − list_for_each_safe (list_node, list_core_temp, &teardown_list) { | |
| 4295 | − qp = container_of(list_node, struct irdma_qp, teardown_entry); | |
| 4296 | − attr.qp_state = IB_QPS_ERR; | |
| 4297 | − irdma_modify_qp_roce(&qp->ibqp, &attr, IB_QP_STATE, NULL); | |
| 4298 | − irdma_qp_rem_ref(&qp->ibqp); | |
| 4299 | − } | |
| 4300 | 4250 | } |
| 4301 | 4251 | |
| 4302 | 4252 | /** |
| @@ -201,6 +201,7 @@ void i40iw_init_hw(struct irdma_sc_dev *dev) · 200 unmodified lines | ||
| 201 | 201 | dev->hw_attrs.uk_attrs.max_hw_read_sges = I40IW_MAX_SGE_RD; |
| 202 | 202 | dev->hw_attrs.max_hw_device_pages = I40IW_MAX_PUSH_PAGE_COUNT; |
| 203 | 203 | dev->hw_attrs.uk_attrs.max_hw_inline = I40IW_MAX_INLINE_DATA_SIZE; |
| 204 | + dev->hw_attrs.page_size_cap = SZ_4K | SZ_2M; | |
| 204 | 205 | dev->hw_attrs.max_hw_ird = I40IW_MAX_IRD_SIZE; |
| 205 | 206 | dev->hw_attrs.max_hw_ord = I40IW_MAX_ORD_SIZE; |
| 206 | 207 | dev->hw_attrs.max_hw_wqes = I40IW_MAX_WQ_ENTRIES; |
| @@ -139,6 +139,7 @@ void icrdma_init_hw(struct irdma_sc_dev *dev) · 138 unmodified lines | ||
| 139 | 139 | dev->cqp_db = dev->hw_regs[IRDMA_CQPDB]; |
| 140 | 140 | dev->cq_ack_db = dev->hw_regs[IRDMA_CQACK]; |
| 141 | 141 | dev->irq_ops = &icrdma_irq_ops; |
| 142 | + dev->hw_attrs.page_size_cap = SZ_4K | SZ_2M | SZ_1G; | |
| 142 | 143 | dev->hw_attrs.max_hw_ird = ICRDMA_MAX_IRD_SIZE; |
| 143 | 144 | dev->hw_attrs.max_hw_ord = ICRDMA_MAX_ORD_SIZE; |
| 144 | 145 | dev->hw_attrs.max_stat_inst = ICRDMA_MAX_STATS_COUNT; |
| @@ -127,6 +127,7 @@ struct irdma_hw_attrs { · 126 unmodified lines | ||
| 127 | 127 | u64 max_hw_outbound_msg_size; |
| 128 | 128 | u64 max_hw_inbound_msg_size; |
| 129 | 129 | u64 max_mr_size; |
| 130 | + u64 page_size_cap; | |
| 130 | 131 | u32 min_hw_qp_id; |
| 131 | 132 | u32 min_hw_aeq_size; |
| 132 | 133 | u32 max_hw_aeq_size; |
| @@ -32,7 +32,7 @@ static int irdma_query_device(struct ib_device *ibdev, · 31 unmodified lines | ||
| 32 | 32 | props->vendor_part_id = pcidev->device; |
| 33 | 33 | |
| 34 | 34 | 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; | |
| 36 | 36 | props->max_mr_size = hw_attrs->max_mr_size; |
| 37 | 37 | props->max_qp = rf->max_qp - rf->used_qps; |
| 38 | 38 | 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, · 2742 unmodified lines | ||
| 2781 | 2781 | |
| 2782 | 2782 | if (req.reg_type == IRDMA_MEMREG_TYPE_MEM) { |
| 2783 | 2783 | 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, | |
| 2785 | 2785 | virt); |
| 2786 | 2786 | if (unlikely(!iwmr->page_size)) { |
| 2787 | 2787 | kfree(iwmr); |