verbs.c (448cc2fb3a7b327823a9afd374808c37b8e6194f) | verbs.c (10467ce09fefa2e74359f5b2ab1efb8909402f19) |
---|---|
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 --- 3570 unchanged lines hidden (view full) --- 3579 * @notify_flags: notofication flags 3580 */ 3581static int irdma_req_notify_cq(struct ib_cq *ibcq, 3582 enum ib_cq_notify_flags notify_flags) 3583{ 3584 struct irdma_cq *iwcq; 3585 struct irdma_cq_uk *ukcq; 3586 unsigned long flags; | 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 --- 3570 unchanged lines hidden (view full) --- 3579 * @notify_flags: notofication flags 3580 */ 3581static int irdma_req_notify_cq(struct ib_cq *ibcq, 3582 enum ib_cq_notify_flags notify_flags) 3583{ 3584 struct irdma_cq *iwcq; 3585 struct irdma_cq_uk *ukcq; 3586 unsigned long flags; |
3587 enum irdma_cmpl_notify cq_notify = IRDMA_CQ_COMPL_EVENT; | 3587 enum irdma_cmpl_notify cq_notify; 3588 bool promo_event = false; 3589 int ret = 0; |
3588 | 3590 |
3591 cq_notify = notify_flags == IB_CQ_SOLICITED ? 3592 IRDMA_CQ_COMPL_SOLICITED : IRDMA_CQ_COMPL_EVENT; |
|
3589 iwcq = to_iwcq(ibcq); 3590 ukcq = &iwcq->sc_cq.cq_uk; | 3593 iwcq = to_iwcq(ibcq); 3594 ukcq = &iwcq->sc_cq.cq_uk; |
3591 if (notify_flags == IB_CQ_SOLICITED) 3592 cq_notify = IRDMA_CQ_COMPL_SOLICITED; | |
3593 3594 spin_lock_irqsave(&iwcq->lock, flags); | 3595 3596 spin_lock_irqsave(&iwcq->lock, flags); |
3595 irdma_uk_cq_request_notification(ukcq, cq_notify); | 3597 /* Only promote to arm the CQ for any event if the last arm event was solicited. */ 3598 if (iwcq->last_notify == IRDMA_CQ_COMPL_SOLICITED && notify_flags != IB_CQ_SOLICITED) 3599 promo_event = true; 3600 3601 if (!iwcq->armed || promo_event) { 3602 iwcq->armed = true; 3603 iwcq->last_notify = cq_notify; 3604 irdma_uk_cq_request_notification(ukcq, cq_notify); 3605 } 3606 3607 if ((notify_flags & IB_CQ_REPORT_MISSED_EVENTS) && !irdma_cq_empty(iwcq)) 3608 ret = 1; |
3596 spin_unlock_irqrestore(&iwcq->lock, flags); 3597 | 3609 spin_unlock_irqrestore(&iwcq->lock, flags); 3610 |
3598 return 0; | 3611 return ret; |
3599} 3600 3601static int irdma_roce_port_immutable(struct ib_device *ibdev, u32 port_num, 3602 struct ib_port_immutable *immutable) 3603{ 3604 struct ib_port_attr attr; 3605 int err; 3606 --- 918 unchanged lines hidden --- | 3612} 3613 3614static int irdma_roce_port_immutable(struct ib_device *ibdev, u32 port_num, 3615 struct ib_port_immutable *immutable) 3616{ 3617 struct ib_port_attr attr; 3618 int err; 3619 --- 918 unchanged lines hidden --- |