2 * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
3 * Copyright (c) 2015 System Fabric Works, Inc. All rights reserved.
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34 #include <linux/skbuff.h>
35 #include <linux/delay.h>
36 #include <linux/sched.h>
37 #include <linux/vmalloc.h>
41 #include "rxe_queue.h"
44 char *rxe_qp_state_name[] = {
45 [QP_STATE_RESET] = "RESET",
46 [QP_STATE_INIT] = "INIT",
47 [QP_STATE_READY] = "READY",
48 [QP_STATE_DRAIN] = "DRAIN",
49 [QP_STATE_DRAINED] = "DRAINED",
50 [QP_STATE_ERROR] = "ERROR",
53 static int rxe_qp_chk_cap(struct rxe_dev *rxe, struct ib_qp_cap *cap,
56 if (cap->max_send_wr > rxe->attr.max_qp_wr) {
57 pr_warn("invalid send wr = %d > %d\n",
58 cap->max_send_wr, rxe->attr.max_qp_wr);
62 if (cap->max_send_sge > rxe->attr.max_sge) {
63 pr_warn("invalid send sge = %d > %d\n",
64 cap->max_send_sge, rxe->attr.max_sge);
69 if (cap->max_recv_wr > rxe->attr.max_qp_wr) {
70 pr_warn("invalid recv wr = %d > %d\n",
71 cap->max_recv_wr, rxe->attr.max_qp_wr);
75 if (cap->max_recv_sge > rxe->attr.max_sge) {
76 pr_warn("invalid recv sge = %d > %d\n",
77 cap->max_recv_sge, rxe->attr.max_sge);
82 if (cap->max_inline_data > rxe->max_inline_data) {
83 pr_warn("invalid max inline data = %d > %d\n",
84 cap->max_inline_data, rxe->max_inline_data);
94 int rxe_qp_chk_init(struct rxe_dev *rxe, struct ib_qp_init_attr *init)
96 struct ib_qp_cap *cap = &init->cap;
97 struct rxe_port *port;
98 int port_num = init->port_num;
100 if (!init->recv_cq || !init->send_cq) {
101 pr_warn("missing cq\n");
105 if (rxe_qp_chk_cap(rxe, cap, !!init->srq))
108 if (init->qp_type == IB_QPT_SMI || init->qp_type == IB_QPT_GSI) {
110 pr_warn("invalid port = %d\n", port_num);
116 if (init->qp_type == IB_QPT_SMI && port->qp_smi_index) {
117 pr_warn("SMI QP exists for port %d\n", port_num);
121 if (init->qp_type == IB_QPT_GSI && port->qp_gsi_index) {
122 pr_warn("GSI QP exists for port %d\n", port_num);
133 static int alloc_rd_atomic_resources(struct rxe_qp *qp, unsigned int n)
135 qp->resp.res_head = 0;
136 qp->resp.res_tail = 0;
137 qp->resp.resources = kcalloc(n, sizeof(struct resp_res), GFP_KERNEL);
139 if (!qp->resp.resources)
145 static void free_rd_atomic_resources(struct rxe_qp *qp)
147 if (qp->resp.resources) {
150 for (i = 0; i < qp->attr.max_dest_rd_atomic; i++) {
151 struct resp_res *res = &qp->resp.resources[i];
153 free_rd_atomic_resource(qp, res);
155 kfree(qp->resp.resources);
156 qp->resp.resources = NULL;
160 void free_rd_atomic_resource(struct rxe_qp *qp, struct resp_res *res)
162 if (res->type == RXE_ATOMIC_MASK) {
164 kfree_skb(res->atomic.skb);
165 } else if (res->type == RXE_READ_MASK) {
167 rxe_drop_ref(res->read.mr);
172 static void cleanup_rd_atomic_resources(struct rxe_qp *qp)
175 struct resp_res *res;
177 if (qp->resp.resources) {
178 for (i = 0; i < qp->attr.max_dest_rd_atomic; i++) {
179 res = &qp->resp.resources[i];
180 free_rd_atomic_resource(qp, res);
185 static void rxe_qp_init_misc(struct rxe_dev *rxe, struct rxe_qp *qp,
186 struct ib_qp_init_attr *init)
188 struct rxe_port *port;
191 qp->sq_sig_type = init->sq_sig_type;
192 qp->attr.path_mtu = 1;
193 qp->mtu = ib_mtu_enum_to_int(qp->attr.path_mtu);
195 qpn = qp->pelem.index;
198 switch (init->qp_type) {
201 port->qp_smi_index = qpn;
202 qp->attr.port_num = init->port_num;
207 port->qp_gsi_index = qpn;
208 qp->attr.port_num = init->port_num;
212 qp->ibqp.qp_num = qpn;
216 INIT_LIST_HEAD(&qp->grp_list);
218 skb_queue_head_init(&qp->send_pkts);
220 spin_lock_init(&qp->grp_lock);
221 spin_lock_init(&qp->state_lock);
223 atomic_set(&qp->ssn, 0);
224 atomic_set(&qp->skb_out, 0);
227 static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
228 struct ib_qp_init_attr *init,
229 struct ib_ucontext *context, struct ib_udata *udata)
234 err = sock_create_kern(&init_net, AF_INET, SOCK_DGRAM, 0, &qp->sk);
237 qp->sk->sk->sk_user_data = qp;
239 qp->sq.max_wr = init->cap.max_send_wr;
240 qp->sq.max_sge = init->cap.max_send_sge;
241 qp->sq.max_inline = init->cap.max_inline_data;
243 wqe_size = max_t(int, sizeof(struct rxe_send_wqe) +
244 qp->sq.max_sge * sizeof(struct ib_sge),
245 sizeof(struct rxe_send_wqe) +
248 qp->sq.queue = rxe_queue_init(rxe,
254 err = do_mmap_info(rxe, udata, true,
255 context, qp->sq.queue->buf,
256 qp->sq.queue->buf_size, &qp->sq.queue->ip);
259 vfree(qp->sq.queue->buf);
265 qp->req.wqe_index = producer_index(qp->sq.queue);
266 qp->req.state = QP_STATE_RESET;
268 qp->comp.opcode = -1;
270 spin_lock_init(&qp->sq.sq_lock);
271 skb_queue_head_init(&qp->req_pkts);
273 rxe_init_task(rxe, &qp->req.task, qp,
274 rxe_requester, "req");
275 rxe_init_task(rxe, &qp->comp.task, qp,
276 rxe_completer, "comp");
278 qp->qp_timeout_jiffies = 0; /* Can't be set for UD/UC in modify_qp */
279 if (init->qp_type == IB_QPT_RC) {
280 setup_timer(&qp->rnr_nak_timer, rnr_nak_timer, (unsigned long)qp);
281 setup_timer(&qp->retrans_timer, retransmit_timer, (unsigned long)qp);
286 static int rxe_qp_init_resp(struct rxe_dev *rxe, struct rxe_qp *qp,
287 struct ib_qp_init_attr *init,
288 struct ib_ucontext *context, struct ib_udata *udata)
294 qp->rq.max_wr = init->cap.max_recv_wr;
295 qp->rq.max_sge = init->cap.max_recv_sge;
297 wqe_size = rcv_wqe_size(qp->rq.max_sge);
299 pr_debug("qp#%d max_wr = %d, max_sge = %d, wqe_size = %d\n",
300 qp_num(qp), qp->rq.max_wr, qp->rq.max_sge, wqe_size);
302 qp->rq.queue = rxe_queue_init(rxe,
308 err = do_mmap_info(rxe, udata, false, context,
310 qp->rq.queue->buf_size,
313 vfree(qp->rq.queue->buf);
320 spin_lock_init(&qp->rq.producer_lock);
321 spin_lock_init(&qp->rq.consumer_lock);
323 skb_queue_head_init(&qp->resp_pkts);
325 rxe_init_task(rxe, &qp->resp.task, qp,
326 rxe_responder, "resp");
328 qp->resp.opcode = OPCODE_NONE;
330 qp->resp.state = QP_STATE_RESET;
335 /* called by the create qp verb */
336 int rxe_qp_from_init(struct rxe_dev *rxe, struct rxe_qp *qp, struct rxe_pd *pd,
337 struct ib_qp_init_attr *init, struct ib_udata *udata,
341 struct rxe_cq *rcq = to_rcq(init->recv_cq);
342 struct rxe_cq *scq = to_rcq(init->send_cq);
343 struct rxe_srq *srq = init->srq ? to_rsrq(init->srq) : NULL;
344 struct ib_ucontext *context = udata ? ibpd->uobject->context : NULL;
357 rxe_qp_init_misc(rxe, qp, init);
359 err = rxe_qp_init_req(rxe, qp, init, context, udata);
363 err = rxe_qp_init_resp(rxe, qp, init, context, udata);
367 qp->attr.qp_state = IB_QPS_RESET;
373 rxe_queue_cleanup(qp->sq.queue);
389 /* called by the query qp verb */
390 int rxe_qp_to_init(struct rxe_qp *qp, struct ib_qp_init_attr *init)
392 init->event_handler = qp->ibqp.event_handler;
393 init->qp_context = qp->ibqp.qp_context;
394 init->send_cq = qp->ibqp.send_cq;
395 init->recv_cq = qp->ibqp.recv_cq;
396 init->srq = qp->ibqp.srq;
398 init->cap.max_send_wr = qp->sq.max_wr;
399 init->cap.max_send_sge = qp->sq.max_sge;
400 init->cap.max_inline_data = qp->sq.max_inline;
403 init->cap.max_recv_wr = qp->rq.max_wr;
404 init->cap.max_recv_sge = qp->rq.max_sge;
407 init->sq_sig_type = qp->sq_sig_type;
409 init->qp_type = qp->ibqp.qp_type;
415 /* called by the modify qp verb, this routine checks all the parameters before
418 int rxe_qp_chk_attr(struct rxe_dev *rxe, struct rxe_qp *qp,
419 struct ib_qp_attr *attr, int mask)
421 enum ib_qp_state cur_state = (mask & IB_QP_CUR_STATE) ?
422 attr->cur_qp_state : qp->attr.qp_state;
423 enum ib_qp_state new_state = (mask & IB_QP_STATE) ?
424 attr->qp_state : cur_state;
426 if (!ib_modify_qp_is_ok(cur_state, new_state, qp_type(qp), mask,
427 IB_LINK_LAYER_ETHERNET)) {
428 pr_warn("invalid mask or state for qp\n");
432 if (mask & IB_QP_STATE) {
433 if (cur_state == IB_QPS_SQD) {
434 if (qp->req.state == QP_STATE_DRAIN &&
435 new_state != IB_QPS_ERR)
440 if (mask & IB_QP_PORT) {
441 if (attr->port_num != 1) {
442 pr_warn("invalid port %d\n", attr->port_num);
447 if (mask & IB_QP_CAP && rxe_qp_chk_cap(rxe, &attr->cap, !!qp->srq))
450 if (mask & IB_QP_AV && rxe_av_chk_attr(rxe, &attr->ah_attr))
453 if (mask & IB_QP_ALT_PATH) {
454 if (rxe_av_chk_attr(rxe, &attr->alt_ah_attr))
456 if (attr->alt_port_num != 1) {
457 pr_warn("invalid alt port %d\n", attr->alt_port_num);
460 if (attr->alt_timeout > 31) {
461 pr_warn("invalid QP alt timeout %d > 31\n",
467 if (mask & IB_QP_PATH_MTU) {
468 struct rxe_port *port = &rxe->port;
470 enum ib_mtu max_mtu = port->attr.max_mtu;
471 enum ib_mtu mtu = attr->path_mtu;
474 pr_debug("invalid mtu (%d) > (%d)\n",
475 ib_mtu_enum_to_int(mtu),
476 ib_mtu_enum_to_int(max_mtu));
481 if (mask & IB_QP_MAX_QP_RD_ATOMIC) {
482 if (attr->max_rd_atomic > rxe->attr.max_qp_rd_atom) {
483 pr_warn("invalid max_rd_atomic %d > %d\n",
485 rxe->attr.max_qp_rd_atom);
490 if (mask & IB_QP_TIMEOUT) {
491 if (attr->timeout > 31) {
492 pr_warn("invalid QP timeout %d > 31\n",
504 /* move the qp to the reset state */
505 static void rxe_qp_reset(struct rxe_qp *qp)
507 /* stop tasks from running */
508 rxe_disable_task(&qp->resp.task);
510 /* stop request/comp */
512 if (qp_type(qp) == IB_QPT_RC)
513 rxe_disable_task(&qp->comp.task);
514 rxe_disable_task(&qp->req.task);
517 /* move qp to the reset state */
518 qp->req.state = QP_STATE_RESET;
519 qp->resp.state = QP_STATE_RESET;
521 /* let state machines reset themselves drain work and packet queues
524 __rxe_do_task(&qp->resp.task);
527 __rxe_do_task(&qp->comp.task);
528 __rxe_do_task(&qp->req.task);
529 rxe_queue_reset(qp->sq.queue);
532 /* cleanup attributes */
533 atomic_set(&qp->ssn, 0);
535 qp->req.need_retry = 0;
536 qp->req.noack_pkts = 0;
538 qp->resp.opcode = -1;
539 qp->resp.drop_msg = 0;
540 qp->resp.goto_error = 0;
541 qp->resp.sent_psn_nak = 0;
544 rxe_drop_ref(qp->resp.mr);
548 cleanup_rd_atomic_resources(qp);
551 rxe_enable_task(&qp->resp.task);
554 if (qp_type(qp) == IB_QPT_RC)
555 rxe_enable_task(&qp->comp.task);
557 rxe_enable_task(&qp->req.task);
561 /* drain the send queue */
562 static void rxe_qp_drain(struct rxe_qp *qp)
565 if (qp->req.state != QP_STATE_DRAINED) {
566 qp->req.state = QP_STATE_DRAIN;
567 if (qp_type(qp) == IB_QPT_RC)
568 rxe_run_task(&qp->comp.task, 1);
570 __rxe_do_task(&qp->comp.task);
571 rxe_run_task(&qp->req.task, 1);
576 /* move the qp to the error state */
577 void rxe_qp_error(struct rxe_qp *qp)
579 qp->req.state = QP_STATE_ERROR;
580 qp->resp.state = QP_STATE_ERROR;
581 qp->attr.qp_state = IB_QPS_ERR;
583 /* drain work and packet queues */
584 rxe_run_task(&qp->resp.task, 1);
586 if (qp_type(qp) == IB_QPT_RC)
587 rxe_run_task(&qp->comp.task, 1);
589 __rxe_do_task(&qp->comp.task);
590 rxe_run_task(&qp->req.task, 1);
593 /* called by the modify qp verb */
594 int rxe_qp_from_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask,
595 struct ib_udata *udata)
598 struct rxe_dev *rxe = to_rdev(qp->ibqp.device);
600 struct ib_gid_attr sgid_attr;
602 if (mask & IB_QP_MAX_QP_RD_ATOMIC) {
603 int max_rd_atomic = attr->max_rd_atomic ?
604 roundup_pow_of_two(attr->max_rd_atomic) : 0;
606 qp->attr.max_rd_atomic = max_rd_atomic;
607 atomic_set(&qp->req.rd_atomic, max_rd_atomic);
610 if (mask & IB_QP_MAX_DEST_RD_ATOMIC) {
611 int max_dest_rd_atomic = attr->max_dest_rd_atomic ?
612 roundup_pow_of_two(attr->max_dest_rd_atomic) : 0;
614 qp->attr.max_dest_rd_atomic = max_dest_rd_atomic;
616 free_rd_atomic_resources(qp);
618 err = alloc_rd_atomic_resources(qp, max_dest_rd_atomic);
623 if (mask & IB_QP_CUR_STATE)
624 qp->attr.cur_qp_state = attr->qp_state;
626 if (mask & IB_QP_EN_SQD_ASYNC_NOTIFY)
627 qp->attr.en_sqd_async_notify = attr->en_sqd_async_notify;
629 if (mask & IB_QP_ACCESS_FLAGS)
630 qp->attr.qp_access_flags = attr->qp_access_flags;
632 if (mask & IB_QP_PKEY_INDEX)
633 qp->attr.pkey_index = attr->pkey_index;
635 if (mask & IB_QP_PORT)
636 qp->attr.port_num = attr->port_num;
638 if (mask & IB_QP_QKEY)
639 qp->attr.qkey = attr->qkey;
641 if (mask & IB_QP_AV) {
642 ib_get_cached_gid(&rxe->ib_dev, 1,
643 rdma_ah_read_grh(&attr->ah_attr)->sgid_index,
645 rxe_av_from_attr(rxe, attr->port_num, &qp->pri_av,
647 rxe_av_fill_ip_info(rxe, &qp->pri_av, &attr->ah_attr,
650 dev_put(sgid_attr.ndev);
653 if (mask & IB_QP_ALT_PATH) {
655 rdma_ah_read_grh(&attr->alt_ah_attr)->sgid_index;
657 ib_get_cached_gid(&rxe->ib_dev, 1, sgid_index,
660 rxe_av_from_attr(rxe, attr->alt_port_num, &qp->alt_av,
662 rxe_av_fill_ip_info(rxe, &qp->alt_av, &attr->alt_ah_attr,
665 dev_put(sgid_attr.ndev);
667 qp->attr.alt_port_num = attr->alt_port_num;
668 qp->attr.alt_pkey_index = attr->alt_pkey_index;
669 qp->attr.alt_timeout = attr->alt_timeout;
672 if (mask & IB_QP_PATH_MTU) {
673 qp->attr.path_mtu = attr->path_mtu;
674 qp->mtu = ib_mtu_enum_to_int(attr->path_mtu);
677 if (mask & IB_QP_TIMEOUT) {
678 qp->attr.timeout = attr->timeout;
679 if (attr->timeout == 0) {
680 qp->qp_timeout_jiffies = 0;
682 /* According to the spec, timeout = 4.096 * 2 ^ attr->timeout [us] */
683 int j = nsecs_to_jiffies(4096ULL << attr->timeout);
685 qp->qp_timeout_jiffies = j ? j : 1;
689 if (mask & IB_QP_RETRY_CNT) {
690 qp->attr.retry_cnt = attr->retry_cnt;
691 qp->comp.retry_cnt = attr->retry_cnt;
692 pr_debug("qp#%d set retry count = %d\n", qp_num(qp),
696 if (mask & IB_QP_RNR_RETRY) {
697 qp->attr.rnr_retry = attr->rnr_retry;
698 qp->comp.rnr_retry = attr->rnr_retry;
699 pr_debug("qp#%d set rnr retry count = %d\n", qp_num(qp),
703 if (mask & IB_QP_RQ_PSN) {
704 qp->attr.rq_psn = (attr->rq_psn & BTH_PSN_MASK);
705 qp->resp.psn = qp->attr.rq_psn;
706 pr_debug("qp#%d set resp psn = 0x%x\n", qp_num(qp),
710 if (mask & IB_QP_MIN_RNR_TIMER) {
711 qp->attr.min_rnr_timer = attr->min_rnr_timer;
712 pr_debug("qp#%d set min rnr timer = 0x%x\n", qp_num(qp),
713 attr->min_rnr_timer);
716 if (mask & IB_QP_SQ_PSN) {
717 qp->attr.sq_psn = (attr->sq_psn & BTH_PSN_MASK);
718 qp->req.psn = qp->attr.sq_psn;
719 qp->comp.psn = qp->attr.sq_psn;
720 pr_debug("qp#%d set req psn = 0x%x\n", qp_num(qp), qp->req.psn);
723 if (mask & IB_QP_PATH_MIG_STATE)
724 qp->attr.path_mig_state = attr->path_mig_state;
726 if (mask & IB_QP_DEST_QPN)
727 qp->attr.dest_qp_num = attr->dest_qp_num;
729 if (mask & IB_QP_STATE) {
730 qp->attr.qp_state = attr->qp_state;
732 switch (attr->qp_state) {
734 pr_debug("qp#%d state -> RESET\n", qp_num(qp));
739 pr_debug("qp#%d state -> INIT\n", qp_num(qp));
740 qp->req.state = QP_STATE_INIT;
741 qp->resp.state = QP_STATE_INIT;
745 pr_debug("qp#%d state -> RTR\n", qp_num(qp));
746 qp->resp.state = QP_STATE_READY;
750 pr_debug("qp#%d state -> RTS\n", qp_num(qp));
751 qp->req.state = QP_STATE_READY;
755 pr_debug("qp#%d state -> SQD\n", qp_num(qp));
760 pr_warn("qp#%d state -> SQE !!?\n", qp_num(qp));
761 /* Not possible from modify_qp. */
765 pr_debug("qp#%d state -> ERR\n", qp_num(qp));
774 /* called by the query qp verb */
775 int rxe_qp_to_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask)
777 struct rxe_dev *rxe = to_rdev(qp->ibqp.device);
781 attr->rq_psn = qp->resp.psn;
782 attr->sq_psn = qp->req.psn;
784 attr->cap.max_send_wr = qp->sq.max_wr;
785 attr->cap.max_send_sge = qp->sq.max_sge;
786 attr->cap.max_inline_data = qp->sq.max_inline;
789 attr->cap.max_recv_wr = qp->rq.max_wr;
790 attr->cap.max_recv_sge = qp->rq.max_sge;
793 rxe_av_to_attr(rxe, &qp->pri_av, &attr->ah_attr);
794 rxe_av_to_attr(rxe, &qp->alt_av, &attr->alt_ah_attr);
796 if (qp->req.state == QP_STATE_DRAIN) {
797 attr->sq_draining = 1;
798 /* applications that get this state
799 * typically spin on it. yield the
804 attr->sq_draining = 0;
807 pr_debug("attr->sq_draining = %d\n", attr->sq_draining);
812 /* called by the destroy qp verb */
813 void rxe_qp_destroy(struct rxe_qp *qp)
816 qp->qp_timeout_jiffies = 0;
817 rxe_cleanup_task(&qp->resp.task);
819 if (qp_type(qp) == IB_QPT_RC) {
820 del_timer_sync(&qp->retrans_timer);
821 del_timer_sync(&qp->rnr_nak_timer);
824 rxe_cleanup_task(&qp->req.task);
825 rxe_cleanup_task(&qp->comp.task);
827 /* flush out any receive wr's or pending requests */
828 __rxe_do_task(&qp->req.task);
830 __rxe_do_task(&qp->comp.task);
831 __rxe_do_task(&qp->req.task);
835 /* called when the last reference to the qp is dropped */
836 static void rxe_qp_do_cleanup(struct work_struct *work)
838 struct rxe_qp *qp = container_of(work, typeof(*qp), cleanup_work.work);
840 rxe_drop_all_mcast_groups(qp);
843 rxe_queue_cleanup(qp->sq.queue);
846 rxe_drop_ref(qp->srq);
849 rxe_queue_cleanup(qp->rq.queue);
852 rxe_drop_ref(qp->scq);
854 rxe_drop_ref(qp->rcq);
856 rxe_drop_ref(qp->pd);
859 rxe_drop_ref(qp->resp.mr);
863 if (qp_type(qp) == IB_QPT_RC)
864 sk_dst_reset(qp->sk->sk);
866 free_rd_atomic_resources(qp);
868 kernel_sock_shutdown(qp->sk, SHUT_RDWR);
869 sock_release(qp->sk);
872 /* called when the last reference to the qp is dropped */
873 void rxe_qp_cleanup(struct rxe_pool_entry *arg)
875 struct rxe_qp *qp = container_of(arg, typeof(*qp), pelem);
877 execute_in_process_context(rxe_qp_do_cleanup, &qp->cleanup_work);