40#include <linux/slab.h>
47 enum ib_event_type ib_event)
49 struct ib_event event;
56 "qp state %d qpid 0x%x status 0x%x", __func__,
61 printf(
"AE qpid 0x%x opcode %d status 0x%x "
62 "type %d wrid.hi 0x%x wrid.lo 0x%x\n",
73 event.event = ib_event;
74 event.device = chp->
ibcq.device;
75 if (ib_event == IB_EVENT_CQ_ERR)
76 event.element.cq = &chp->
ibcq;
78 event.element.qp = &qhp->
ibqp;
79 if (qhp->
ibqp.event_handler)
80 (*qhp->
ibqp.event_handler)(&event, qhp->
ibqp.qp_context);
83 (*chp->
ibcq.comp_handler)(&chp->
ibcq, chp->
ibcq.cq_context);
93 spin_lock_irq(&dev->
lock);
96 printf(
"BAD AE qpid 0x%x opcode %d "
97 "status 0x%x type %d wrid.hi 0x%x wrid.lo 0x%x\n",
102 spin_unlock_irq(&dev->
lock);
112 printf(
"BAD AE cqid 0x%x qpid 0x%x opcode %d "
113 "status 0x%x type %d wrid.hi 0x%x wrid.lo 0x%x\n",
118 spin_unlock_irq(&dev->
lock);
124 spin_unlock_irq(&dev->
lock);
129 post_qp_event(dev, chp, qhp, err_cqe, IB_EVENT_QP_REQ_ERR);
137 printf(KERN_ERR
MOD "AE with status 0!\n");
148 post_qp_event(dev, chp, qhp, err_cqe, IB_EVENT_QP_ACCESS_ERR);
155 post_qp_event(dev, chp, qhp, err_cqe, IB_EVENT_DEVICE_FATAL);
175 post_qp_event(dev, chp, qhp, err_cqe, IB_EVENT_QP_FATAL);
179 printf(
"Unknown T4 status 0x%x QPID 0x%x\n",
181 post_qp_event(dev, chp, qhp, err_cqe, IB_EVENT_QP_FATAL);
185 if (atomic_dec_and_test(&chp->
refcnt))
199 spin_lock_irqsave(&dev->
lock, flag);
203 spin_unlock_irqrestore(&dev->
lock, flag);
206 (*chp->
ibcq.comp_handler)(&chp->
ibcq, chp->
ibcq.cq_context);
208 if (atomic_dec_and_test(&chp->
refcnt))
211 CTR2(
KTR_IW_CXGBE,
"%s unknown cqid 0x%x", __func__, qid);
212 spin_unlock_irqrestore(&dev->
lock, flag);
int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_qp *qhp, enum c4iw_qp_attr_mask mask, struct c4iw_qp_attributes *attrs, int internal)
static struct c4iw_qp * get_qhp(struct c4iw_dev *rhp, u32 qpid)
static struct c4iw_cq * get_chp(struct c4iw_dev *rhp, u32 cqid)
int c4iw_ev_handler(struct sge_iq *, const struct rsp_ctrl *)
void c4iw_qp_rem_ref(struct ib_qp *qp)
@ C4IW_QP_STATE_TERMINATE
void c4iw_ev_dispatch(struct c4iw_dev *dev, struct t4_cqe *err_cqe)
@ C4IW_QP_ATTR_NEXT_STATE
void c4iw_qp_add_ref(struct ib_qp *qp)
spinlock_t comp_handler_lock
struct c4iw_qp_attributes attr
#define T4_ERR_RQE_ADDR_BOUND
#define T4_ERR_IRD_OVERFLOW
#define T4_ERR_OUT_OF_RQE
#define T4_ERR_PDU_LEN_ERR
#define T4_ERR_DDP_VERSION
#define T4_ERR_INTERNAL_ERR
#define T4_ERR_DDP_QUEUE_NUM
#define T4_ERR_INVALIDATE_SHARED_MR
#define T4_ERR_INVALIDATE_MR_WITH_MW_BOUND
#define T4_ERR_RDMA_VERSION
#define T4_ERR_PBL_ADDR_BOUND