verbs.c (b7c15a3ce6fea5da3aa836c897a78ac628467d54) | verbs.c (81091d7696ae71627ff80bbf2c6b0986d2c1cce3) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB 2/* Copyright (c) 2015 - 2021 Intel Corporation */ 3#include "main.h" 4 5/** 6 * irdma_query_device - get device attributes 7 * @ibdev: device pointer from stack 8 * @props: returning device attributes --- 11 unchanged lines hidden (view full) --- 20 if (udata->inlen || udata->outlen) 21 return -EINVAL; 22 23 memset(props, 0, sizeof(*props)); 24 addrconf_addr_eui48((u8 *)&props->sys_image_guid, 25 iwdev->netdev->dev_addr); 26 props->fw_ver = (u64)irdma_fw_major_ver(&rf->sc_dev) << 32 | 27 irdma_fw_minor_ver(&rf->sc_dev); | 1// SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB 2/* Copyright (c) 2015 - 2021 Intel Corporation */ 3#include "main.h" 4 5/** 6 * irdma_query_device - get device attributes 7 * @ibdev: device pointer from stack 8 * @props: returning device attributes --- 11 unchanged lines hidden (view full) --- 20 if (udata->inlen || udata->outlen) 21 return -EINVAL; 22 23 memset(props, 0, sizeof(*props)); 24 addrconf_addr_eui48((u8 *)&props->sys_image_guid, 25 iwdev->netdev->dev_addr); 26 props->fw_ver = (u64)irdma_fw_major_ver(&rf->sc_dev) << 32 | 27 irdma_fw_minor_ver(&rf->sc_dev); |
28 props->device_cap_flags = iwdev->device_cap_flags; | 28 props->device_cap_flags = IB_DEVICE_MEM_WINDOW | 29 IB_DEVICE_MEM_MGT_EXTENSIONS; 30 props->kernel_cap_flags = IBK_LOCAL_DMA_LKEY; |
29 props->vendor_id = pcidev->vendor; 30 props->vendor_part_id = pcidev->device; 31 32 props->hw_ver = rf->pcidev->revision; 33 props->page_size_cap = SZ_4K | SZ_2M | SZ_1G; 34 props->max_mr_size = hw_attrs->max_mr_size; 35 props->max_qp = rf->max_qp - rf->used_qps; 36 props->max_qp_wr = hw_attrs->max_qp_wr; --- 491 unchanged lines hidden (view full) --- 528 struct irdma_qp *iwqp = to_iwqp(ibqp); 529 struct irdma_device *iwdev = iwqp->iwdev; 530 531 iwqp->sc_qp.qp_uk.destroy_pending = true; 532 533 if (iwqp->iwarp_state == IRDMA_QP_STATE_RTS) 534 irdma_modify_qp_to_err(&iwqp->sc_qp); 535 | 31 props->vendor_id = pcidev->vendor; 32 props->vendor_part_id = pcidev->device; 33 34 props->hw_ver = rf->pcidev->revision; 35 props->page_size_cap = SZ_4K | SZ_2M | SZ_1G; 36 props->max_mr_size = hw_attrs->max_mr_size; 37 props->max_qp = rf->max_qp - rf->used_qps; 38 props->max_qp_wr = hw_attrs->max_qp_wr; --- 491 unchanged lines hidden (view full) --- 530 struct irdma_qp *iwqp = to_iwqp(ibqp); 531 struct irdma_device *iwdev = iwqp->iwdev; 532 533 iwqp->sc_qp.qp_uk.destroy_pending = true; 534 535 if (iwqp->iwarp_state == IRDMA_QP_STATE_RTS) 536 irdma_modify_qp_to_err(&iwqp->sc_qp); 537 |
538 if (!iwqp->user_mode) 539 cancel_delayed_work_sync(&iwqp->dwork_flush); 540 |
|
536 irdma_qp_rem_ref(&iwqp->ibqp); 537 wait_for_completion(&iwqp->free_qp); 538 irdma_free_lsmm_rsrc(iwqp); 539 irdma_cqp_qp_destroy_cmd(&iwdev->rf->sc_dev, &iwqp->sc_qp); 540 541 if (!iwqp->user_mode) { 542 if (iwqp->iwscq) { 543 irdma_clean_cqes(iwqp, iwqp->iwscq); --- 239 unchanged lines hidden (view full) --- 783 } else { 784 if (init_attr->qp_type != IB_QPT_RC) 785 return -EOPNOTSUPP; 786 } 787 788 return 0; 789} 790 | 541 irdma_qp_rem_ref(&iwqp->ibqp); 542 wait_for_completion(&iwqp->free_qp); 543 irdma_free_lsmm_rsrc(iwqp); 544 irdma_cqp_qp_destroy_cmd(&iwdev->rf->sc_dev, &iwqp->sc_qp); 545 546 if (!iwqp->user_mode) { 547 if (iwqp->iwscq) { 548 irdma_clean_cqes(iwqp, iwqp->iwscq); --- 239 unchanged lines hidden (view full) --- 788 } else { 789 if (init_attr->qp_type != IB_QPT_RC) 790 return -EOPNOTSUPP; 791 } 792 793 return 0; 794} 795 |
796static void irdma_flush_worker(struct work_struct *work) 797{ 798 struct delayed_work *dwork = to_delayed_work(work); 799 struct irdma_qp *iwqp = container_of(dwork, struct irdma_qp, dwork_flush); 800 801 irdma_generate_flush_completions(iwqp); 802} 803 |
|
791/** 792 * irdma_create_qp - create qp 793 * @ibqp: ptr of qp 794 * @init_attr: attributes for qp 795 * @udata: user data for create qp 796 */ 797static int irdma_create_qp(struct ib_qp *ibqp, 798 struct ib_qp_init_attr *init_attr, --- 103 unchanged lines hidden (view full) --- 902 err_code = -ENODATA; 903 ibdev_dbg(&iwdev->ibdev, "VERBS: no pbl info\n"); 904 goto error; 905 } 906 } 907 init_info.qp_uk_init_info.abi_ver = iwpd->sc_pd.abi_ver; 908 irdma_setup_virt_qp(iwdev, iwqp, &init_info); 909 } else { | 804/** 805 * irdma_create_qp - create qp 806 * @ibqp: ptr of qp 807 * @init_attr: attributes for qp 808 * @udata: user data for create qp 809 */ 810static int irdma_create_qp(struct ib_qp *ibqp, 811 struct ib_qp_init_attr *init_attr, --- 103 unchanged lines hidden (view full) --- 915 err_code = -ENODATA; 916 ibdev_dbg(&iwdev->ibdev, "VERBS: no pbl info\n"); 917 goto error; 918 } 919 } 920 init_info.qp_uk_init_info.abi_ver = iwpd->sc_pd.abi_ver; 921 irdma_setup_virt_qp(iwdev, iwqp, &init_info); 922 } else { |
923 INIT_DELAYED_WORK(&iwqp->dwork_flush, irdma_flush_worker); |
|
910 init_info.qp_uk_init_info.abi_ver = IRDMA_ABI_VER; 911 err_code = irdma_setup_kmode_qp(iwdev, iwqp, &init_info, init_attr); 912 } 913 914 if (err_code) { 915 ibdev_dbg(&iwdev->ibdev, "VERBS: setup qp failed\n"); 916 goto error; 917 } --- 475 unchanged lines hidden (view full) --- 1393 return -EINVAL; 1394 spin_lock_irqsave(&iwqp->lock, flags); 1395 if (iwqp->iwarp_state == info.curr_iwarp_state) { 1396 iwqp->iwarp_state = info.next_iwarp_state; 1397 iwqp->ibqp_state = attr->qp_state; 1398 } 1399 if (iwqp->ibqp_state > IB_QPS_RTS && 1400 !iwqp->flush_issued) { | 924 init_info.qp_uk_init_info.abi_ver = IRDMA_ABI_VER; 925 err_code = irdma_setup_kmode_qp(iwdev, iwqp, &init_info, init_attr); 926 } 927 928 if (err_code) { 929 ibdev_dbg(&iwdev->ibdev, "VERBS: setup qp failed\n"); 930 goto error; 931 } --- 475 unchanged lines hidden (view full) --- 1407 return -EINVAL; 1408 spin_lock_irqsave(&iwqp->lock, flags); 1409 if (iwqp->iwarp_state == info.curr_iwarp_state) { 1410 iwqp->iwarp_state = info.next_iwarp_state; 1411 iwqp->ibqp_state = attr->qp_state; 1412 } 1413 if (iwqp->ibqp_state > IB_QPS_RTS && 1414 !iwqp->flush_issued) { |
1401 iwqp->flush_issued = 1; | |
1402 spin_unlock_irqrestore(&iwqp->lock, flags); 1403 irdma_flush_wqes(iwqp, IRDMA_FLUSH_SQ | 1404 IRDMA_FLUSH_RQ | 1405 IRDMA_FLUSH_WAIT); | 1415 spin_unlock_irqrestore(&iwqp->lock, flags); 1416 irdma_flush_wqes(iwqp, IRDMA_FLUSH_SQ | 1417 IRDMA_FLUSH_RQ | 1418 IRDMA_FLUSH_WAIT); |
1419 iwqp->flush_issued = 1; |
|
1406 } else { 1407 spin_unlock_irqrestore(&iwqp->lock, flags); 1408 } 1409 } else { 1410 iwqp->ibqp_state = attr->qp_state; 1411 } 1412 if (udata && dev->hw_attrs.uk_attrs.hw_rev >= IRDMA_GEN_2) { 1413 struct irdma_ucontext *ucontext; --- 199 unchanged lines hidden (view full) --- 1613 iwqp->iwarp_state = info.next_iwarp_state; 1614 iwqp->ibqp_state = attr->qp_state; 1615 } 1616 spin_unlock_irqrestore(&iwqp->lock, flags); 1617 } 1618 1619 if (issue_modify_qp && iwqp->ibqp_state > IB_QPS_RTS) { 1620 if (dont_wait) { | 1420 } else { 1421 spin_unlock_irqrestore(&iwqp->lock, flags); 1422 } 1423 } else { 1424 iwqp->ibqp_state = attr->qp_state; 1425 } 1426 if (udata && dev->hw_attrs.uk_attrs.hw_rev >= IRDMA_GEN_2) { 1427 struct irdma_ucontext *ucontext; --- 199 unchanged lines hidden (view full) --- 1627 iwqp->iwarp_state = info.next_iwarp_state; 1628 iwqp->ibqp_state = attr->qp_state; 1629 } 1630 spin_unlock_irqrestore(&iwqp->lock, flags); 1631 } 1632 1633 if (issue_modify_qp && iwqp->ibqp_state > IB_QPS_RTS) { 1634 if (dont_wait) { |
1621 if (iwqp->hw_tcp_state) { | 1635 if (iwqp->cm_id && iwqp->hw_tcp_state) { |
1622 spin_lock_irqsave(&iwqp->lock, flags); 1623 iwqp->hw_tcp_state = IRDMA_TCP_STATE_CLOSED; 1624 iwqp->last_aeq = IRDMA_AE_RESET_SENT; 1625 spin_unlock_irqrestore(&iwqp->lock, flags); | 1636 spin_lock_irqsave(&iwqp->lock, flags); 1637 iwqp->hw_tcp_state = IRDMA_TCP_STATE_CLOSED; 1638 iwqp->last_aeq = IRDMA_AE_RESET_SENT; 1639 spin_unlock_irqrestore(&iwqp->lock, flags); |
1640 irdma_cm_disconn(iwqp); |
|
1626 } | 1641 } |
1627 irdma_cm_disconn(iwqp); | |
1628 } else { 1629 int close_timer_started; 1630 1631 spin_lock_irqsave(&iwdev->cm_core.ht_lock, flags); 1632 1633 if (iwqp->cm_node) { 1634 refcount_inc(&iwqp->cm_node->refcnt); 1635 spin_unlock_irqrestore(&iwdev->cm_core.ht_lock, flags); --- 114 unchanged lines hidden (view full) --- 1750 struct irdma_cq *iwcq = to_iwcq(ib_cq); 1751 struct irdma_sc_cq *cq = &iwcq->sc_cq; 1752 struct irdma_sc_dev *dev = cq->dev; 1753 struct irdma_sc_ceq *ceq = dev->ceq[cq->ceq_id]; 1754 struct irdma_ceq *iwceq = container_of(ceq, struct irdma_ceq, sc_ceq); 1755 unsigned long flags; 1756 1757 spin_lock_irqsave(&iwcq->lock, flags); | 1642 } else { 1643 int close_timer_started; 1644 1645 spin_lock_irqsave(&iwdev->cm_core.ht_lock, flags); 1646 1647 if (iwqp->cm_node) { 1648 refcount_inc(&iwqp->cm_node->refcnt); 1649 spin_unlock_irqrestore(&iwdev->cm_core.ht_lock, flags); --- 114 unchanged lines hidden (view full) --- 1764 struct irdma_cq *iwcq = to_iwcq(ib_cq); 1765 struct irdma_sc_cq *cq = &iwcq->sc_cq; 1766 struct irdma_sc_dev *dev = cq->dev; 1767 struct irdma_sc_ceq *ceq = dev->ceq[cq->ceq_id]; 1768 struct irdma_ceq *iwceq = container_of(ceq, struct irdma_ceq, sc_ceq); 1769 unsigned long flags; 1770 1771 spin_lock_irqsave(&iwcq->lock, flags); |
1772 if (!list_empty(&iwcq->cmpl_generated)) 1773 irdma_remove_cmpls_list(iwcq); |
|
1758 if (!list_empty(&iwcq->resize_list)) 1759 irdma_process_resize_list(iwcq, iwdev, NULL); 1760 spin_unlock_irqrestore(&iwcq->lock, flags); 1761 1762 irdma_cq_wq_destroy(iwdev->rf, cq); 1763 irdma_cq_free_rsrc(iwdev->rf, iwcq); 1764 1765 spin_lock_irqsave(&iwceq->ce_lock, flags); --- 188 unchanged lines hidden (view full) --- 1954 &rf->next_cq); 1955 if (err_code) 1956 return err_code; 1957 1958 cq = &iwcq->sc_cq; 1959 cq->back_cq = iwcq; 1960 spin_lock_init(&iwcq->lock); 1961 INIT_LIST_HEAD(&iwcq->resize_list); | 1774 if (!list_empty(&iwcq->resize_list)) 1775 irdma_process_resize_list(iwcq, iwdev, NULL); 1776 spin_unlock_irqrestore(&iwcq->lock, flags); 1777 1778 irdma_cq_wq_destroy(iwdev->rf, cq); 1779 irdma_cq_free_rsrc(iwdev->rf, iwcq); 1780 1781 spin_lock_irqsave(&iwceq->ce_lock, flags); --- 188 unchanged lines hidden (view full) --- 1970 &rf->next_cq); 1971 if (err_code) 1972 return err_code; 1973 1974 cq = &iwcq->sc_cq; 1975 cq->back_cq = iwcq; 1976 spin_lock_init(&iwcq->lock); 1977 INIT_LIST_HEAD(&iwcq->resize_list); |
1978 INIT_LIST_HEAD(&iwcq->cmpl_generated); |
|
1962 info.dev = dev; 1963 ukinfo->cq_size = max(entries, 4); 1964 ukinfo->cq_id = cq_num; 1965 iwcq->ibcq.cqe = info.cq_uk_init_info.cq_size; 1966 if (attr->comp_vector < rf->ceqs_count) 1967 info.ceq_id = attr->comp_vector; 1968 info.ceq_id_valid = true; 1969 info.ceqe_mask = 1; --- 1069 unchanged lines hidden (view full) --- 3039 struct irdma_qp *iwqp; 3040 struct irdma_qp_uk *ukqp; 3041 struct irdma_sc_dev *dev; 3042 struct irdma_post_sq_info info; 3043 int err = 0; 3044 unsigned long flags; 3045 bool inv_stag; 3046 struct irdma_ah *ah; | 1979 info.dev = dev; 1980 ukinfo->cq_size = max(entries, 4); 1981 ukinfo->cq_id = cq_num; 1982 iwcq->ibcq.cqe = info.cq_uk_init_info.cq_size; 1983 if (attr->comp_vector < rf->ceqs_count) 1984 info.ceq_id = attr->comp_vector; 1985 info.ceq_id_valid = true; 1986 info.ceqe_mask = 1; --- 1069 unchanged lines hidden (view full) --- 3056 struct irdma_qp *iwqp; 3057 struct irdma_qp_uk *ukqp; 3058 struct irdma_sc_dev *dev; 3059 struct irdma_post_sq_info info; 3060 int err = 0; 3061 unsigned long flags; 3062 bool inv_stag; 3063 struct irdma_ah *ah; |
3047 bool reflush = false; | |
3048 3049 iwqp = to_iwqp(ibqp); 3050 ukqp = &iwqp->sc_qp.qp_uk; 3051 dev = &iwqp->iwdev->rf->sc_dev; 3052 3053 spin_lock_irqsave(&iwqp->lock, flags); | 3064 3065 iwqp = to_iwqp(ibqp); 3066 ukqp = &iwqp->sc_qp.qp_uk; 3067 dev = &iwqp->iwdev->rf->sc_dev; 3068 3069 spin_lock_irqsave(&iwqp->lock, flags); |
3054 if (iwqp->flush_issued && ukqp->sq_flush_complete) 3055 reflush = true; | |
3056 while (ib_wr) { 3057 memset(&info, 0, sizeof(info)); 3058 inv_stag = false; 3059 info.wr_id = (ib_wr->wr_id); 3060 if ((ib_wr->send_flags & IB_SEND_SIGNALED) || iwqp->sig_all) 3061 info.signaled = true; 3062 if (ib_wr->send_flags & IB_SEND_FENCE) 3063 info.read_fence = true; --- 133 unchanged lines hidden (view full) --- 3197 break; 3198 } 3199 3200 if (err) 3201 break; 3202 ib_wr = ib_wr->next; 3203 } 3204 | 3070 while (ib_wr) { 3071 memset(&info, 0, sizeof(info)); 3072 inv_stag = false; 3073 info.wr_id = (ib_wr->wr_id); 3074 if ((ib_wr->send_flags & IB_SEND_SIGNALED) || iwqp->sig_all) 3075 info.signaled = true; 3076 if (ib_wr->send_flags & IB_SEND_FENCE) 3077 info.read_fence = true; --- 133 unchanged lines hidden (view full) --- 3211 break; 3212 } 3213 3214 if (err) 3215 break; 3216 ib_wr = ib_wr->next; 3217 } 3218 |
3205 if (!iwqp->flush_issued && iwqp->hw_iwarp_state <= IRDMA_QP_STATE_RTS) { 3206 irdma_uk_qp_post_wr(ukqp); | 3219 if (!iwqp->flush_issued) { 3220 if (iwqp->hw_iwarp_state <= IRDMA_QP_STATE_RTS) 3221 irdma_uk_qp_post_wr(ukqp); |
3207 spin_unlock_irqrestore(&iwqp->lock, flags); | 3222 spin_unlock_irqrestore(&iwqp->lock, flags); |
3208 } else if (reflush) { 3209 ukqp->sq_flush_complete = false; 3210 spin_unlock_irqrestore(&iwqp->lock, flags); 3211 irdma_flush_wqes(iwqp, IRDMA_FLUSH_SQ | IRDMA_REFLUSH); | |
3212 } else { 3213 spin_unlock_irqrestore(&iwqp->lock, flags); | 3223 } else { 3224 spin_unlock_irqrestore(&iwqp->lock, flags); |
3225 mod_delayed_work(iwqp->iwdev->cleanup_wq, &iwqp->dwork_flush, 3226 msecs_to_jiffies(IRDMA_FLUSH_DELAY_MS)); |
|
3214 } 3215 if (err) 3216 *bad_wr = ib_wr; 3217 3218 return err; 3219} 3220 3221/** --- 6 unchanged lines hidden (view full) --- 3228 const struct ib_recv_wr *ib_wr, 3229 const struct ib_recv_wr **bad_wr) 3230{ 3231 struct irdma_qp *iwqp; 3232 struct irdma_qp_uk *ukqp; 3233 struct irdma_post_rq_info post_recv = {}; 3234 unsigned long flags; 3235 int err = 0; | 3227 } 3228 if (err) 3229 *bad_wr = ib_wr; 3230 3231 return err; 3232} 3233 3234/** --- 6 unchanged lines hidden (view full) --- 3241 const struct ib_recv_wr *ib_wr, 3242 const struct ib_recv_wr **bad_wr) 3243{ 3244 struct irdma_qp *iwqp; 3245 struct irdma_qp_uk *ukqp; 3246 struct irdma_post_rq_info post_recv = {}; 3247 unsigned long flags; 3248 int err = 0; |
3236 bool reflush = false; | |
3237 3238 iwqp = to_iwqp(ibqp); 3239 ukqp = &iwqp->sc_qp.qp_uk; 3240 3241 spin_lock_irqsave(&iwqp->lock, flags); | 3249 3250 iwqp = to_iwqp(ibqp); 3251 ukqp = &iwqp->sc_qp.qp_uk; 3252 3253 spin_lock_irqsave(&iwqp->lock, flags); |
3242 if (iwqp->flush_issued && ukqp->rq_flush_complete) 3243 reflush = true; | |
3244 while (ib_wr) { 3245 post_recv.num_sges = ib_wr->num_sge; 3246 post_recv.wr_id = ib_wr->wr_id; 3247 post_recv.sg_list = ib_wr->sg_list; 3248 err = irdma_uk_post_receive(ukqp, &post_recv); 3249 if (err) { 3250 ibdev_dbg(&iwqp->iwdev->ibdev, 3251 "VERBS: post_recv err %d\n", err); 3252 goto out; 3253 } 3254 3255 ib_wr = ib_wr->next; 3256 } 3257 3258out: | 3254 while (ib_wr) { 3255 post_recv.num_sges = ib_wr->num_sge; 3256 post_recv.wr_id = ib_wr->wr_id; 3257 post_recv.sg_list = ib_wr->sg_list; 3258 err = irdma_uk_post_receive(ukqp, &post_recv); 3259 if (err) { 3260 ibdev_dbg(&iwqp->iwdev->ibdev, 3261 "VERBS: post_recv err %d\n", err); 3262 goto out; 3263 } 3264 3265 ib_wr = ib_wr->next; 3266 } 3267 3268out: |
3259 if (reflush) { 3260 ukqp->rq_flush_complete = false; 3261 spin_unlock_irqrestore(&iwqp->lock, flags); 3262 irdma_flush_wqes(iwqp, IRDMA_FLUSH_RQ | IRDMA_REFLUSH); 3263 } else { 3264 spin_unlock_irqrestore(&iwqp->lock, flags); 3265 } | 3269 spin_unlock_irqrestore(&iwqp->lock, flags); 3270 if (iwqp->flush_issued) 3271 mod_delayed_work(iwqp->iwdev->cleanup_wq, &iwqp->dwork_flush, 3272 msecs_to_jiffies(IRDMA_FLUSH_DELAY_MS)); |
3266 3267 if (err) 3268 *bad_wr = ib_wr; 3269 3270 return err; 3271} 3272 3273/** --- 195 unchanged lines hidden (view full) --- 3469 if (cq_new_cqe) 3470 last_buf = cq_buf; 3471 cq_new_cqe = false; 3472 } 3473 3474 /* check the current CQ for new cqes */ 3475 while (npolled < num_entries) { 3476 ret = irdma_poll_one(ukcq, cur_cqe, entry + npolled); | 3273 3274 if (err) 3275 *bad_wr = ib_wr; 3276 3277 return err; 3278} 3279 3280/** --- 195 unchanged lines hidden (view full) --- 3476 if (cq_new_cqe) 3477 last_buf = cq_buf; 3478 cq_new_cqe = false; 3479 } 3480 3481 /* check the current CQ for new cqes */ 3482 while (npolled < num_entries) { 3483 ret = irdma_poll_one(ukcq, cur_cqe, entry + npolled); |
3484 if (ret == -ENOENT) { 3485 ret = irdma_generated_cmpls(iwcq, cur_cqe); 3486 if (!ret) 3487 irdma_process_cqe(entry + npolled, cur_cqe); 3488 } |
|
3477 if (!ret) { 3478 ++npolled; 3479 cq_new_cqe = true; 3480 continue; 3481 } 3482 3483 if (ret == -ENOENT) 3484 break; --- 65 unchanged lines hidden (view full) --- 3550 iwcq = to_iwcq(ibcq); 3551 ukcq = &iwcq->sc_cq.cq_uk; 3552 3553 spin_lock_irqsave(&iwcq->lock, flags); 3554 /* Only promote to arm the CQ for any event if the last arm event was solicited. */ 3555 if (iwcq->last_notify == IRDMA_CQ_COMPL_SOLICITED && notify_flags != IB_CQ_SOLICITED) 3556 promo_event = true; 3557 | 3489 if (!ret) { 3490 ++npolled; 3491 cq_new_cqe = true; 3492 continue; 3493 } 3494 3495 if (ret == -ENOENT) 3496 break; --- 65 unchanged lines hidden (view full) --- 3562 iwcq = to_iwcq(ibcq); 3563 ukcq = &iwcq->sc_cq.cq_uk; 3564 3565 spin_lock_irqsave(&iwcq->lock, flags); 3566 /* Only promote to arm the CQ for any event if the last arm event was solicited. */ 3567 if (iwcq->last_notify == IRDMA_CQ_COMPL_SOLICITED && notify_flags != IB_CQ_SOLICITED) 3568 promo_event = true; 3569 |
3558 if (!iwcq->armed || promo_event) { 3559 iwcq->armed = true; | 3570 if (!atomic_cmpxchg(&iwcq->armed, 0, 1) || promo_event) { |
3560 iwcq->last_notify = cq_notify; 3561 irdma_uk_cq_request_notification(ukcq, cq_notify); 3562 } 3563 | 3571 iwcq->last_notify = cq_notify; 3572 irdma_uk_cq_request_notification(ukcq, cq_notify); 3573 } 3574 |
3564 if ((notify_flags & IB_CQ_REPORT_MISSED_EVENTS) && !irdma_cq_empty(iwcq)) | 3575 if ((notify_flags & IB_CQ_REPORT_MISSED_EVENTS) && 3576 (!irdma_cq_empty(iwcq) || !list_empty(&iwcq->cmpl_generated))) |
3565 ret = 1; 3566 spin_unlock_irqrestore(&iwcq->lock, flags); 3567 3568 return ret; 3569} 3570 3571static int irdma_roce_port_immutable(struct ib_device *ibdev, u32 port_num, 3572 struct ib_port_immutable *immutable) --- 989 unchanged lines hidden --- | 3577 ret = 1; 3578 spin_unlock_irqrestore(&iwcq->lock, flags); 3579 3580 return ret; 3581} 3582 3583static int irdma_roce_port_immutable(struct ib_device *ibdev, u32 port_num, 3584 struct ib_port_immutable *immutable) --- 989 unchanged lines hidden --- |