Lines Matching refs:qp

348 	struct ib_qp *qp = context;
350 list_for_each_entry(event->element.qp, &qp->open_list, open_list)
351 event->element.qp->event_handler(event, event->element.qp->qp_context);
354 static void __ib_insert_xrcd_qp(struct ib_xrcd *xrcd, struct ib_qp *qp)
357 list_add(&qp->xrcd_list, &xrcd->tgt_qp_list);
365 struct ib_qp *qp;
368 qp = kzalloc(sizeof *qp, GFP_KERNEL);
369 if (!qp)
372 qp->real_qp = real_qp;
374 qp->device = real_qp->device;
375 qp->event_handler = event_handler;
376 qp->qp_context = qp_context;
377 qp->qp_num = real_qp->qp_num;
378 qp->qp_type = real_qp->qp_type;
381 list_add(&qp->open_list, &real_qp->open_list);
384 return qp;
390 struct ib_qp *qp, *real_qp;
395 qp = ERR_PTR(-EINVAL);
399 qp = __ib_open_qp(real_qp, qp_open_attr->event_handler,
405 return qp;
412 struct ib_qp *qp, *real_qp;
416 qp = device->create_qp(pd, qp_init_attr, NULL);
418 if (!IS_ERR(qp)) {
419 qp->device = device;
420 qp->real_qp = qp;
421 qp->uobject = NULL;
422 qp->qp_type = qp_init_attr->qp_type;
424 atomic_set(&qp->usecnt, 0);
426 qp->event_handler = __ib_shared_qp_event_handler;
427 qp->qp_context = qp;
428 qp->pd = NULL;
429 qp->send_cq = qp->recv_cq = NULL;
430 qp->srq = NULL;
431 qp->xrcd = qp_init_attr->xrcd;
433 INIT_LIST_HEAD(&qp->open_list);
435 real_qp = qp;
436 qp = __ib_open_qp(real_qp, qp_init_attr->event_handler,
438 if (!IS_ERR(qp))
443 qp->event_handler = qp_init_attr->event_handler;
444 qp->qp_context = qp_init_attr->qp_context;
446 qp->recv_cq = NULL;
447 qp->srq = NULL;
449 qp->recv_cq = qp_init_attr->recv_cq;
451 qp->srq = qp_init_attr->srq;
452 if (qp->srq)
456 qp->pd = pd;
457 qp->send_cq = qp_init_attr->send_cq;
458 qp->xrcd = NULL;
465 return qp;
803 int ib_modify_qp(struct ib_qp *qp,
807 return qp->device->modify_qp(qp->real_qp, qp_attr, qp_attr_mask, NULL);
811 int ib_query_qp(struct ib_qp *qp,
816 return qp->device->query_qp ?
817 qp->device->query_qp(qp->real_qp, qp_attr, qp_attr_mask, qp_init_attr) :
822 int ib_close_qp(struct ib_qp *qp)
827 real_qp = qp->real_qp;
828 if (real_qp == qp)
832 list_del(&qp->open_list);
836 kfree(qp);
842 static int __ib_destroy_shared_qp(struct ib_qp *qp)
848 real_qp = qp->real_qp;
852 ib_close_qp(qp);
870 int ib_destroy_qp(struct ib_qp *qp)
877 if (atomic_read(&qp->usecnt))
880 if (qp->real_qp != qp)
881 return __ib_destroy_shared_qp(qp);
883 pd = qp->pd;
884 scq = qp->send_cq;
885 rcq = qp->recv_cq;
886 srq = qp->srq;
888 ret = qp->device->destroy_qp(qp);
1184 int ib_attach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid)
1186 if (!qp->device->attach_mcast)
1188 if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD)
1191 return qp->device->attach_mcast(qp, gid, lid);
1195 int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid)
1197 if (!qp->device->detach_mcast)
1199 if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD)
1202 return qp->device->detach_mcast(qp, gid, lid);
1228 struct ib_qp *qp;
1235 qp = list_entry(xrcd->tgt_qp_list.next, struct ib_qp, xrcd_list);
1236 ret = ib_destroy_qp(qp);