author | Sharath M Srinivasan <sharath.srinivasan@oracle.com> |
Thu, 13 Apr 2017 20:30:48 -0700 | |
changeset 7865 | 22ec3267b2a3 |
permissions | -rw-r--r-- |
7865
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
1 |
#This patch was developed both in-house and from outside. We plan to submit it |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
2 |
#upstream, but do not yet have a target date for doing so |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
3 |
# |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
4 |
# HG changeset patch |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
5 |
# Parent 90d898abcac39d3fc4a631a678f0bb7bbe28d877 |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
6 |
25759055 OFUV (Userland) support for XRC APIs |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
7 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
8 |
diff -r 90d898abcac3 src/mlx4.c |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
9 |
--- a/src/mlx4.c Mon Nov 21 11:48:10 2016 -0800 |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
10 |
+++ b/src/mlx4.c Mon Mar 20 14:22:58 2017 -0700 |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
11 |
@@ -274,6 +274,8 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
12 |
verbs_set_ctx_op(verbs_ctx, open_qp, mlx4_open_qp); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
13 |
verbs_set_ctx_op(verbs_ctx, drv_ibv_create_flow, ibv_cmd_create_flow); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
14 |
verbs_set_ctx_op(verbs_ctx, drv_ibv_destroy_flow, ibv_cmd_destroy_flow); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
15 |
+ verbs_set_ctx_op(verbs_ctx, drv_set_legacy_xrc, mlx4_set_legacy_xrc); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
16 |
+ verbs_set_ctx_op(verbs_ctx, drv_get_legacy_xrc, mlx4_get_legacy_xrc); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
17 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
18 |
return 0; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
19 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
20 |
diff -r 90d898abcac3 src/mlx4.h |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
21 |
--- a/src/mlx4.h Mon Nov 21 11:48:10 2016 -0800 |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
22 |
+++ b/src/mlx4.h Mon Mar 20 14:22:58 2017 -0700 |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
23 |
@@ -233,6 +233,7 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
24 |
uint32_t *db; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
25 |
uint16_t counter; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
26 |
uint8_t ext_srq; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
27 |
+ struct ibv_srq_legacy *ibv_srq_legacy; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
28 |
}; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
29 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
30 |
struct mlx4_wq { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
31 |
@@ -464,4 +465,7 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
32 |
struct mlx4_ah *ah); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
33 |
void mlx4_free_av(struct mlx4_ah *ah); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
34 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
35 |
+void *mlx4_get_legacy_xrc(struct ibv_srq *srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
36 |
+void mlx4_set_legacy_xrc(struct ibv_srq *srq, void *legacy_xrc_srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
37 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
38 |
#endif /* MLX4_H */ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
39 |
diff -r 90d898abcac3 src/qp.c |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
40 |
--- a/src/qp.c Mon Nov 21 11:48:10 2016 -0800 |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
41 |
+++ b/src/qp.c Mon Mar 20 14:22:58 2017 -0700 |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
42 |
@@ -247,6 +247,7 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
43 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
44 |
switch (ibqp->qp_type) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
45 |
case IBV_QPT_XRC_SEND: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
46 |
+ case IBV_QPT_XRC: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
47 |
ctrl->srcrb_flags |= MLX4_REMOTE_SRQN_FLAGS(wr); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
48 |
/* fall through */ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
49 |
case IBV_QPT_RC: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
50 |
@@ -559,6 +560,7 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
51 |
break; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
52 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
53 |
case IBV_QPT_XRC_SEND: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
54 |
+ case IBV_QPT_XRC: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
55 |
case IBV_QPT_RC: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
56 |
size += sizeof (struct mlx4_wqe_raddr_seg); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
57 |
/* |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
58 |
@@ -596,9 +598,11 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
59 |
qp->buf.buf = qpbuf; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
60 |
qp->buf.length = buflen; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
61 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
62 |
- qp->sq.wrid = malloc(qp->sq.wqe_cnt * sizeof (uint64_t)); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
63 |
- if (!qp->sq.wrid) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
64 |
- return -1; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
65 |
+ if (qp->sq.wqe_cnt) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
66 |
+ qp->sq.wrid = malloc(qp->sq.wqe_cnt * sizeof (uint64_t)); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
67 |
+ if (!qp->sq.wrid) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
68 |
+ return -1; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
69 |
+ } |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
70 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
71 |
if (qp->rq.wqe_cnt) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
72 |
qp->rq.wrid = malloc(qp->rq.wqe_cnt * sizeof (uint64_t)); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
73 |
@@ -628,16 +632,20 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
74 |
qp->sq.offset = 0; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
75 |
} |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
76 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
77 |
- if ((long int)qp->buf.length < (long int)qp->buf_size) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
78 |
- fprintf(stderr, PFX "QP kernel buffer size %lu < user buf " |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
79 |
- "size %d\n", (unsigned long)qp->buf.length, qp->buf_size); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
80 |
- } |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
81 |
- if ((!rq_off && qp->rq.offset) || (!sq_off && qp->sq.offset)) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
82 |
- fprintf(stderr, PFX "QP kernel and user out of sync on " |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
83 |
- "buffer order\n"); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
84 |
- } |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
85 |
+ if (qp->buf_size) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
86 |
+ if ((long int)qp->buf.length < (long int)qp->buf_size) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
87 |
+ fprintf(stderr, PFX "QP kernel buffer size %lu < user " |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
88 |
+ "buf size %d\n", (unsigned long)qp->buf.length, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
89 |
+ qp->buf_size); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
90 |
+ } |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
91 |
+ if ((!rq_off && qp->rq.offset) || (!sq_off && qp->sq.offset)) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
92 |
+ fprintf(stderr, PFX "QP kernel and user out of sync on " |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
93 |
+ "buffer order\n"); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
94 |
+ } |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
95 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
96 |
- memset(qp->buf.buf, 0, qp->buf_size); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
97 |
+ memset(qp->buf.buf, 0, qp->buf_size); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
98 |
+ } else |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
99 |
+ qp->buf.buf = NULL; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
100 |
return 0; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
101 |
} |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
102 |
#endif |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
103 |
@@ -705,6 +713,7 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
104 |
break; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
105 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
106 |
case IBV_QPT_XRC_SEND: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
107 |
+ case IBV_QPT_XRC: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
108 |
case IBV_QPT_UC: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
109 |
case IBV_QPT_RC: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
110 |
wqe_size -= sizeof (struct mlx4_wqe_raddr_seg); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
111 |
diff -r 90d898abcac3 src/srq.c |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
112 |
--- a/src/srq.c Mon Nov 21 11:48:10 2016 -0800 |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
113 |
+++ b/src/srq.c Mon Mar 20 14:22:58 2017 -0700 |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
114 |
@@ -66,13 +66,17 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
115 |
struct ibv_recv_wr *wr, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
116 |
struct ibv_recv_wr **bad_wr) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
117 |
{ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
118 |
- struct mlx4_srq *srq = to_msrq(ibsrq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
119 |
+ struct mlx4_srq *srq; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
120 |
struct mlx4_wqe_srq_next_seg *next; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
121 |
struct mlx4_wqe_data_seg *scat; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
122 |
int err = 0; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
123 |
int nreq; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
124 |
int i; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
125 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
126 |
+ if (ibsrq->handle == LEGACY_XRC_SRQ_HANDLE) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
127 |
+ ibsrq = (struct ibv_srq *)(((struct ibv_srq_legacy *) ibsrq)->ibv_srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
128 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
129 |
+ srq = to_msrq(ibsrq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
130 |
pthread_spin_lock(&srq->lock); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
131 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
132 |
for (nreq = 0; wr; ++nreq, wr = wr->next) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
133 |
@@ -290,6 +294,9 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
134 |
struct mlx4_create_srq_resp resp; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
135 |
struct mlx4_srq *srq; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
136 |
int ret; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
137 |
+#if defined(__SVR4) && defined(__sun) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
138 |
+ void *srqbuf; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
139 |
+#endif |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
140 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
141 |
/* Sanity check SRQ size before proceeding */ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
142 |
if (attr_ex->attr.max_wr > 1 << 16 || attr_ex->attr.max_sge > 64) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
143 |
@@ -342,9 +349,67 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
144 |
attr_ex, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
145 |
&cmd.ibv_cmd, sizeof cmd, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
146 |
&resp.ibv_resp, sizeof resp); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
147 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
148 |
+#if defined(__SVR4) && defined(__sun) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
149 |
+ if (ret) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
150 |
+ goto err; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
151 |
+ } |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
152 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
153 |
+ /* |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
154 |
+ * The kernel driver passes back mmap information for mapping the |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
155 |
+ * SRQ work queue memory it allocated and the doorbell for |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
156 |
+ * for posting. |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
157 |
+ */ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
158 |
+ if (resp.mdd.msrq_rev < 1) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
159 |
+ fprintf(stderr, PFX "libmlx4_create_xrc_srq libmlx4/hermon umap " |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
160 |
+ "rev mismatch (kernel rev=%d)\n", resp.mdd.msrq_rev); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
161 |
+ goto err_destroy; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
162 |
+ } |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
163 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
164 |
+ srqbuf = mmap64((void *)0, resp.mdd.msrq_maplen, (PROT_READ | PROT_WRITE), |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
165 |
+ MAP_SHARED, attr_ex->pd->context->mmap_fd, resp.mdd.msrq_mapoffset); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
166 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
167 |
+ if (srqbuf == MAP_FAILED) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
168 |
+ goto err_destroy; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
169 |
+ } |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
170 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
171 |
+ srq->buf.buf = srqbuf; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
172 |
+ srq->buf.length = resp.mdd.msrq_maplen; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
173 |
+ srq->max = resp.ibv_resp.max_wr; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
174 |
+ srq->max_gs = resp.ibv_resp.max_sge; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
175 |
+ srq->verbs_srq.srq_num = srq->srqn = resp.mdd.msrq_srqnum; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
176 |
+ srq->counter = 0; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
177 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
178 |
+ srq->db = mlx4_alloc_db(to_mctx(attr_ex->pd->context), |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
179 |
+ resp.mdd.msrq_rdbr_mapoffset, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
180 |
+ resp.mdd.msrq_rdbr_maplen, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
181 |
+ resp.mdd.msrq_rdbr_offset); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
182 |
+ if (srq->db == NULL) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
183 |
+ goto err_unmap; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
184 |
+ } |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
185 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
186 |
+ /* |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
187 |
+ * The following call only initializes memory and control structures, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
188 |
+ * it utilizes the memory allocated by the kernel. |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
189 |
+ * It also allocates the srq->wrid memory. |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
190 |
+ */ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
191 |
+ if (mlx4_set_srq_buf(attr_ex->pd, srq, resp.mdd.msrq_wqesz, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
192 |
+ resp.mdd.msrq_numwqe)) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
193 |
+ goto err_db; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
194 |
+ } |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
195 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
196 |
+ /* |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
197 |
+ * The returned max wr will have been rounded up to the nearest |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
198 |
+ * power of 2, subtracting 1 from that and reporting that value |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
199 |
+ * as the max will give us the required free WR in the queue, as |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
200 |
+ * in OFED. |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
201 |
+ */ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
202 |
+ attr_ex->attr.max_wr -= 1; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
203 |
+#else |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
204 |
if (ret) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
205 |
goto err_db; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
206 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
207 |
+#endif |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
208 |
ret = mlx4_store_xsrq(&to_mctx(context)->xsrq_table, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
209 |
srq->verbs_srq.srq_num, srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
210 |
if (ret) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
211 |
@@ -352,13 +417,35 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
212 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
213 |
return &srq->verbs_srq.srq; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
214 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
215 |
-err_destroy: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
216 |
- ibv_cmd_destroy_srq(&srq->verbs_srq.srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
217 |
err_db: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
218 |
mlx4_free_db(to_mctx(context), MLX4_DB_TYPE_RQ, srq->db); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
219 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
220 |
+#if defined(__SVR4) && defined(__sun) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
221 |
+ if (srq->wrid) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
222 |
+ free(srq->wrid); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
223 |
+err_unmap: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
224 |
+ mlx4_free_buf(&srq->buf); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
225 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
226 |
+err_destroy: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
227 |
+ /* |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
228 |
+ * Calling ibv_cmd_destroy_srq() will try and take the ibv_srq |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
229 |
+ * mutex that is initialised by the ibv_create_srq() entry point |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
230 |
+ * that called us AFTER we return, so its not initialised yet. |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
231 |
+ * So initialised it here so the destroy call doesn't hang. |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
232 |
+ */ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
233 |
+ pthread_mutex_init(&(srq->verbs_srq.srq.mutex), NULL); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
234 |
+ pthread_cond_init(&(srq->verbs_srq.srq.cond), NULL); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
235 |
+ srq->verbs_srq.srq.events_completed = 0; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
236 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
237 |
+ ibv_cmd_destroy_srq(&srq->verbs_srq.srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
238 |
+#else |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
239 |
+err_destroy: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
240 |
+ ibv_cmd_destroy_srq(&srq->verbs_srq.srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
241 |
err_free: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
242 |
free(srq->wrid); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
243 |
mlx4_free_buf(&srq->buf); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
244 |
+#endif |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
245 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
246 |
err: |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
247 |
free(srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
248 |
return NULL; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
249 |
diff -r 90d898abcac3 src/verbs.c |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
250 |
--- a/src/verbs.c Mon Nov 21 11:48:10 2016 -0800 |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
251 |
+++ b/src/verbs.c Mon Mar 20 14:22:58 2017 -0700 |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
252 |
@@ -549,6 +549,21 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
253 |
return 0; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
254 |
} |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
255 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
256 |
+void *mlx4_get_legacy_xrc(struct ibv_srq *srq) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
257 |
+{ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
258 |
+ struct mlx4_srq *msrq = to_msrq(srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
259 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
260 |
+ return msrq->ibv_srq_legacy; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
261 |
+} |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
262 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
263 |
+void mlx4_set_legacy_xrc(struct ibv_srq *srq, void *legacy_xrc_srq) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
264 |
+{ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
265 |
+ struct mlx4_srq *msrq = to_msrq(srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
266 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
267 |
+ msrq->ibv_srq_legacy = legacy_xrc_srq; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
268 |
+ return; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
269 |
+} |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
270 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
271 |
struct ibv_srq *mlx4_create_srq(struct ibv_pd *pd, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
272 |
struct ibv_srq_init_attr *attr) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
273 |
{ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
274 |
@@ -564,7 +579,7 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
275 |
if (attr->attr.max_wr > 1 << 16 || attr->attr.max_sge > 64) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
276 |
return NULL; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
277 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
278 |
- srq = malloc(sizeof *srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
279 |
+ srq = calloc(1, sizeof *srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
280 |
if (!srq) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
281 |
return NULL; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
282 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
283 |
@@ -724,6 +739,9 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
284 |
{ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
285 |
struct ibv_modify_srq cmd; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
286 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
287 |
+ if (srq->handle == LEGACY_XRC_SRQ_HANDLE) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
288 |
+ srq = (struct ibv_srq *)(((struct ibv_srq_legacy *) srq)->ibv_srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
289 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
290 |
#if !(defined(__SVR4) && defined(__sun)) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
291 |
return ibv_cmd_modify_srq(srq, attr, attr_mask, &cmd, sizeof cmd); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
292 |
#else |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
293 |
@@ -741,6 +759,9 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
294 |
{ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
295 |
struct ibv_query_srq cmd; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
296 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
297 |
+ if (srq->handle == LEGACY_XRC_SRQ_HANDLE) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
298 |
+ srq = (struct ibv_srq *)(((struct ibv_srq_legacy *) srq)->ibv_srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
299 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
300 |
#if !(defined(__SVR4) && defined(__sun)) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
301 |
return ibv_cmd_query_srq(srq, attr, &cmd, sizeof cmd); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
302 |
#else |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
303 |
@@ -757,9 +778,23 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
304 |
int mlx4_destroy_srq(struct ibv_srq *srq) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
305 |
{ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
306 |
int ret; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
307 |
+ struct ibv_srq *legacy_srq = NULL; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
308 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
309 |
- if (to_msrq(srq)->ext_srq) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
310 |
- return mlx4_destroy_xrc_srq(srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
311 |
+ if (srq->handle == LEGACY_XRC_SRQ_HANDLE) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
312 |
+ legacy_srq = srq; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
313 |
+ srq = (struct ibv_srq *)(((struct ibv_srq_legacy *) srq)->ibv_srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
314 |
+ } |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
315 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
316 |
+ if (to_msrq(srq)->ext_srq) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
317 |
+ ret = mlx4_destroy_xrc_srq(srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
318 |
+ if (ret) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
319 |
+ return ret; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
320 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
321 |
+ if (legacy_srq) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
322 |
+ free(legacy_srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
323 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
324 |
+ return 0; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
325 |
+ } |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
326 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
327 |
ret = ibv_cmd_destroy_srq(srq); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
328 |
if (ret) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
329 |
@@ -783,7 +818,7 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
330 |
struct ibv_create_qp_resp resp; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
331 |
#else |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
332 |
struct mlx4_create_qp_resp resp; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
333 |
- void *qpbuf; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
334 |
+ void *qpbuf = NULL; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
335 |
#endif |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
336 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
337 |
/* Sanity check QP size before proceeding */ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
338 |
@@ -813,7 +848,8 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
339 |
} |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
340 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
341 |
if (attr->srq || attr->qp_type == IBV_QPT_XRC_SEND || |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
342 |
- attr->qp_type == IBV_QPT_XRC_RECV) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
343 |
+ attr->qp_type == IBV_QPT_XRC_RECV || |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
344 |
+ attr->qp_type == IBV_QPT_XRC) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
345 |
attr->cap.max_recv_wr = qp->rq.wqe_cnt = attr->cap.max_recv_sge = 0; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
346 |
} else { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
347 |
#if !(defined(__SVR4) && defined(__sun)) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
348 |
@@ -900,18 +936,22 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
349 |
"rev mismatch (kernel rev=%d)\n", resp.mdd.mqp_rev); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
350 |
goto err_destroy; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
351 |
} |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
352 |
- qpbuf = mmap64((void *)0, resp.mdd.mqp_maplen, (PROT_READ | PROT_WRITE), |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
353 |
- MAP_SHARED, context->mmap_fd, resp.mdd.mqp_mapoffset); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
354 |
- |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
355 |
- if (qpbuf == MAP_FAILED) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
356 |
- goto err_destroy; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
357 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
358 |
- /* |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
359 |
- * Need to set qp->buf here in case alloc_db fails then |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
360 |
- * we'll call mlx4_free_buf() to umap. |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
361 |
- */ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
362 |
- qp->buf.buf = qpbuf; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
363 |
- qp->buf.length = resp.mdd.mqp_maplen; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
364 |
+ if (resp.mdd.mqp_maplen != 0) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
365 |
+ qpbuf = mmap64((void *)0, resp.mdd.mqp_maplen, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
366 |
+ (PROT_READ | PROT_WRITE), MAP_SHARED, context->mmap_fd, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
367 |
+ resp.mdd.mqp_mapoffset); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
368 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
369 |
+ if (qpbuf == MAP_FAILED) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
370 |
+ goto err_destroy; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
371 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
372 |
+ /* |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
373 |
+ * Need to set qp->buf here in case alloc_db fails then |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
374 |
+ * we'll call mlx4_free_buf() to umap. |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
375 |
+ */ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
376 |
+ qp->buf.buf = qpbuf; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
377 |
+ qp->buf.length = resp.mdd.mqp_maplen; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
378 |
+ } |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
379 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
380 |
if (attr->cap.max_recv_sge) { |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
381 |
qp->db = mlx4_alloc_db(to_mctx(context), |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
382 |
@@ -934,10 +974,12 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
383 |
qp->sq_spare_wqes = resp.mdd.mqp_sq_headroomwqes; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
384 |
qp->sq.wqe_cnt = resp.mdd.mqp_sq_numwqe; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
385 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
386 |
- if (attr->srq) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
387 |
- qp->rq.wqe_cnt = 0; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
388 |
+ if (attr->srq || attr->qp_type == IBV_QPT_XRC || |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
389 |
+ attr->qp_type == IBV_QPT_XRC_SEND || |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
390 |
+ attr->qp_type == IBV_QPT_XRC_RECV) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
391 |
+ qp->rq.wqe_cnt = 0; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
392 |
else |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
393 |
- qp->rq.wqe_cnt = resp.mdd.mqp_rq_numwqe; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
394 |
+ qp->rq.wqe_cnt = resp.mdd.mqp_rq_numwqe; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
395 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
396 |
if (mlx4_set_qp_buf(attr->pd, qp, qpbuf, resp.mdd.mqp_maplen, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
397 |
resp.mdd.mqp_rq_wqesz, resp.mdd.mqp_rq_off, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
398 |
@@ -1020,12 +1062,23 @@ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
399 |
struct ibv_qp_init_attr_ex attr_ex; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
400 |
struct ibv_qp *qp; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
401 |
|
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
402 |
- memcpy(&attr_ex, attr, sizeof *attr); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
403 |
+ /* We should copy below only the shared fields excluding the xrc_domain field. |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
404 |
+ * Otherwise we may have an ABI issue with applications that were compiled |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
405 |
+ * without the xrc_domain field. The xrc_domain any way has no affect in |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
406 |
+ * the sender side, no need to copy in/out. |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
407 |
+ */ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
408 |
+ int init_attr_base_size = offsetof(struct ibv_qp_init_attr, |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
409 |
+ xrc_domain); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
410 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
411 |
+ memset(&attr_ex, 0, sizeof(attr_ex)); /* pre-set all fields to zero */ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
412 |
+ /* copying only shared fields */ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
413 |
+ memcpy(&attr_ex, attr, init_attr_base_size); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
414 |
attr_ex.comp_mask = IBV_QP_INIT_ATTR_PD; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
415 |
attr_ex.pd = pd; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
416 |
+ |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
417 |
qp = mlx4_create_qp_ex(pd->context, &attr_ex); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
418 |
if (qp) |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
419 |
- memcpy(attr, &attr_ex, sizeof *attr); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
420 |
+ memcpy(attr, &attr_ex, init_attr_base_size); |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
421 |
return qp; |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
422 |
} |
22ec3267b2a3
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff
changeset
|
423 |