aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/mlx4/device.h9
-rw-r--r--include/linux/mlx4/qp.h3
-rw-r--r--include/rdma/ib_user_verbs.h48
-rw-r--r--include/rdma/ib_verbs.h88
-rw-r--r--include/rdma/iw_cm.h4
-rw-r--r--include/rdma/rdma_cm.h1
-rw-r--r--include/rdma/rdma_user_cm.h3
7 files changed, 148 insertions, 8 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index ce9ef491addf..ff3ccd5c44d6 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -61,6 +61,7 @@ enum {
61 MLX4_DEV_CAP_FLAG_RC = 1LL << 0, 61 MLX4_DEV_CAP_FLAG_RC = 1LL << 0,
62 MLX4_DEV_CAP_FLAG_UC = 1LL << 1, 62 MLX4_DEV_CAP_FLAG_UC = 1LL << 1,
63 MLX4_DEV_CAP_FLAG_UD = 1LL << 2, 63 MLX4_DEV_CAP_FLAG_UD = 1LL << 2,
64 MLX4_DEV_CAP_FLAG_XRC = 1LL << 3,
64 MLX4_DEV_CAP_FLAG_SRQ = 1LL << 6, 65 MLX4_DEV_CAP_FLAG_SRQ = 1LL << 6,
65 MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1LL << 7, 66 MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1LL << 7,
66 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8, 67 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8,
@@ -262,6 +263,8 @@ struct mlx4_caps {
262 int num_qp_per_mgm; 263 int num_qp_per_mgm;
263 int num_pds; 264 int num_pds;
264 int reserved_pds; 265 int reserved_pds;
266 int max_xrcds;
267 int reserved_xrcds;
265 int mtt_entry_sz; 268 int mtt_entry_sz;
266 u32 max_msg_sz; 269 u32 max_msg_sz;
267 u32 page_size_cap; 270 u32 page_size_cap;
@@ -506,6 +509,8 @@ static inline void *mlx4_buf_offset(struct mlx4_buf *buf, int offset)
506 509
507int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn); 510int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn);
508void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn); 511void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn);
512int mlx4_xrcd_alloc(struct mlx4_dev *dev, u32 *xrcdn);
513void mlx4_xrcd_free(struct mlx4_dev *dev, u32 xrcdn);
509 514
510int mlx4_uar_alloc(struct mlx4_dev *dev, struct mlx4_uar *uar); 515int mlx4_uar_alloc(struct mlx4_dev *dev, struct mlx4_uar *uar);
511void mlx4_uar_free(struct mlx4_dev *dev, struct mlx4_uar *uar); 516void mlx4_uar_free(struct mlx4_dev *dev, struct mlx4_uar *uar);
@@ -545,8 +550,8 @@ void mlx4_qp_release_range(struct mlx4_dev *dev, int base_qpn, int cnt);
545int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp); 550int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp);
546void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp); 551void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp);
547 552
548int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, struct mlx4_mtt *mtt, 553int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, u32 cqn, u16 xrcdn,
549 u64 db_rec, struct mlx4_srq *srq); 554 struct mlx4_mtt *mtt, u64 db_rec, struct mlx4_srq *srq);
550void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq); 555void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq);
551int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark); 556int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark);
552int mlx4_srq_query(struct mlx4_dev *dev, struct mlx4_srq *srq, int *limit_watermark); 557int mlx4_srq_query(struct mlx4_dev *dev, struct mlx4_srq *srq, int *limit_watermark);
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 4001c8249dbb..48cc4cb97858 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -75,6 +75,7 @@ enum {
75 MLX4_QP_ST_UC = 0x1, 75 MLX4_QP_ST_UC = 0x1,
76 MLX4_QP_ST_RD = 0x2, 76 MLX4_QP_ST_RD = 0x2,
77 MLX4_QP_ST_UD = 0x3, 77 MLX4_QP_ST_UD = 0x3,
78 MLX4_QP_ST_XRC = 0x6,
78 MLX4_QP_ST_MLX = 0x7 79 MLX4_QP_ST_MLX = 0x7
79}; 80};
80 81
@@ -137,7 +138,7 @@ struct mlx4_qp_context {
137 __be32 ssn; 138 __be32 ssn;
138 __be32 params2; 139 __be32 params2;
139 __be32 rnr_nextrecvpsn; 140 __be32 rnr_nextrecvpsn;
140 __be32 srcd; 141 __be32 xrcd;
141 __be32 cqn_recv; 142 __be32 cqn_recv;
142 __be64 db_rec_addr; 143 __be64 db_rec_addr;
143 __be32 qkey; 144 __be32 qkey;
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h
index fe5b05177a2c..81aba3a73aa3 100644
--- a/include/rdma/ib_user_verbs.h
+++ b/include/rdma/ib_user_verbs.h
@@ -81,7 +81,11 @@ enum {
81 IB_USER_VERBS_CMD_MODIFY_SRQ, 81 IB_USER_VERBS_CMD_MODIFY_SRQ,
82 IB_USER_VERBS_CMD_QUERY_SRQ, 82 IB_USER_VERBS_CMD_QUERY_SRQ,
83 IB_USER_VERBS_CMD_DESTROY_SRQ, 83 IB_USER_VERBS_CMD_DESTROY_SRQ,
84 IB_USER_VERBS_CMD_POST_SRQ_RECV 84 IB_USER_VERBS_CMD_POST_SRQ_RECV,
85 IB_USER_VERBS_CMD_OPEN_XRCD,
86 IB_USER_VERBS_CMD_CLOSE_XRCD,
87 IB_USER_VERBS_CMD_CREATE_XSRQ,
88 IB_USER_VERBS_CMD_OPEN_QP
85}; 89};
86 90
87/* 91/*
@@ -222,6 +226,21 @@ struct ib_uverbs_dealloc_pd {
222 __u32 pd_handle; 226 __u32 pd_handle;
223}; 227};
224 228
229struct ib_uverbs_open_xrcd {
230 __u64 response;
231 __u32 fd;
232 __u32 oflags;
233 __u64 driver_data[0];
234};
235
236struct ib_uverbs_open_xrcd_resp {
237 __u32 xrcd_handle;
238};
239
240struct ib_uverbs_close_xrcd {
241 __u32 xrcd_handle;
242};
243
225struct ib_uverbs_reg_mr { 244struct ib_uverbs_reg_mr {
226 __u64 response; 245 __u64 response;
227 __u64 start; 246 __u64 start;
@@ -404,6 +423,17 @@ struct ib_uverbs_create_qp {
404 __u64 driver_data[0]; 423 __u64 driver_data[0];
405}; 424};
406 425
426struct ib_uverbs_open_qp {
427 __u64 response;
428 __u64 user_handle;
429 __u32 pd_handle;
430 __u32 qpn;
431 __u8 qp_type;
432 __u8 reserved[7];
433 __u64 driver_data[0];
434};
435
436/* also used for open response */
407struct ib_uverbs_create_qp_resp { 437struct ib_uverbs_create_qp_resp {
408 __u32 qp_handle; 438 __u32 qp_handle;
409 __u32 qpn; 439 __u32 qpn;
@@ -648,11 +678,25 @@ struct ib_uverbs_create_srq {
648 __u64 driver_data[0]; 678 __u64 driver_data[0];
649}; 679};
650 680
681struct ib_uverbs_create_xsrq {
682 __u64 response;
683 __u64 user_handle;
684 __u32 srq_type;
685 __u32 pd_handle;
686 __u32 max_wr;
687 __u32 max_sge;
688 __u32 srq_limit;
689 __u32 reserved;
690 __u32 xrcd_handle;
691 __u32 cq_handle;
692 __u64 driver_data[0];
693};
694
651struct ib_uverbs_create_srq_resp { 695struct ib_uverbs_create_srq_resp {
652 __u32 srq_handle; 696 __u32 srq_handle;
653 __u32 max_wr; 697 __u32 max_wr;
654 __u32 max_sge; 698 __u32 max_sge;
655 __u32 reserved; 699 __u32 srqn;
656}; 700};
657 701
658struct ib_uverbs_modify_srq { 702struct ib_uverbs_modify_srq {
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 97c98c0d89b1..bf5daafe8ecc 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -112,6 +112,7 @@ enum ib_device_cap_flags {
112 */ 112 */
113 IB_DEVICE_UD_IP_CSUM = (1<<18), 113 IB_DEVICE_UD_IP_CSUM = (1<<18),
114 IB_DEVICE_UD_TSO = (1<<19), 114 IB_DEVICE_UD_TSO = (1<<19),
115 IB_DEVICE_XRC = (1<<20),
115 IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21), 116 IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21),
116 IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22), 117 IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22),
117}; 118};
@@ -538,6 +539,11 @@ enum ib_cq_notify_flags {
538 IB_CQ_REPORT_MISSED_EVENTS = 1 << 2, 539 IB_CQ_REPORT_MISSED_EVENTS = 1 << 2,
539}; 540};
540 541
542enum ib_srq_type {
543 IB_SRQT_BASIC,
544 IB_SRQT_XRC
545};
546
541enum ib_srq_attr_mask { 547enum ib_srq_attr_mask {
542 IB_SRQ_MAX_WR = 1 << 0, 548 IB_SRQ_MAX_WR = 1 << 0,
543 IB_SRQ_LIMIT = 1 << 1, 549 IB_SRQ_LIMIT = 1 << 1,
@@ -553,6 +559,14 @@ struct ib_srq_init_attr {
553 void (*event_handler)(struct ib_event *, void *); 559 void (*event_handler)(struct ib_event *, void *);
554 void *srq_context; 560 void *srq_context;
555 struct ib_srq_attr attr; 561 struct ib_srq_attr attr;
562 enum ib_srq_type srq_type;
563
564 union {
565 struct {
566 struct ib_xrcd *xrcd;
567 struct ib_cq *cq;
568 } xrc;
569 } ext;
556}; 570};
557 571
558struct ib_qp_cap { 572struct ib_qp_cap {
@@ -581,7 +595,11 @@ enum ib_qp_type {
581 IB_QPT_UC, 595 IB_QPT_UC,
582 IB_QPT_UD, 596 IB_QPT_UD,
583 IB_QPT_RAW_IPV6, 597 IB_QPT_RAW_IPV6,
584 IB_QPT_RAW_ETHERTYPE 598 IB_QPT_RAW_ETHERTYPE,
599 /* Save 8 for RAW_PACKET */
600 IB_QPT_XRC_INI = 9,
601 IB_QPT_XRC_TGT,
602 IB_QPT_MAX
585}; 603};
586 604
587enum ib_qp_create_flags { 605enum ib_qp_create_flags {
@@ -595,6 +613,7 @@ struct ib_qp_init_attr {
595 struct ib_cq *send_cq; 613 struct ib_cq *send_cq;
596 struct ib_cq *recv_cq; 614 struct ib_cq *recv_cq;
597 struct ib_srq *srq; 615 struct ib_srq *srq;
616 struct ib_xrcd *xrcd; /* XRC TGT QPs only */
598 struct ib_qp_cap cap; 617 struct ib_qp_cap cap;
599 enum ib_sig_type sq_sig_type; 618 enum ib_sig_type sq_sig_type;
600 enum ib_qp_type qp_type; 619 enum ib_qp_type qp_type;
@@ -602,6 +621,13 @@ struct ib_qp_init_attr {
602 u8 port_num; /* special QP types only */ 621 u8 port_num; /* special QP types only */
603}; 622};
604 623
624struct ib_qp_open_attr {
625 void (*event_handler)(struct ib_event *, void *);
626 void *qp_context;
627 u32 qp_num;
628 enum ib_qp_type qp_type;
629};
630
605enum ib_rnr_timeout { 631enum ib_rnr_timeout {
606 IB_RNR_TIMER_655_36 = 0, 632 IB_RNR_TIMER_655_36 = 0,
607 IB_RNR_TIMER_000_01 = 1, 633 IB_RNR_TIMER_000_01 = 1,
@@ -786,6 +812,7 @@ struct ib_send_wr {
786 u32 rkey; 812 u32 rkey;
787 } fast_reg; 813 } fast_reg;
788 } wr; 814 } wr;
815 u32 xrc_remote_srq_num; /* XRC TGT QPs only */
789}; 816};
790 817
791struct ib_recv_wr { 818struct ib_recv_wr {
@@ -847,6 +874,7 @@ struct ib_ucontext {
847 struct list_head qp_list; 874 struct list_head qp_list;
848 struct list_head srq_list; 875 struct list_head srq_list;
849 struct list_head ah_list; 876 struct list_head ah_list;
877 struct list_head xrcd_list;
850 int closing; 878 int closing;
851}; 879};
852 880
@@ -874,6 +902,15 @@ struct ib_pd {
874 atomic_t usecnt; /* count all resources */ 902 atomic_t usecnt; /* count all resources */
875}; 903};
876 904
905struct ib_xrcd {
906 struct ib_device *device;
907 atomic_t usecnt; /* count all exposed resources */
908 struct inode *inode;
909
910 struct mutex tgt_qp_mutex;
911 struct list_head tgt_qp_list;
912};
913
877struct ib_ah { 914struct ib_ah {
878 struct ib_device *device; 915 struct ib_device *device;
879 struct ib_pd *pd; 916 struct ib_pd *pd;
@@ -898,7 +935,16 @@ struct ib_srq {
898 struct ib_uobject *uobject; 935 struct ib_uobject *uobject;
899 void (*event_handler)(struct ib_event *, void *); 936 void (*event_handler)(struct ib_event *, void *);
900 void *srq_context; 937 void *srq_context;
938 enum ib_srq_type srq_type;
901 atomic_t usecnt; 939 atomic_t usecnt;
940
941 union {
942 struct {
943 struct ib_xrcd *xrcd;
944 struct ib_cq *cq;
945 u32 srq_num;
946 } xrc;
947 } ext;
902}; 948};
903 949
904struct ib_qp { 950struct ib_qp {
@@ -907,6 +953,11 @@ struct ib_qp {
907 struct ib_cq *send_cq; 953 struct ib_cq *send_cq;
908 struct ib_cq *recv_cq; 954 struct ib_cq *recv_cq;
909 struct ib_srq *srq; 955 struct ib_srq *srq;
956 struct ib_xrcd *xrcd; /* XRC TGT QPs only */
957 struct list_head xrcd_list;
958 atomic_t usecnt; /* count times opened */
959 struct list_head open_list;
960 struct ib_qp *real_qp;
910 struct ib_uobject *uobject; 961 struct ib_uobject *uobject;
911 void (*event_handler)(struct ib_event *, void *); 962 void (*event_handler)(struct ib_event *, void *);
912 void *qp_context; 963 void *qp_context;
@@ -1165,6 +1216,10 @@ struct ib_device {
1165 struct ib_grh *in_grh, 1216 struct ib_grh *in_grh,
1166 struct ib_mad *in_mad, 1217 struct ib_mad *in_mad,
1167 struct ib_mad *out_mad); 1218 struct ib_mad *out_mad);
1219 struct ib_xrcd * (*alloc_xrcd)(struct ib_device *device,
1220 struct ib_ucontext *ucontext,
1221 struct ib_udata *udata);
1222 int (*dealloc_xrcd)(struct ib_xrcd *xrcd);
1168 1223
1169 struct ib_dma_mapping_ops *dma_ops; 1224 struct ib_dma_mapping_ops *dma_ops;
1170 1225
@@ -1459,6 +1514,25 @@ int ib_query_qp(struct ib_qp *qp,
1459int ib_destroy_qp(struct ib_qp *qp); 1514int ib_destroy_qp(struct ib_qp *qp);
1460 1515
1461/** 1516/**
1517 * ib_open_qp - Obtain a reference to an existing sharable QP.
1518 * @xrcd - XRC domain
1519 * @qp_open_attr: Attributes identifying the QP to open.
1520 *
1521 * Returns a reference to a sharable QP.
1522 */
1523struct ib_qp *ib_open_qp(struct ib_xrcd *xrcd,
1524 struct ib_qp_open_attr *qp_open_attr);
1525
1526/**
1527 * ib_close_qp - Release an external reference to a QP.
1528 * @qp: The QP handle to release
1529 *
1530 * The opened QP handle is released by the caller. The underlying
1531 * shared QP is not destroyed until all internal references are released.
1532 */
1533int ib_close_qp(struct ib_qp *qp);
1534
1535/**
1462 * ib_post_send - Posts a list of work requests to the send queue of 1536 * ib_post_send - Posts a list of work requests to the send queue of
1463 * the specified QP. 1537 * the specified QP.
1464 * @qp: The QP to post the work request on. 1538 * @qp: The QP to post the work request on.
@@ -2076,4 +2150,16 @@ int ib_attach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid);
2076 */ 2150 */
2077int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid); 2151int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid);
2078 2152
2153/**
2154 * ib_alloc_xrcd - Allocates an XRC domain.
2155 * @device: The device on which to allocate the XRC domain.
2156 */
2157struct ib_xrcd *ib_alloc_xrcd(struct ib_device *device);
2158
2159/**
2160 * ib_dealloc_xrcd - Deallocates an XRC domain.
2161 * @xrcd: The XRC domain to deallocate.
2162 */
2163int ib_dealloc_xrcd(struct ib_xrcd *xrcd);
2164
2079#endif /* IB_VERBS_H */ 2165#endif /* IB_VERBS_H */
diff --git a/include/rdma/iw_cm.h b/include/rdma/iw_cm.h
index 2d0191c90f9e..1a046b1595cc 100644
--- a/include/rdma/iw_cm.h
+++ b/include/rdma/iw_cm.h
@@ -52,8 +52,10 @@ struct iw_cm_event {
52 struct sockaddr_in local_addr; 52 struct sockaddr_in local_addr;
53 struct sockaddr_in remote_addr; 53 struct sockaddr_in remote_addr;
54 void *private_data; 54 void *private_data;
55 u8 private_data_len;
56 void *provider_data; 55 void *provider_data;
56 u8 private_data_len;
57 u8 ord;
58 u8 ird;
57}; 59};
58 60
59/** 61/**
diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h
index 26977c149c41..51988f808181 100644
--- a/include/rdma/rdma_cm.h
+++ b/include/rdma/rdma_cm.h
@@ -65,6 +65,7 @@ enum rdma_cm_event_type {
65enum rdma_port_space { 65enum rdma_port_space {
66 RDMA_PS_SDP = 0x0001, 66 RDMA_PS_SDP = 0x0001,
67 RDMA_PS_IPOIB = 0x0002, 67 RDMA_PS_IPOIB = 0x0002,
68 RDMA_PS_IB = 0x013F,
68 RDMA_PS_TCP = 0x0106, 69 RDMA_PS_TCP = 0x0106,
69 RDMA_PS_UDP = 0x0111, 70 RDMA_PS_UDP = 0x0111,
70}; 71};
diff --git a/include/rdma/rdma_user_cm.h b/include/rdma/rdma_user_cm.h
index fc82c1896f75..5348a000c8f3 100644
--- a/include/rdma/rdma_user_cm.h
+++ b/include/rdma/rdma_user_cm.h
@@ -77,7 +77,8 @@ struct rdma_ucm_create_id {
77 __u64 uid; 77 __u64 uid;
78 __u64 response; 78 __u64 response;
79 __u16 ps; 79 __u16 ps;
80 __u8 reserved[6]; 80 __u8 qp_type;
81 __u8 reserved[5];
81}; 82};
82 83
83struct rdma_ucm_create_id_resp { 84struct rdma_ucm_create_id_resp {