aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorSean Hefty <sean.hefty@intel.com>2011-08-08 18:31:51 -0400
committerRoland Dreier <roland@purestorage.com>2011-10-13 12:49:51 -0400
commit0e0ec7e0638ef48e0c661873dfcc8caccab984c6 (patch)
tree54314a25a402244036a5417f098c70af441a56a8 /include/rdma
parent0a1405da9952a72dd587829a3321695adde7dca1 (diff)
RDMA/core: Export ib_open_qp() to share XRC TGT QPs
XRC TGT QPs are shared resources among multiple processes. Since the creating process may exit, allow other processes which share the same XRC domain to open an existing QP. This allows us to transfer ownership of an XRC TGT QP to another process. Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index dfd9b87b7ffd..8705539bce75 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -605,6 +605,13 @@ struct ib_qp_init_attr {
605 u8 port_num; /* special QP types only */ 605 u8 port_num; /* special QP types only */
606}; 606};
607 607
608struct ib_qp_open_attr {
609 void (*event_handler)(struct ib_event *, void *);
610 void *qp_context;
611 u32 qp_num;
612 enum ib_qp_type qp_type;
613};
614
608enum ib_rnr_timeout { 615enum ib_rnr_timeout {
609 IB_RNR_TIMER_655_36 = 0, 616 IB_RNR_TIMER_655_36 = 0,
610 IB_RNR_TIMER_000_01 = 1, 617 IB_RNR_TIMER_000_01 = 1,
@@ -932,6 +939,9 @@ struct ib_qp {
932 struct ib_srq *srq; 939 struct ib_srq *srq;
933 struct ib_xrcd *xrcd; /* XRC TGT QPs only */ 940 struct ib_xrcd *xrcd; /* XRC TGT QPs only */
934 struct list_head xrcd_list; 941 struct list_head xrcd_list;
942 atomic_t usecnt; /* count times opened */
943 struct list_head open_list;
944 struct ib_qp *real_qp;
935 struct ib_uobject *uobject; 945 struct ib_uobject *uobject;
936 void (*event_handler)(struct ib_event *, void *); 946 void (*event_handler)(struct ib_event *, void *);
937 void *qp_context; 947 void *qp_context;
@@ -1488,15 +1498,23 @@ int ib_query_qp(struct ib_qp *qp,
1488int ib_destroy_qp(struct ib_qp *qp); 1498int ib_destroy_qp(struct ib_qp *qp);
1489 1499
1490/** 1500/**
1491 * ib_release_qp - Release an external reference to a QP. 1501 * ib_open_qp - Obtain a reference to an existing sharable QP.
1502 * @xrcd - XRC domain
1503 * @qp_open_attr: Attributes identifying the QP to open.
1504 *
1505 * Returns a reference to a sharable QP.
1506 */
1507struct ib_qp *ib_open_qp(struct ib_xrcd *xrcd,
1508 struct ib_qp_open_attr *qp_open_attr);
1509
1510/**
1511 * ib_close_qp - Release an external reference to a QP.
1492 * @qp: The QP handle to release 1512 * @qp: The QP handle to release
1493 * 1513 *
1494 * The specified QP handle is released by the caller. If the QP is 1514 * The opened QP handle is released by the caller. The underlying
1495 * referenced internally, it is not destroyed until all internal 1515 * shared QP is not destroyed until all internal references are released.
1496 * references are released. After releasing the qp, the caller
1497 * can no longer access it and all events on the QP are discarded.
1498 */ 1516 */
1499int ib_release_qp(struct ib_qp *qp); 1517int ib_close_qp(struct ib_qp *qp);
1500 1518
1501/** 1519/**
1502 * ib_post_send - Posts a list of work requests to the send queue of 1520 * ib_post_send - Posts a list of work requests to the send queue of